ember.nvp 1.11.0 → 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 +6 -6
- package/CHANGELOG.md +22 -0
- package/package.json +4 -2
- package/src/utils/npm.js +56 -3
- package/test/ember.nvp/layer-typescript.test.ts +3 -3
- package/test/ember.nvp/npm.test.ts +51 -0
package/.release-plan.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"solution": {
|
|
3
3
|
"ember.nvp": {
|
|
4
|
-
"impact": "
|
|
5
|
-
"oldVersion": "1.
|
|
6
|
-
"newVersion": "1.11.
|
|
4
|
+
"impact": "patch",
|
|
5
|
+
"oldVersion": "1.11.1",
|
|
6
|
+
"newVersion": "1.11.2",
|
|
7
7
|
"tagName": "latest",
|
|
8
8
|
"constraints": [
|
|
9
9
|
{
|
|
10
|
-
"impact": "
|
|
11
|
-
"reason": "Appears in changelog section :
|
|
10
|
+
"impact": "patch",
|
|
11
|
+
"reason": "Appears in changelog section :bug: Bug Fix"
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
14
|
"pkgJSONPath": "./package.json"
|
|
@@ -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,28 @@
|
|
|
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
|
+
|
|
16
|
+
* ember.nvp 1.11.1 (patch)
|
|
17
|
+
|
|
18
|
+
#### :bug: Bug Fix
|
|
19
|
+
* `ember.nvp`
|
|
20
|
+
* [#148](https://github.com/NullVoxPopuli/ember.nvp/pull/148) Keep update runs working for deprecated and non-registry deps ([@NullVoxPopuli-ai-agent](https://github.com/NullVoxPopuli-ai-agent))
|
|
21
|
+
|
|
22
|
+
#### Committers: 1
|
|
23
|
+
- @NullVoxPopuli's reduced-access machine account for AI usage ([@NullVoxPopuli-ai-agent](https://github.com/NullVoxPopuli-ai-agent))
|
|
24
|
+
|
|
25
|
+
## Release (2026-09-30)
|
|
26
|
+
|
|
5
27
|
* ember.nvp 1.11.0 (minor)
|
|
6
28
|
|
|
7
29
|
#### :rocket: Enhancement
|
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
|
-
import latestVersion from "latest-version";
|
|
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 = await
|
|
65
|
+
version = isFromRegistry(range) ? await bump(dep, range) : range;
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
CACHE[dep] ||= {};
|
|
@@ -74,6 +75,58 @@ export async function getLatest(deps) {
|
|
|
74
75
|
return Object.fromEntries(results);
|
|
75
76
|
}
|
|
76
77
|
|
|
78
|
+
/**
|
|
79
|
+
* git, file, link, url, and catalog specs have no registry version to bump to.
|
|
80
|
+
*
|
|
81
|
+
* Semver ranges and dist-tags never contain `:` or `/`.
|
|
82
|
+
*
|
|
83
|
+
* @param {string} range
|
|
84
|
+
*/
|
|
85
|
+
function isFromRegistry(range) {
|
|
86
|
+
return !/[:/]/.test(range);
|
|
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
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Deprecated versions are skipped when the range allows another version.
|
|
113
|
+
*
|
|
114
|
+
* A package can deprecate a whole major (ESLint 9, once 10 was out).
|
|
115
|
+
* An existing project can still ask for that range.
|
|
116
|
+
*
|
|
117
|
+
* @param {string} name
|
|
118
|
+
* @param {string} range
|
|
119
|
+
*/
|
|
120
|
+
async function resolveVersion(name, range) {
|
|
121
|
+
try {
|
|
122
|
+
return await latestVersion(name, { version: range });
|
|
123
|
+
} catch (error) {
|
|
124
|
+
if (!(error instanceof VersionNotFoundError)) throw error;
|
|
125
|
+
|
|
126
|
+
return await latestVersion(name, { version: range, omitDeprecated: false });
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
77
130
|
/**
|
|
78
131
|
* An npm alias installs a package under another name:
|
|
79
132
|
*
|
|
@@ -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
|
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { getLatest } from "#utils/npm.js";
|
|
3
|
+
|
|
4
|
+
describe("getLatest", () => {
|
|
5
|
+
it("resolves a range where every version is deprecated", async () => {
|
|
6
|
+
// ESLint deprecated all of 9.x once 10 was out
|
|
7
|
+
const { eslint } = await getLatest({ eslint: "^9.39.2" });
|
|
8
|
+
|
|
9
|
+
expect(eslint).toMatch(/^\^9\.39\.\d+$/);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it("still prefers versions that are not deprecated", async () => {
|
|
13
|
+
const { eslint } = await getLatest({ eslint: "^10.0.0" });
|
|
14
|
+
|
|
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
|
+
});
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it("keeps specs that do not come from the registry", async () => {
|
|
41
|
+
const specs = {
|
|
42
|
+
"@embroider/try": "github:NullVoxPopuli/try#768631a",
|
|
43
|
+
"my-local": "file:../my-local",
|
|
44
|
+
"my-linked": "link:../my-linked",
|
|
45
|
+
"my-tarball": "https://example.com/my-tarball.tgz",
|
|
46
|
+
"my-catalog": "catalog:",
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
expect(await getLatest(specs)).toEqual(specs);
|
|
50
|
+
});
|
|
51
|
+
});
|