Skip to content

Commit 0bee90a

Browse files
committed
Update CI, dependencies & release process
1 parent cd39311 commit 0bee90a

File tree

9 files changed

+8077
-3013
lines changed

9 files changed

+8077
-3013
lines changed

.eslintignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# unconventional js
2+
/blueprints/*/files/
3+
/vendor/
4+
5+
# compiled output
6+
/dist/
7+
/tmp/
8+
9+
# dependencies
10+
/bower_components/
11+
/node_modules/
12+
13+
# misc
14+
/coverage/
15+
!.*
16+
17+
# ember-try
18+
/.node_modules.ember-try/
19+
/bower.json.ember-try
20+
/package.json.ember-try

.eslintrc.js

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,54 @@
11
module.exports = {
22
root: true,
3+
parser: '@babel/eslint-parser',
34
parserOptions: {
4-
ecmaVersion: 6,
5-
sourceType: 'module'
5+
ecmaVersion: 2020,
6+
sourceType: 'module',
7+
requireConfigFile: false,
8+
babelOptions: {
9+
configFile: false,
10+
// your babel options
11+
presets: ["@babel/preset-env"],
12+
},
613
},
7-
extends: 'eslint:recommended',
14+
plugins: [
15+
'ember'
16+
],
17+
extends: [
18+
'eslint:recommended',
19+
'plugin:ember/recommended'
20+
],
821
env: {
9-
node: true
22+
browser: true
1023
},
1124
rules: {
12-
}
25+
},
26+
overrides: [
27+
// node files
28+
{
29+
files: [
30+
'.eslintrc.js',
31+
'.template-lintrc.js',
32+
'ember-cli-build.js',
33+
'index.js',
34+
'testem.js',
35+
'blueprints/*/index.js',
36+
'config/**/*.js',
37+
'tests/**/*.js'
38+
],
39+
parserOptions: {
40+
sourceType: 'script'
41+
},
42+
env: {
43+
browser: false,
44+
node: true
45+
},
46+
plugins: ['node'],
47+
extends: ['plugin:node/recommended'],
48+
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
49+
// add your custom rules and overrides for node files here
50+
'ember/avoid-leaking-state-in-ember-objects': 'off'
51+
})
52+
}
53+
]
1354
};

.github/workflows/ci.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Continuous Integration
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
env:
12+
FORCE_COLOR: true
13+
14+
jobs:
15+
test:
16+
name: Test
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
node-version: [14.x, 16.x, 18.x, 20.x]
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
- run: yarn install
28+
- run: yarn test
29+
30+
test-floating:
31+
name: Floating Dependencies
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v2
35+
- name: Use Node.js ${{ matrix.node-version }}
36+
uses: actions/setup-node@v3
37+
with:
38+
node-version: ${{ matrix.node-version }}
39+
- uses: volta-cli/action@v1
40+
- name: install dependencies
41+
run: yarn install --no-lockfile
42+
- name: test
43+
run: yarn test

.travis.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

RELEASE.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Release Process
2+
3+
Releases are mostly automated using
4+
[release-it](https://github.com/release-it/release-it/) and
5+
[lerna-changelog](https://github.com/lerna/lerna-changelog/).
6+
7+
## Preparation
8+
9+
Since the majority of the actual release process is automated, the primary
10+
remaining task prior to releasing is confirming that all pull requests that
11+
have been merged since the last release have been labeled with the appropriate
12+
`lerna-changelog` labels and the titles have been updated to ensure they
13+
represent something that would make sense to our users. Some great information
14+
on why this is important can be found at
15+
[keepachangelog.com](https://keepachangelog.com/en/1.0.0/), but the overall
16+
guiding principle here is that changelogs are for humans, not machines.
17+
18+
When reviewing merged PR's the labels to be used are:
19+
20+
* breaking - Used when the PR is considered a breaking change.
21+
* enhancement - Used when the PR adds a new feature or enhancement.
22+
* bug - Used when the PR fixes a bug included in a previous release.
23+
* documentation - Used when the PR adds or updates documentation.
24+
* internal - Used for internal changes that still require a mention in the
25+
changelog/release notes.
26+
27+
## Release
28+
29+
Once the prep work is completed, the actual release is straight forward:
30+
31+
* First, ensure that you have installed your projects dependencies:
32+
33+
```sh
34+
yarn install
35+
```
36+
37+
* Second, ensure that you have obtained a
38+
[GitHub personal access token][generate-token] with the `repo` scope (no
39+
other permissions are needed). Make sure the token is available as the
40+
`GITHUB_AUTH` environment variable.
41+
42+
For instance:
43+
44+
```bash
45+
export GITHUB_AUTH=abc123def456
46+
```
47+
48+
[generate-token]: https://github.com/settings/tokens/new?scopes=repo&description=GITHUB_AUTH+env+variable
49+
50+
* And last (but not least 😁) do your release.
51+
52+
```sh
53+
npx release-it
54+
```
55+
56+
[release-it](https://github.com/release-it/release-it/) manages the actual
57+
release process. It will prompt you to to choose the version number after which
58+
you will have the chance to hand tweak the changelog to be used (for the
59+
`CHANGELOG.md` and GitHub release), then `release-it` continues on to tagging,
60+
pushing the tag and commits, etc.

package.json

Lines changed: 54 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,68 @@
22
"name": "ember-cli-deploy-ssh-tunnel",
33
"version": "1.0.0",
44
"description": "Open an ssh-tunnel during your ember-cli deploy",
5+
"keywords": [
6+
"ember-addon",
7+
"ember-cli-deploy-plugin"
8+
],
9+
"repository": "https://github.com/ghedamat/ember-cli-deploy-ssh-tunnel",
10+
"license": "MIT",
11+
"author": "",
512
"directories": {
613
"doc": "doc",
714
"test": "tests"
815
},
916
"scripts": {
10-
"test": "node tests/runner.js && ./node_modules/.bin/eslint index.js lib/* tests/*"
17+
"lint:js": "eslint .",
18+
"test": "node tests/runner.js && ./node_modules/.bin/eslint index.js tests/*"
1119
},
12-
"repository": "https://github.com/ghedamat/ember-cli-deploy-ssh-tunnel",
13-
"engines": {
14-
"node": ">= 4"
20+
"dependencies": {
21+
"ember-cli-deploy-plugin": "^0.2.9",
22+
"rsvp": "^4.8.5",
23+
"tunnel-ssh": "^5.0.5",
24+
"untildify": "^2.1.0"
1525
},
16-
"author": "",
17-
"license": "MIT",
1826
"devDependencies": {
19-
"chai-as-promised": "^6.0.0",
20-
"chai": "^3.5.0",
21-
"ember-cli-release": "1.0.0-beta.2",
22-
"ember-cli": "^2.12.0",
23-
"eslint": "^3.18.0",
24-
"glob": "^7.1.1",
25-
"mocha": "^3.2.0"
27+
"@babel/core": "^7.23.0",
28+
"@babel/eslint-parser": "^7.22.15",
29+
"@babel/preset-env": "^7.22.20",
30+
"@release-it-plugins/lerna-changelog": "^5.0.0",
31+
"chai": "^4.3.8",
32+
"chai-as-promised": "^7.1.1",
33+
"ember-cli": "^3.28.6",
34+
"eslint": "^8.50.0",
35+
"eslint-config-prettier": "^8.3.0",
36+
"eslint-plugin-ember": "^11.8.0",
37+
"eslint-plugin-node": "^11.1.0",
38+
"eslint-plugin-prettier": "^5.0.0",
39+
"glob": "^7.2.3",
40+
"mocha": "^3.5.3",
41+
"prettier": "^3.0.3",
42+
"release-it": "^15.5.0"
2643
},
27-
"keywords": [
28-
"ember-addon",
29-
"ember-cli-deploy-plugin"
30-
],
31-
"dependencies": {
32-
"ember-cli-deploy-plugin": "^0.2.6",
33-
"tunnel-ssh": "^5.0.5",
34-
"untildify": "^2.0.0"
44+
"engines": {
45+
"node": ">= 14"
46+
},
47+
"publishConfig": {
48+
"registry": "https://registry.npmjs.org"
49+
},
50+
"release-it": {
51+
"plugins": {
52+
"@release-it-plugins/lerna-changelog": {
53+
"infile": "CHANGELOG.md",
54+
"launchEditor": false
55+
}
56+
},
57+
"git": {
58+
"tagName": "v${version}"
59+
},
60+
"github": {
61+
"release": true,
62+
"tokenRef": "GITHUB_AUTH"
63+
}
64+
},
65+
"volta": {
66+
"node": "16.20.2",
67+
"yarn": "1.22.19"
3568
}
3669
}

tests/runner.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ if (arg === 'all') {
2323

2424
mocha.run(function(failures) {
2525
process.on('exit', function() {
26+
// eslint-disable-next-line no-process-exit -- this sets the unix return code for the process
2627
process.exit(failures);
2728
});
2829
});

tests/unit/index-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,16 @@ describe('ssh-tunnel plugin', function() {
6767
});
6868
});
6969

70-
it('raises about missing required config', function() {
70+
it('raises about missing required config', async function() {
7171
config = {};
7272
context = {
7373
ui: mockUi,
7474
config: config
7575
};
7676
plugin.beforeHook(context);
77-
assert.throws(function(){
77+
await assert.throws(function(){
7878
plugin.configure(context);
79-
});
79+
}, /Missing required/);
8080
var messages = mockUi.messages.reduce(function(previous, current) {
8181
if (/- Missing required config:\s.*/.test(current)) {
8282
previous.push(current);

0 commit comments

Comments
 (0)