Skip to content

Commit

Permalink
update addon blueprint with ember-cli-update
Browse files Browse the repository at this point in the history
  • Loading branch information
mansona committed Jul 13, 2024
1 parent d3d1435 commit f5b8ba8
Show file tree
Hide file tree
Showing 13 changed files with 138 additions and 78 deletions.
45 changes: 34 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,55 @@ on:
pull_request: {}

concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
test:
name: "Tests"
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
cache: pnpm
- run: pnpm i --frozen-lockfile
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm lint
- name: Run Tests
run: pnpm --filter test-app test:ember
run: pnpm test

floating:
name: "Floating Dependencies"
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 18
cache: pnpm
- name: Install Dependencies
run: pnpm install --no-lockfile
- name: Run Tests
run: pnpm test

try-scenarios:
name: ${{ matrix.try-scenario }}
runs-on: ubuntu-latest
timeout-minutes: 10
needs: 'test'
timeout-minutes: 10

strategy:
fail-fast: false
Expand All @@ -48,6 +69,7 @@ jobs:
- ember-lts-4.4
- ember-lts-4.8
- ember-lts-4.12
- ember-lts-5.4
- ember-release
- ember-beta
- ember-canary
Expand All @@ -59,14 +81,15 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
cache: pnpm
- run: pnpm i --frozen-lockfile
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Run Tests
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }}
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }} --skip-cleanup
working-directory: test-app
11 changes: 7 additions & 4 deletions .github/workflows/push-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,21 @@ jobs:
push-dist:
name: Push dist
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
cache: pnpm
- run: pnpm i --frozen-lockfile
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- uses: kategengler/[email protected]
with:
branch: dist
token: ${{ secrets.GITHUB_TOKEN }}
working-directory: ember-cli-notifications
working-directory: 'ember-cli-notifications'
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@

## Compatibility

* Ember.js v3.8 or above
* Ember CLI v3.8 or above

- Ember.js v3.8 or above
- Embroider or ember-auto-import v2

## Installation

Expand Down
2 changes: 1 addition & 1 deletion config/ember-cli-update.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"packages": [
{
"name": "@embroider/addon-blueprint",
"version": "2.8.0",
"version": "2.17.0",
"blueprints": [
{
"name": "@embroider/addon-blueprint",
Expand Down
65 changes: 46 additions & 19 deletions ember-cli-notifications/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,48 @@

module.exports = {
root: true,
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
babelOptions: {
root: __dirname,
},
},
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true,
},
rules: {},
// Only use overrides
// https://github.com/ember-cli/eslint-plugin-ember?tab=readme-ov-file#gtsgjs
overrides: [
{
files: ['**/*.js'],
env: { browser: true },
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
babelOptions: {
root: __dirname,
},
},
plugins: ['ember', 'import'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
rules: {
// require relative imports use full extensions
'import/extensions': ['error', 'always', { ignorePackages: true }],
// Add any custom rules here
},
},
{
files: ['**/*.gjs'],
parser: 'ember-eslint-parser',
plugins: ['ember', 'import'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:ember/recommended-gjs',
'plugin:prettier/recommended',
],
rules: {
// require relative imports use full extensions
'import/extensions': ['error', 'always', { ignorePackages: true }],
// Add any custom rules here
},
},
// node files
{
files: [
Expand All @@ -37,7 +60,11 @@ module.exports = {
node: true,
},
plugins: ['n'],
extends: ['plugin:n/recommended'],
extends: [
'eslint:recommended',
'plugin:n/recommended',
'plugin:prettier/recommended',
],
},
],
};
9 changes: 7 additions & 2 deletions ember-cli-notifications/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
/LICENSE.md

# compiled output
/dist
/declarations
dist/
declarations/

# npm/pnpm/yarn pack output
*.tgz

# deps & caches
node_modules/
.eslintcache
.prettiercache
4 changes: 1 addition & 3 deletions ember-cli-notifications/babel.config.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"plugins": [
"@embroider/addon-dev/template-colocation-plugin",
"@babel/plugin-transform-class-static-block",
["babel-plugin-ember-template-compilation", {
"targetFormat": "hbs",
"transforms": []
}],
["@babel/plugin-proposal-decorators", { "version": "legacy" }],
"@babel/plugin-proposal-class-properties"
["module:decorator-transforms", { "runtime": { "import": "decorator-transforms/runtime" } }],
]
}
51 changes: 22 additions & 29 deletions ember-cli-notifications/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
],
"scripts": {
"build": "rollup --config",
"lint": "concurrently 'npm:lint:*(!fix)' --names 'lint:'",
"lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:'",
"lint": "concurrently 'pnpm:lint:*(!fix)' --names 'lint:'",
"lint:fix": "concurrently 'pnpm:lint:*:fix' --names 'fix:'",
"lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
"lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
"lint:js": "eslint . --cache",
Expand All @@ -38,35 +38,28 @@
"test": "echo 'A v2 addon does not have tests, run tests in test-app'"
},
"dependencies": {
"@embroider/addon-shim": "^1.0.0"
"@embroider/addon-shim": "^1.8.7",
"decorator-transforms": "^2.0.0"
},
"devDependencies": {
"@babel/core": "^7.17.0",
"@babel/eslint-parser": "^7.19.1",
"@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/plugin-proposal-decorators": "^7.20.13",
"@babel/plugin-transform-class-static-block": "^7.20.0",
"@babel/runtime": "^7.17.0",
"@embroider/addon-dev": "^4.1.0",
"@rollup/plugin-babel": "^6.0.3",
"babel-plugin-ember-template-compilation": "^2.2.0",
"concurrently": "^8.0.1",
"ember-template-lint": "^5.11.2",
"eslint": "^8.33.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-ember": "^11.11.1",
"eslint-plugin-n": "^16.0.0",
"eslint-plugin-prettier": "^5.0.0",
"lint-to-the-future": "^2.0.0",
"lint-to-the-future-ember-template": "^1.2.0",
"lint-to-the-future-eslint": "^2.0.1",
"postcss": "^8.4.31",
"postcss-preset-env": "^9.3.0",
"prettier": "^3.0.3",
"prettier-plugin-ember-template-tag": "^1.1.0",
"rollup": "^3.21.8",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-postcss": "^4.0.2"
"@babel/core": "^7.24.4",
"@babel/eslint-parser": "^7.24.1",
"@babel/runtime": "^7.24.4",
"@embroider/addon-dev": "^4.3.1",
"@rollup/plugin-babel": "^6.0.4",
"babel-plugin-ember-template-compilation": "^2.2.5",
"concurrently": "^8.2.2",
"ember-template-lint": "^6.0.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ember": "^12.0.2",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^17.3.1",
"eslint-plugin-prettier": "^5.1.3",
"prettier": "^3.2.5",
"prettier-plugin-ember-template-tag": "^2.0.2",
"rollup": "^4.16.4",
"rollup-plugin-copy": "^3.5.0"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"lint": "pnpm --filter '*' lint",
"lint:fix": "pnpm --filter '*' lint:fix",
"prepare": "pnpm build",
"start": "concurrently 'npm:start:*' --restart-after 5000 --prefix-colors cyan,white,yellow",
"start": "concurrently 'pnpm:start:*' --restart-after 5000 --prefix-colors cyan,white,yellow",
"start:addon": "pnpm --filter ember-cli-notifications start --no-watch.clearScreen",
"start:docs-app": "pnpm --filter docs-app start",
"start:test-app": "pnpm --filter test-app start",
Expand Down
2 changes: 2 additions & 0 deletions test-app/config/ember-cli-update.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"codemodsSource": "ember-app-codemods-manifest@1",
"isBaseBlueprint": true,
"options": [
"--no-welcome",
"--pnpm",
"--ci-provider=github"
]
}
Expand Down
8 changes: 8 additions & 0 deletions test-app/config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ module.exports = async function () {
},
},
},
{
name: 'ember-lts-5.4',
npm: {
devDependencies: {
'ember-source': '~5.4.0',
},
},
},
{
name: 'ember-release',
npm: {
Expand Down
6 changes: 4 additions & 2 deletions test-app/ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
const EmberApp = require('ember-cli/lib/broccoli/ember-app');

module.exports = function (defaults) {
const app = new EmberApp(defaults, {
// Add options here
let app = new EmberApp(defaults, {
autoImport: {
watchDependencies: ['ember-cli-notifications'],
},
});

const { maybeEmbroider } = require('@embroider/test-setup');
Expand Down
6 changes: 3 additions & 3 deletions test-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "test-app",
"version": "0.0.0",
"private": true,
"description": "Small description for test-app goes here",
"description": "Test app for ember-cli-notifications addon",
"repository": "",
"license": "MIT",
"author": "",
Expand Down Expand Up @@ -69,8 +69,8 @@
"lint-to-the-future-ember-template": "^1.2.0",
"lint-to-the-future-eslint": "^2.0.1",
"loader.js": "^4.7.0",
"prettier": "^3.0.3",
"qunit": "^2.20.0",
"prettier": "^3.3.2",
"qunit": "^2.21.0",
"qunit-dom": "^2.0.0",
"stylelint": "^15.11.0",
"stylelint-config-standard": "^34.0.0",
Expand Down

0 comments on commit f5b8ba8

Please sign in to comment.