Skip to content

Commit 0c0049f

Browse files
committed
fix pretiter
1 parent ca98cd5 commit 0c0049f

11 files changed

Lines changed: 158 additions & 143 deletions

README.md

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module.exports = {
2828
} else {
2929
return this.treeGenerator(path.join(baseTemplatesPath, 'legacy'));
3030
}
31-
}
31+
},
3232
};
3333
```
3434

@@ -53,8 +53,8 @@ module.exports = {
5353
/* deal with 2.0.0+ stuff */
5454
} else {
5555
/* provide backwards compat */
56-
};
57-
}
56+
}
57+
},
5858
};
5959
```
6060

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

7575
checker.for('ember-cli').assertAbove('2.0.0');
76-
}
76+
},
7777
};
7878
```
7979

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

9090
let checker = new VersionChecker(this.project);
9191

92-
checker.for('ember-cli').assertAbove('2.0.0', 'To use awesome-addon you must have ember-cli 2.0.0');
93-
}
92+
checker
93+
.for('ember-cli')
94+
.assertAbove(
95+
'2.0.0',
96+
'To use awesome-addon you must have ember-cli 2.0.0'
97+
);
98+
},
9499
};
95100
```
96101

@@ -113,8 +118,8 @@ module.exports = {
113118
/* deal with 2.0.0 stuff */
114119
} else {
115120
/* provide backwards compat */
116-
};
117-
}
121+
}
122+
},
118123
};
119124
```
120125

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

136141
if (dep.exists()) {
137142
/* do things when present */
138-
};
139-
}
143+
}
144+
},
140145
};
141146
```
142147

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

159164
// do something with dep.version
160-
}
165+
},
161166
};
162167
```
163168

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

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

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

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

212-
checker.assertSingleImplementation('<my-addon>', 'Please make sure <my-addon> has only one implementation, please correct and here is a helpful message!');
213-
}
217+
checker.assertSingleImplementation(
218+
'<my-addon>',
219+
'Please make sure <my-addon> has only one implementation, please correct and here is a helpful message!'
220+
);
221+
},
214222
};
215223
```
216224

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

231239
checker.filterAddonsByName('<my-addon>'); // => an array of addon instances who have the name `<my-addon>`
232-
}
240+
},
233241
};
234242
```
235243

236-
237244
### allAddons
238245

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

258265
### check
259266

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

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

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

288295
const checker = VersionChecker.forProject(this.project);
289296
const check = checker.check({
290-
'ember-source': '>= 3.4.8'
297+
'ember-source': '>= 3.4.8',
291298
});
292299

293300
// if it would like to simply assert
@@ -302,16 +309,16 @@ module.exports = {
302309
if (!check.isSatisfied) {
303310
const altCheck = checker.check({
304311
'magical-polyfil': '>= 1.0.0',
305-
'ember-source': '>= 3.0.0'
306-
})
312+
'ember-source': '>= 3.0.0',
313+
});
307314

308315
check.assert('[awesome-addon] dependency check failed:');
309316
// will throw error message similar to the following if the check was not satisfied:
310317
// [awesome-addon] dependency check failed:
311318
// - 'magical-polyfil' expected version [>= 1.0.0] but got version: [0.0.1]
312319
// - 'ember-source' expected version [>= 3.0.0] but got version: [2.0.-]
313320
}
314-
}
321+
},
315322
};
316323
```
317324

RELEASE.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,24 @@ guiding principle here is that changelogs are for humans, not machines.
1717

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

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
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
2525
changelog/release notes.
2626

2727
## Release
2828

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

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

3333
```sh
3434
yarn install
3535
```
3636

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

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

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

5252
```sh
5353
npx release-it

eslint.config.mjs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
import js from "@eslint/js";
2-
import globals from "globals";
3-
import { defineConfig } from "eslint/config";
4-
import eslintConfigPrettier from "eslint-config-prettier/flat";
1+
import js from '@eslint/js';
2+
import globals from 'globals';
3+
import { defineConfig } from 'eslint/config';
4+
import eslintConfigPrettier from 'eslint-config-prettier/flat';
55

66
export default defineConfig([
7-
{ files: ["**/*.{js,mjs,cjs}"], plugins: { js }, extends: ["js/recommended"], languageOptions: { globals: globals.node } },
8-
{ files: ["./tests/**/*.{js,mjs,cjs}"], languageOptions: { globals: globals.mocha }},
9-
{ files: ["**/*.js"], languageOptions: { sourceType: "commonjs" } },
7+
{
8+
files: ['**/*.{js,mjs,cjs}'],
9+
plugins: { js },
10+
extends: ['js/recommended'],
11+
languageOptions: { globals: globals.node },
12+
},
13+
{
14+
files: ['./tests/**/*.{js,mjs,cjs}'],
15+
languageOptions: { globals: globals.mocha },
16+
},
17+
{ files: ['**/*.js'], languageOptions: { sourceType: 'commonjs' } },
1018
eslintConfigPrettier,
1119
]);

src/dependency-version-checker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class DependencyVersionChecker {
7676
}
7777

7878
for (let method of ['gt', 'lt', 'gte', 'lte', 'eq', 'neq', 'satisfies']) {
79-
DependencyVersionChecker.prototype[method] = function(range) {
79+
DependencyVersionChecker.prototype[method] = function (range) {
8080
if (!this.version) {
8181
return method === 'neq';
8282
}

src/get-project.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
module.exports = function(input) {
3+
module.exports = function (input) {
44
if (input.project) {
55
return input.project;
66
} else if (input.root && typeof input.isEmberCLIProject === 'function') {

src/project-wide-dependency-checker.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@ module.exports = class ProjectWideDependencyChecker {
101101

102102
for (let name in addons) {
103103
const found = addons[name];
104-
const versions = found.map(addon => addon.pkg.version);
104+
const versions = found.map((addon) => addon.pkg.version);
105105

106106
const constraint = constraints[name];
107107
const missing = versions.length === 0;
108108
const isSatisfied =
109109
!missing &&
110-
versions.every(version =>
110+
versions.every((version) =>
111111
semver.satisfies(version, constraint, { includePrerelease: true })
112112
);
113113

@@ -141,7 +141,7 @@ class Check {
141141

142142
get isSatisfied() {
143143
return Object.values(this.node_modules).every(
144-
node_module => node_module.isSatisfied
144+
(node_module) => node_module.isSatisfied
145145
);
146146
}
147147

0 commit comments

Comments
 (0)