Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated CI and dependencies. Dropped support for Node 12 and Ember 3.24 LTS. #388

Merged
merged 13 commits into from
Dec 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# compiled output
/test-app/dist/
/test-app/tmp/
/scenario
/dist

# dependencies
Expand All @@ -13,4 +12,3 @@
!.*
.*/
.eslintcache

130 changes: 80 additions & 50 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Node CI
name: CI

on:
push:
Expand All @@ -9,80 +9,110 @@ on:
- 'v*'
pull_request:

env:
NODE_VERSION: 16

jobs:
test:
lint:
name: Lint files
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
timeout-minutes: 5
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good practice to set timeout-minutes to a low value so that CI can fail early when something goes wrong. (The default value is 360 minutes.)

steps:
- uses: actions/checkout@v1
- uses: volta-cli/action@v1
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
- name: Check out a copy of the repo
uses: actions/checkout@v3

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn --frozen-lockfile
- name: lint
cache: 'yarn'
node-version: ${{ env.NODE_VERSION }}

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Lint
run: yarn lint
- name: test


test:
name: Tests
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check out a copy of the repo
uses: actions/checkout@v3

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
cache: 'yarn'
node-version: ${{ env.NODE_VERSION }}

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Test
run: yarn test:ember
- id: set-matrix
run: echo "::set-output name=matrix::$(yarn --silent scenario-tester list --files ./scenarios.js --matrix 'yarn qunit ./scenarios.js --filter %s:')"
working-directory: test-app

compat-scenarios:
needs: test
name: ${{ matrix.name }}

try-scenarios:
name: ${{ matrix.try-scenario }}
needs: [lint, test]
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: false
matrix: ${{fromJson(needs.test.outputs.matrix)}}
matrix:
try-scenario:
- ember-lts-3.28
- ember-lts-4.4
- ember-release
- ember-beta
- ember-canary
- embroider-safe
- embroider-optimized
steps:
- uses: actions/checkout@v1
- uses: volta-cli/action@v1
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
- name: Check out a copy of the repo
uses: actions/checkout@v3

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --no-lockfile
- name: test
run: ${{ matrix.command }}
cache: 'yarn'
node-version: ${{ env.NODE_VERSION }}

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Test
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }}
working-directory: test-app


publish:
name: Publish to npm
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [lint, test, try-scenarios]
runs-on: ubuntu-latest
needs: [test, compat-scenarios]
timeout-minutes: 5
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check out a copy of the repo
uses: actions/checkout@v3

- name: Install node
uses: actions/setup-node@v2
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
cache: yarn
node-version: 14.x
cache: 'yarn'
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'

- name: install dependencies
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: auto-dist-tag
- name: Run auto-dist-tag
run: npx auto-dist-tag@1 --write

- name: publish to npm
- name: Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# compiled output
/test-app/dist/
/test-app/tmp/
/scenario
/dist

# dependencies
Expand Down
2 changes: 1 addition & 1 deletion .template-lintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ module.exports = {
rules: {
'no-implicit-this': false,
},
ignore: ['scenario/**', 'test-app/node_modules/**', 'test-app/dist/**'],
ignore: ['test-app/node_modules/**', 'test-app/dist/**'],
};
10 changes: 1 addition & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,7 @@
- `yarn start` - Run the test-app for interactive development
- view the app at [http://localhost:4200](http://localhost:4200).
- run the test suite at [http://localhost:4200/tests](http://localhost:4200/tests)
- `yarn test:ember` – Run the test suite (with its default dependencies) and then exit.
- `yarn test` – Run the test suite under each tested scenario and then exit.
- `yarn scenario:list` - List the names of all tested scenarios.
- `yarn scenario:run $SCENARIO_NAME` - Run only one scenario and then exit.
- `yarn scenario:output $SCENARIO_NAME` - Create a copy of the test-app in the `./scenario` directory that is configured for the named scenario. Useful to interactively run and debug individual scenarios. (Caution: due to https://github.com/stefanpenner/node-fixturify-project/issues/56 you may need to invoke commands like "ember" as `./node_modules/ember-cli/bin/ember` because executables are not linked automatically into the scenario yet.)

We use [scenario-tester](https://github.com/ef4/scenario-tester) to reconfigure the test-app with different dependencies to ensure that the addon works with all the intended Ember versions and build system variations.

`./test-app/scenarios.js` defines the scenarios, which link to dependencies that all appear in `package.json`. We can test multiple versions of the same package without multiple NPM installs by using NPM aliasing.
- `yarn test` – Run `lint` and `test` scripts

## The test-app

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Displays a nice welcome page for newly generated applications with links to reso
Compatibility
------------------------------------------------------------------------------

* Ember.js v3.20 or above
* Ember CLI v3.20 or above
* Node.js v12 or above
* Ember.js v3.28 or above
* Ember CLI v3.28 or above
* Node.js v14 or above


Installation
Expand Down
84 changes: 35 additions & 49 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,88 +22,74 @@
"images"
],
"scripts": {
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
"link-test-app": "addon-dev link-test-app",
"lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"",
"lint:devdeps": "addon-dev sync-dev-deps --lint",
Comment on lines +25 to +27
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seemed like, the addon had been made a v2 addon before it was decided (e.g. via https://github.com/embroider-build/addon-blueprint) that workspaces are a good option.

At the moment, I'm thinking that it may be easier to introduce TypeScript before introducing yarn workspace.

"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"lint:devdeps": "addon-dev sync-dev-deps --lint",
"scenario:list": "scenario-tester list --files test-app/scenarios.js",
"scenario:output": "scenario-tester output --files test-app/scenarios.js --outdir scenario --scenario ",
"scenario:run": "cd test-app && qunit scenarios.js --filter ",
"start": "npm-run-all --parallel start:*",
"start:test-app": "cd test-app && ember serve",
"prepare": "concurrently \"npm:prepublishOnly\" \"npm:link-test-app\"",
"prepublishOnly": "rollup --config",
"start": "concurrently \"npm:start:*\"",
"start:build": "rollup --config --watch",
"start:test-app": "cd test-app && ember serve",
"sync-dev-deps": "addon-dev sync-dev-deps",
"test": "npm-run-all lint:* test:*",
"test:ember": "cd test-app && ember test",
"test:ember-compatibility": "cd test-app && qunit scenarios.js",
"prepare": "npm-run-all prepublishOnly link-test-app",
"link-test-app": "addon-dev link-test-app",
"prepublishOnly": "rollup --config"
"test": "concurrently \"npm:lint\" \"npm:test:*\" --names \"lint,test:\"",
"test:ember": "cd test-app && ember test"
},
"dependencies": {
"@embroider/addon-shim": "^1.5.0"
},
"devDependencies": {
"@babel/core": "^7.15.5",
"@ember/optional-features": "^2.0.0",
"@ember/test-helpers": "^2.4.2",
"@ember/test-helpers": "^2.8.1",
"@embroider/addon-dev": "^1.5.0",
"@embroider/compat-latest": "npm:@embroider/compat@latest",
"@embroider/core-latest": "npm:@embroider/core@latest",
"@embroider/test-setup": "^1.5.0",
"@embroider/webpack-latest": "npm:@embroider/webpack@latest",
"@glimmer/component": "^1.0.4",
"@glimmer/tracking": "^1.0.4",
"@glimmer/component": "^1.1.2",
"@glimmer/tracking": "^1.1.2",
"@rollup/plugin-babel": "^5.3.0",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"ember-auto-import": "^2.4.0",
"ember-cli": "~3.28.0",
"ember-cli-3.20": "npm:ember-cli@~3.20.0",
"ember-cli-3.24": "npm:ember-cli@~3.24.0",
"concurrently": "^7.6.0",
"ember-auto-import": "^2.5.0",
"ember-cli": "~4.9.2",
"ember-cli-app-version": "^5.0.0",
"ember-cli-babel": "^7.26.6",
"ember-cli-beta": "npm:ember-cli@beta",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-htmlbars": "^5.7.1",
"ember-cli-babel": "^7.26.11",
"ember-cli-dependency-checker": "^3.3.1",
"ember-cli-htmlbars": "^6.1.1",
"ember-cli-inject-live-reload": "^2.1.0",
"ember-cli-latest": "npm:ember-cli@latest",
"ember-cli-sri": "^2.1.1",
"ember-cli-terser": "^4.0.2",
"ember-export-application-global": "^2.0.1",
"ember-fetch": "^8.1.1",
"ember-fetch": "^8.1.2",
"ember-load-initializers": "^2.1.2",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-page-title": "^6.2.2",
"ember-qunit": "^5.1.4",
"ember-resolver": "^8.0.2",
"ember-source": "~3.28.0",
"ember-source-3.20": "npm:ember-source@~3.20.0",
"ember-source-3.24": "npm:ember-source@~3.24.0",
"ember-source-beta": "npm:ember-source@beta",
"ember-source-canary": "npm:ember-source@alpha",
"ember-source-latest": "npm:ember-source@latest",
"ember-template-lint": "^3.6.0",
"ember-page-title": "^7.0.0",
"ember-qunit": "^6.0.0",
"ember-resolver": "^8.0.3",
"ember-source": "~4.9.1",
"ember-source-channel-url": "^3.0.0",
"ember-template-lint": "^5.2.0",
"ember-try": "^2.0.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.5.4",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-ember": "^11.2.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.4.1",
"eslint-plugin-qunit": "^6.2.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-qunit": "^7.3.4",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.3.2",
"qunit": "^2.16.0",
"qunit-dom": "^1.6.0",
"prettier": "^2.8.1",
"qunit": "^2.19.3",
"qunit-dom": "^2.0.0",
"release-it": "^14.2.1",
"release-it-lerna-changelog": "^3.1.0",
"rollup": "^2.57.0",
"scenario-tester": "^2.0.1",
"semver": "^7.3.5",
"webpack": "^5.53.0"
"webpack": "^5.75.0"
},
"engines": {
"node": "12.* || 14.* || >= 16"
"node": "14.* || 16.* || >= 18"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
Expand Down
8 changes: 7 additions & 1 deletion test-app/.ember-cli
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,11 @@

Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": false
"disableAnalytics": false,

/**
Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript
rather than JavaScript by default, when a TypeScript version of a given blueprint is available.
*/
"isTypeScriptProject": false
}
3 changes: 3 additions & 0 deletions test-app/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@
# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
3 changes: 1 addition & 2 deletions test-app/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ module.exports = {
'./config/**/*.js',
'./lib/*/index.js',
'./server/**/*.js',
'./scenarios.js',
],
parserOptions: {
sourceType: 'script',
Expand All @@ -51,7 +50,7 @@ module.exports = {
},
},
{
// Test files:
// test files
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
Expand Down
6 changes: 6 additions & 0 deletions test-app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@
# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try

# broccoli-debug
/DEBUG/
Loading