Skip to content
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
14 changes: 0 additions & 14 deletions .eslintrc.js

This file was deleted.

2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# prettier
eca15dc8279b8fae51c2c641fe30c1d507e4ee31
50 changes: 37 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,54 @@ name: CI
on:
push:
branches:
- main
- master
- 'v*' # older version branches
tags:
- '*'
pull_request: {}
schedule:
- cron: '0 6 * * 0' # weekly, on sundays

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

jobs:
lint:
name: Lint
runs-on: ${{ matrix.os }}
timeout-minutes: 5

steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v7
with:
node-version: 26
cache: pnpm
- run: pnpm install
- run: pnpm lint


test:
name: Tests
runs-on: ${{ matrix.os }}
timeout-minutes: 5

strategy:
fail-fast: false
matrix:
node: ['10', '12']
os: [ubuntu-latest, macOS-latest, windows-latest]
node:
- 22
- 24
- 26
os:
- ubuntu-latest
- macOS-latest
- windows-latest

steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node }}
- name: install dependencies
run: yarn
- name: test
run: yarn test
cache: pnpm
- run: pnpm install
- run: pnpm test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
.eslintcache
14 changes: 14 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# unconventional js
/blueprints/*/files/

# compiled output
/dist/

# misc
/coverage/
!.*
.*/
/pnpm-lock.yaml
ember-cli-update.json
*.html
CHANGELOG.md
59 changes: 33 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = {
} else {
return this.treeGenerator(path.join(baseTemplatesPath, 'legacy'));
}
}
},
};
```

Expand All @@ -53,8 +53,8 @@ module.exports = {
/* deal with 2.0.0+ stuff */
} else {
/* provide backwards compat */
};
}
}
},
};
```

Expand All @@ -73,7 +73,7 @@ module.exports = {
let checker = new VersionChecker(this.project);

checker.for('ember-cli').assertAbove('2.0.0');
}
},
};
```

Expand All @@ -89,8 +89,13 @@ module.exports = {

let checker = new VersionChecker(this.project);

checker.for('ember-cli').assertAbove('2.0.0', 'To use awesome-addon you must have ember-cli 2.0.0');
}
checker
.for('ember-cli')
.assertAbove(
'2.0.0',
'To use awesome-addon you must have ember-cli 2.0.0'
);
},
};
```

Expand All @@ -113,8 +118,8 @@ module.exports = {
/* deal with 2.0.0 stuff */
} else {
/* provide backwards compat */
};
}
}
},
};
```

Expand All @@ -135,8 +140,8 @@ module.exports = {

if (dep.exists()) {
/* do things when present */
};
}
}
},
};
```

Expand All @@ -157,7 +162,7 @@ module.exports = {
let dep = checker.for('ember-cli-qunit');

// do something with dep.version
}
},
};
```

Expand All @@ -171,7 +176,7 @@ A unique addon can still be included multiple times if it's a nested
dependency, but they are guaranteed to be resolved to same version in
node_modules. This happens when the dependency in problem specifies a valid
version range or the app uses [yarn
resolutions](https://yarnpkg.com/lang/en/docs/selective-version-resolutions/).
resolutions](https://yarnpkg.com/lang/en/docs/selective-version-resolutions/).

This is useful if the app wants to make sure there's no unexpected assets from
the addon being included but still allow the addon to be included in the
Expand All @@ -190,7 +195,7 @@ module.exports = {
if (checker.hasSingleImplementation('<my-addon>')) {
/* do things when <my-addon> is unique */
}
}
},
};
```

Expand All @@ -209,8 +214,11 @@ module.exports = {

let checker = VersionChecker.forProject(this.project);

checker.assertSingleImplementation('<my-addon>', 'Please make sure <my-addon> has only one implementation, please correct and here is a helpful message!');
}
checker.assertSingleImplementation(
'<my-addon>',
'Please make sure <my-addon> has only one implementation, please correct and here is a helpful message!'
);
},
};
```

Expand All @@ -229,11 +237,10 @@ module.exports = {
let checker = VersionChecker.forProject(this.project);

checker.filterAddonsByName('<my-addon>'); // => an array of addon instances who have the name `<my-addon>`
}
},
};
```


### allAddons

An iterator which gives access to all addon instances
Expand All @@ -257,19 +264,19 @@ module.exports = {

### check

A utility to verify that addons are installed at appropriate versions. `npm`
A utility to verify that addons are installed at appropriate versions. `npm`
and `yarn` resolve conflicting transitive dependency requirements by installing
multiple versions. They do not include a mechanism for packages to declare
that a dependency must be unique. This is, however, a practical constraint
multiple versions. They do not include a mechanism for packages to declare
that a dependency must be unique. This is, however, a practical constraint
when building Ember applications (for example, we would not want to build an
application that shipped two versions of Ember Data). [Related discussion on npm](https://github.com/npm/rfcs/pull/23)

Every addon in the ember ecosystem implicitly depends on `ember-source`, and
most likely a specific version range. If that dependency is specified as a
`package.json` dependency, a mismatch between application and addon would
result in duplicating `ember-source`. Instead of failing the build, we would
result in duplicating `ember-source`. Instead of failing the build, we would
build an application with an unknown version of `ember-source`, subverting the
point of specifying dependency version ranges in the first place! The `check`
point of specifying dependency version ranges in the first place! The `check`
API provides a mechanism to avoid this and fail fast in the build step, instead
of building an invalid application with harder to debug runtime errors.

Expand All @@ -287,7 +294,7 @@ module.exports = {

const checker = VersionChecker.forProject(this.project);
const check = checker.check({
'ember-source': '>= 3.4.8'
'ember-source': '>= 3.4.8',
});

// if it would like to simply assert
Expand All @@ -302,16 +309,16 @@ module.exports = {
if (!check.isSatisfied) {
const altCheck = checker.check({
'magical-polyfil': '>= 1.0.0',
'ember-source': '>= 3.0.0'
})
'ember-source': '>= 3.0.0',
});

check.assert('[awesome-addon] dependency check failed:');
// will throw error message similar to the following if the check was not satisfied:
// [awesome-addon] dependency check failed:
// - 'magical-polyfil' expected version [>= 1.0.0] but got version: [0.0.1]
// - 'ember-source' expected version [>= 3.0.0] but got version: [2.0.-]
}
}
},
};
```

Expand Down
16 changes: 8 additions & 8 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ guiding principle here is that changelogs are for humans, not machines.

When reviewing merged PR's the labels to be used are:

* breaking - Used when the PR is considered a breaking change.
* enhancement - Used when the PR adds a new feature or enhancement.
* bug - Used when the PR fixes a bug included in a previous release.
* documentation - Used when the PR adds or updates documentation.
* internal - Used for internal changes that still require a mention in the
- breaking - Used when the PR is considered a breaking change.
- enhancement - Used when the PR adds a new feature or enhancement.
- bug - Used when the PR fixes a bug included in a previous release.
- documentation - Used when the PR adds or updates documentation.
- internal - Used for internal changes that still require a mention in the
changelog/release notes.

## Release

Once the prep work is completed, the actual release is straight forward:

* First, ensure that you have installed your projects dependencies:
- First, ensure that you have installed your projects dependencies:

```sh
yarn install
```

* Second, ensure that you have obtained a
- Second, ensure that you have obtained a
[GitHub personal access token][generate-token] with the `repo` scope (no
other permissions are needed). Make sure the token is available as the
`GITHUB_AUTH` environment variable.
Expand All @@ -47,7 +47,7 @@ yarn install

[generate-token]: https://github.com/settings/tokens/new?scopes=repo&description=GITHUB_AUTH+env+variable

* And last (but not least 😁) do your release.
- And last (but not least 😁) do your release.

```sh
npx release-it
Expand Down
19 changes: 19 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import js from '@eslint/js';
import globals from 'globals';
import { defineConfig } from 'eslint/config';
import eslintConfigPrettier from 'eslint-config-prettier/flat';

export default defineConfig([
{
files: ['**/*.{js,mjs,cjs}'],
plugins: { js },
extends: ['js/recommended'],
languageOptions: { globals: globals.node },
},
{
files: ['./tests/**/*.{js,mjs,cjs}'],
languageOptions: { globals: globals.mocha },
},
{ files: ['**/*.js'], languageOptions: { sourceType: 'commonjs' } },
eslintConfigPrettier,
]);
26 changes: 16 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
"scripts": {
"changelog": "lerna-changelog",
"test": "mocha tests/*-tests.js",
"format": "prettier . --cache --write",
"lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\" --prefixColors auto",
"lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\" --prefixColors auto && npm run format",
"lint:format": "prettier . --cache --check",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"test:debug": "mocha debug tests/*-tests.js"
},
"prettier": {
Expand All @@ -35,19 +41,18 @@
"silent-error": "^1.1.1"
},
"devDependencies": {
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-prettier": "^3.4.0",
"@eslint/js": "^10.0.1",
"concurrently": "^10.0.3",
"eslint": "^10.7.0",
"eslint-config-prettier": "^10.1.8",
"fixturify": "^2.1.1",
"fixturify-project": "^2.1.1",
"lerna-changelog": "^1.0.1",
"mocha": "^8.4.0",
"mocha-eslint": "^6.0.0",
"prettier": "^1.19.1",
"release-it": "^14.10.1",
"release-it-lerna-changelog": "^3.1.0"
"globals": "^17.7.0",
"mocha": "^11.7.6",
"prettier": "^3.9.5"
},
"engines": {
"node": "10.* || >= 12.*"
"node": "22.* || 24.* || >= 26.*"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
Expand All @@ -69,5 +74,6 @@
},
"volta": {
"node": "10.19.0"
}
},
"packageManager": "pnpm@11.15.1+sha512.81350b07e53c9538a02f1f2303b4290fa2d7be04e56e2a970c4cc4b417dc761de196edabd49d55c7dc9580db81007c44143e4e3d7e462b3000d23c255122d065"
}
Loading