ember.nvp 1.11.1 → 1.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.release-plan.json +3 -3
- package/CHANGELOG.md +11 -0
- package/package.json +4 -2
- package/src/utils/npm.js +25 -2
- package/test/ember.nvp/layer-typescript.test.ts +3 -3
- package/test/ember.nvp/npm.test.ts +24 -2
package/.release-plan.json
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"solution": {
|
|
3
3
|
"ember.nvp": {
|
|
4
4
|
"impact": "patch",
|
|
5
|
-
"oldVersion": "1.11.
|
|
6
|
-
"newVersion": "1.11.
|
|
5
|
+
"oldVersion": "1.11.1",
|
|
6
|
+
"newVersion": "1.11.2",
|
|
7
7
|
"tagName": "latest",
|
|
8
8
|
"constraints": [
|
|
9
9
|
{
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"oldVersion": "1.2.0"
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
|
-
"description": "## Release (2026-09-30)\n\n* ember.nvp 1.11.
|
|
26
|
+
"description": "## Release (2026-09-30)\n\n* ember.nvp 1.11.2 (patch)\n\n#### :bug: Bug Fix\n* `ember.nvp`\n * [#150](https://github.com/NullVoxPopuli/ember.nvp/pull/150) Keep the range when bumping a dependency ([@NullVoxPopuli-ai-agent](https://github.com/NullVoxPopuli-ai-agent))\n\n#### Committers: 1\n- @NullVoxPopuli's reduced-access machine account for AI usage ([@NullVoxPopuli-ai-agent](https://github.com/NullVoxPopuli-ai-agent))\n"
|
|
27
27
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
## Release (2026-09-30)
|
|
4
4
|
|
|
5
|
+
* ember.nvp 1.11.2 (patch)
|
|
6
|
+
|
|
7
|
+
#### :bug: Bug Fix
|
|
8
|
+
* `ember.nvp`
|
|
9
|
+
* [#150](https://github.com/NullVoxPopuli/ember.nvp/pull/150) Keep the range when bumping a dependency ([@NullVoxPopuli-ai-agent](https://github.com/NullVoxPopuli-ai-agent))
|
|
10
|
+
|
|
11
|
+
#### Committers: 1
|
|
12
|
+
- @NullVoxPopuli's reduced-access machine account for AI usage ([@NullVoxPopuli-ai-agent](https://github.com/NullVoxPopuli-ai-agent))
|
|
13
|
+
|
|
14
|
+
## Release (2026-09-30)
|
|
15
|
+
|
|
5
16
|
* ember.nvp 1.11.1 (patch)
|
|
6
17
|
|
|
7
18
|
#### :bug: Bug Fix
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember.nvp",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.2",
|
|
4
4
|
"description": "ember project generator, alternative to the official blueprints, but more modern -- hopefully one day to upstream back in to ember-cli / official blueprints",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"enhanced-resolve": "^5.24.2",
|
|
30
30
|
"execa": "^9.6.1",
|
|
31
31
|
"latest-version": "^9.0.0",
|
|
32
|
-
"package-name-regex": "^5.0.0"
|
|
32
|
+
"package-name-regex": "^5.0.0",
|
|
33
|
+
"semver": "^7.8.5"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
35
36
|
"@ember/app-tsconfig": "^2.0.0",
|
|
@@ -37,6 +38,7 @@
|
|
|
37
38
|
"@glint/ember-tsc": "^1.7.5",
|
|
38
39
|
"@glint/template": "^1.7.7",
|
|
39
40
|
"@glint/tsserver-plugin": "^2.5.5",
|
|
41
|
+
"@types/semver": "^7.8.0",
|
|
40
42
|
"concurrently": "^9.2.1",
|
|
41
43
|
"ember-source": "^7.0.0",
|
|
42
44
|
"prettier": "^3.8.3",
|
package/src/utils/npm.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import latestVersion, { VersionNotFoundError } from "latest-version";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { join, resolve } from "node:path";
|
|
4
|
+
import semver from "semver";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* @type {{ [name: string]: { [version: string]: string } }}
|
|
@@ -56,12 +57,12 @@ export async function getLatest(deps) {
|
|
|
56
57
|
version =
|
|
57
58
|
"link:" + resolve(join(import.meta.dirname, "../../packages", LOCAL_PACKAGES[dep]));
|
|
58
59
|
} else if (alias) {
|
|
59
|
-
version = `npm:${alias.name}@${await
|
|
60
|
+
version = `npm:${alias.name}@${await bump(alias.name, alias.range)}`;
|
|
60
61
|
} else {
|
|
61
62
|
if (range == "workspace:*") {
|
|
62
63
|
range = "latest";
|
|
63
64
|
}
|
|
64
|
-
version = isFromRegistry(range) ? await
|
|
65
|
+
version = isFromRegistry(range) ? await bump(dep, range) : range;
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
CACHE[dep] ||= {};
|
|
@@ -85,6 +86,28 @@ function isFromRegistry(range) {
|
|
|
85
86
|
return !/[:/]/.test(range);
|
|
86
87
|
}
|
|
87
88
|
|
|
89
|
+
/**
|
|
90
|
+
* Moves a range to the newest version it allows, and keeps its kind:
|
|
91
|
+
* - `^5.4.1` becomes `^5.5.2`, and `~` works the same way
|
|
92
|
+
* - an exact version stays exact
|
|
93
|
+
* - a dist-tag becomes the version it points at
|
|
94
|
+
*
|
|
95
|
+
* Other ranges (`>= 4.1.0`, `1.x`, `^1 || ^2`) stay as written.
|
|
96
|
+
* A new floor there would drop versions that the project supports.
|
|
97
|
+
*
|
|
98
|
+
* @param {string} name
|
|
99
|
+
* @param {string} range
|
|
100
|
+
*/
|
|
101
|
+
async function bump(name, range) {
|
|
102
|
+
let isTag = !semver.validRange(range);
|
|
103
|
+
let isExact = Boolean(semver.valid(range));
|
|
104
|
+
let [, operator = ""] = /^([\^~])\s*v?\d[\w.+-]*$/.exec(range) ?? [];
|
|
105
|
+
|
|
106
|
+
if (!isTag && !isExact && !operator) return range;
|
|
107
|
+
|
|
108
|
+
return operator + (await resolveVersion(name, range));
|
|
109
|
+
}
|
|
110
|
+
|
|
88
111
|
/**
|
|
89
112
|
* Deprecated versions are skipped when the range allows another version.
|
|
90
113
|
*
|
|
@@ -55,8 +55,8 @@ describe("layer: typescript, version 7", () => {
|
|
|
55
55
|
it("installs TypeScript 7 as @typescript/native, and TypeScript 6 for typescript-eslint", async () => {
|
|
56
56
|
let deps = await devDependencies(project);
|
|
57
57
|
|
|
58
|
-
expect(deps["@typescript/native"]).toMatch(/^npm:typescript
|
|
59
|
-
expect(deps["typescript"]).toMatch(/^npm:@typescript\/typescript6
|
|
58
|
+
expect(deps["@typescript/native"]).toMatch(/^npm:typescript@\^7\./);
|
|
59
|
+
expect(deps["typescript"]).toMatch(/^npm:@typescript\/typescript6@\^6\./);
|
|
60
60
|
expect(deps).toHaveProperty("ember-content-mapper");
|
|
61
61
|
expect(deps).not.toHaveProperty("@glint/tsserver-plugin");
|
|
62
62
|
});
|
|
@@ -172,7 +172,7 @@ describe("layer: typescript, version 7", () => {
|
|
|
172
172
|
let manifest = await packageJson.read(project.directory);
|
|
173
173
|
|
|
174
174
|
expect(manifest.scripts?.["lint:types"]).toBe("tsc --noEmit --runExternalCode");
|
|
175
|
-
expect(manifest.devDependencies?.["@typescript/native"]).toMatch(/^npm:typescript
|
|
175
|
+
expect(manifest.devDependencies?.["@typescript/native"]).toMatch(/^npm:typescript@\^7\./);
|
|
176
176
|
expect(manifest.devDependencies).not.toHaveProperty("typescript");
|
|
177
177
|
expect(manifest.devDependencies).not.toHaveProperty("@glint/tsserver-plugin");
|
|
178
178
|
});
|
|
@@ -6,13 +6,35 @@ describe("getLatest", () => {
|
|
|
6
6
|
// ESLint deprecated all of 9.x once 10 was out
|
|
7
7
|
const { eslint } = await getLatest({ eslint: "^9.39.2" });
|
|
8
8
|
|
|
9
|
-
expect(eslint).toMatch(
|
|
9
|
+
expect(eslint).toMatch(/^\^9\.39\.\d+$/);
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
it("still prefers versions that are not deprecated", async () => {
|
|
13
13
|
const { eslint } = await getLatest({ eslint: "^10.0.0" });
|
|
14
14
|
|
|
15
|
-
expect(eslint).toMatch(
|
|
15
|
+
expect(eslint).toMatch(/^\^10\.\d+\.\d+$/);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it("bumps a range without changing its kind", async () => {
|
|
19
|
+
const result = await getLatest({
|
|
20
|
+
"@ember/test-helpers": "^5.4.1",
|
|
21
|
+
"ember-source": "~7.2.0",
|
|
22
|
+
"@embroider/macros": "1.20.2",
|
|
23
|
+
"@ember/test-waiters": ">= 4.1.0",
|
|
24
|
+
"ember-modifier": "^4.2.0 || ^5.0.0",
|
|
25
|
+
"decorator-transforms": "latest",
|
|
26
|
+
typescript: "npm:@typescript/typescript6@^6.0.2",
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
expect(result).toEqual({
|
|
30
|
+
"@ember/test-helpers": expect.stringMatching(/^\^5\.\d+\.\d+$/),
|
|
31
|
+
"ember-source": expect.stringMatching(/^~7\.2\.\d+$/),
|
|
32
|
+
"@embroider/macros": "1.20.2",
|
|
33
|
+
"@ember/test-waiters": ">= 4.1.0",
|
|
34
|
+
"ember-modifier": "^4.2.0 || ^5.0.0",
|
|
35
|
+
"decorator-transforms": expect.stringMatching(/^\d+\.\d+\.\d+$/),
|
|
36
|
+
typescript: expect.stringMatching(/^npm:@typescript\/typescript6@\^6\.\d+\.\d+$/),
|
|
37
|
+
});
|
|
16
38
|
});
|
|
17
39
|
|
|
18
40
|
it("keeps specs that do not come from the registry", async () => {
|