@trackunit/create-iris-app-workspace 2.10.48 → 2.10.50
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/CHANGELOG.md +8 -0
- package/bin/index.d.ts +18 -0
- package/bin/index.js +28 -6
- package/bin/pinned-versions.d.ts +16 -0
- package/bin/pinned-versions.js +40 -0
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## 2.10.50 (2026-11-13)
|
|
2
|
+
|
|
3
|
+
This was a version bump only for create-iris-app-workspace to align it with other projects, there were no code changes.
|
|
4
|
+
|
|
5
|
+
## 2.10.49 (2026-11-13)
|
|
6
|
+
|
|
7
|
+
This was a version bump only for create-iris-app-workspace to align it with other projects, there were no code changes.
|
|
8
|
+
|
|
1
9
|
## 2.10.48 (2026-11-12)
|
|
2
10
|
|
|
3
11
|
This was a version bump only for create-iris-app-workspace to align it with other projects, there were no code changes.
|
package/bin/index.d.ts
CHANGED
|
@@ -1,2 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { createWorkspace } from "create-nx-workspace";
|
|
3
|
+
type CreateIrisAppWorkspaceDeps = {
|
|
4
|
+
readonly createWorkspace: (presetName: string, options: Parameters<typeof createWorkspace>[1]) => Promise<{
|
|
5
|
+
directory: string;
|
|
6
|
+
}>;
|
|
7
|
+
readonly getPinnedVersion: (packageName: string) => string;
|
|
8
|
+
readonly log: (message: string) => void;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Creates an Iris App workspace from the exact `@trackunit/iris-app` preset this CLI release was built with.
|
|
12
|
+
*
|
|
13
|
+
* Pinning (instead of "@latest") keeps creation inside the developer's npm release-age policy:
|
|
14
|
+
* npx picks the newest CLI the policy allows, and that CLI's pin follows.
|
|
15
|
+
*
|
|
16
|
+
* @param name the workspace (folder) name
|
|
17
|
+
* @param deps injectable collaborators
|
|
18
|
+
*/
|
|
19
|
+
export declare function createIrisAppWorkspace(name: string | undefined, deps: CreateIrisAppWorkspaceDeps): Promise<void>;
|
|
2
20
|
export {};
|
package/bin/index.js
CHANGED
|
@@ -2,20 +2,42 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
/* eslint-disable no-console */
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.createIrisAppWorkspace = createIrisAppWorkspace;
|
|
5
6
|
const create_nx_workspace_1 = require("create-nx-workspace");
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
const pinned_versions_1 = require("./pinned-versions");
|
|
8
|
+
/**
|
|
9
|
+
* Creates an Iris App workspace from the exact `@trackunit/iris-app` preset this CLI release was built with.
|
|
10
|
+
*
|
|
11
|
+
* Pinning (instead of "@latest") keeps creation inside the developer's npm release-age policy:
|
|
12
|
+
* npx picks the newest CLI the policy allows, and that CLI's pin follows.
|
|
13
|
+
*
|
|
14
|
+
* @param name the workspace (folder) name
|
|
15
|
+
* @param deps injectable collaborators
|
|
16
|
+
*/
|
|
17
|
+
async function createIrisAppWorkspace(name, deps) {
|
|
8
18
|
if (!name) {
|
|
9
19
|
throw new Error("Please provide a name for the workspace");
|
|
10
20
|
}
|
|
11
|
-
|
|
12
|
-
const
|
|
21
|
+
// Resolve the pin first: a broken install must fail before anything is announced or created.
|
|
22
|
+
const preset = `@trackunit/iris-app@${deps.getPinnedVersion("@trackunit/iris-app")}`;
|
|
23
|
+
deps.log(`Creating the workspace: ${name}`);
|
|
24
|
+
const { directory } = await deps.createWorkspace(preset, {
|
|
13
25
|
name,
|
|
26
|
+
// Nx 23 asks "Share usage data with the Nx team?" on the first nx command unless nx.json already has a boolean.
|
|
27
|
+
analytics: false,
|
|
14
28
|
nxCloud: "skip",
|
|
15
29
|
packageManager: "npm",
|
|
16
30
|
trustThirdPartyPreset: true,
|
|
17
31
|
});
|
|
18
|
-
|
|
32
|
+
deps.log(`Successfully created the workspace: ${directory}.`);
|
|
33
|
+
}
|
|
34
|
+
async function main() {
|
|
35
|
+
await createIrisAppWorkspace(process.argv[2], { createWorkspace: create_nx_workspace_1.createWorkspace, getPinnedVersion: pinned_versions_1.getPinnedVersion, log: console.log });
|
|
36
|
+
}
|
|
37
|
+
if (require.main === module) {
|
|
38
|
+
main().catch((error) => {
|
|
39
|
+
console.error(error instanceof Error ? error.message : error);
|
|
40
|
+
process.exit(1);
|
|
41
|
+
});
|
|
19
42
|
}
|
|
20
|
-
void main();
|
|
21
43
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** This package's own package.json, one level above `bin/` in both the monorepo source tree and the published package. */
|
|
2
|
+
export declare const OWN_PACKAGE_JSON_PATH: string;
|
|
3
|
+
/**
|
|
4
|
+
* Returns the exact version of a package this CLI release was built against.
|
|
5
|
+
*
|
|
6
|
+
* The pins live in the `pinnedVersions` field of this package's own package.json, which CI's sync-versions step
|
|
7
|
+
* sets to the to-be-published versions before the package is built and published.
|
|
8
|
+
*
|
|
9
|
+
* Never consults the npm registry and never returns "latest": a missing pin is a broken install and fails loudly,
|
|
10
|
+
* so workspace creation cannot pick a version the developer's npm release-age policy forbids.
|
|
11
|
+
*
|
|
12
|
+
* @param packageName full package name, e.g. `@trackunit/iris-app`
|
|
13
|
+
* @param packageJsonPath override location of the package.json, used by tests
|
|
14
|
+
* @returns {string} the exact pinned version
|
|
15
|
+
*/
|
|
16
|
+
export declare const getPinnedVersion: (packageName: string, packageJsonPath?: string) => string;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPinnedVersion = exports.OWN_PACKAGE_JSON_PATH = void 0;
|
|
4
|
+
// A near-copy of @trackunit/iris-app's `getPinnedVersion` on purpose: this CLI ships only `create-nx-workspace`, not
|
|
5
|
+
// `@nx/devkit`, so it reads its package.json with Node's own module loader. Do not "dedupe" it by importing from
|
|
6
|
+
// iris-app or devkit, which would add a dependency to the CLI.
|
|
7
|
+
const module_1 = require("module");
|
|
8
|
+
// Node's loader resolves relative to this file, parses JSON, and names the file when it is missing or invalid. A typed
|
|
9
|
+
// `import` of ../package.json would move the emitted layout under `rootDir`, so the loader is used directly.
|
|
10
|
+
const loadJson = (0, module_1.createRequire)(__filename);
|
|
11
|
+
/** This package's own package.json, one level above `bin/` in both the monorepo source tree and the published package. */
|
|
12
|
+
exports.OWN_PACKAGE_JSON_PATH = loadJson.resolve("../package.json");
|
|
13
|
+
/**
|
|
14
|
+
* A pin must be an exact version: "", "latest" and ranges would reopen the registry-"latest" problem.
|
|
15
|
+
*/
|
|
16
|
+
const EXACT_VERSION = /^\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$/;
|
|
17
|
+
const getProperty = (value, key) => typeof value === "object" && value !== null ? Reflect.get(value, key) : undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Returns the exact version of a package this CLI release was built against.
|
|
20
|
+
*
|
|
21
|
+
* The pins live in the `pinnedVersions` field of this package's own package.json, which CI's sync-versions step
|
|
22
|
+
* sets to the to-be-published versions before the package is built and published.
|
|
23
|
+
*
|
|
24
|
+
* Never consults the npm registry and never returns "latest": a missing pin is a broken install and fails loudly,
|
|
25
|
+
* so workspace creation cannot pick a version the developer's npm release-age policy forbids.
|
|
26
|
+
*
|
|
27
|
+
* @param packageName full package name, e.g. `@trackunit/iris-app`
|
|
28
|
+
* @param packageJsonPath override location of the package.json, used by tests
|
|
29
|
+
* @returns {string} the exact pinned version
|
|
30
|
+
*/
|
|
31
|
+
const getPinnedVersion = (packageName, packageJsonPath = exports.OWN_PACKAGE_JSON_PATH) => {
|
|
32
|
+
const packageJson = loadJson(packageJsonPath);
|
|
33
|
+
const version = getProperty(getProperty(packageJson, "pinnedVersions"), packageName);
|
|
34
|
+
if (typeof version !== "string" || !EXACT_VERSION.test(version)) {
|
|
35
|
+
throw new Error(`No valid pinned version for ${packageName} in the "pinnedVersions" field of ${packageJsonPath}. The install is incomplete; reinstall @trackunit/create-iris-app-workspace.`);
|
|
36
|
+
}
|
|
37
|
+
return version;
|
|
38
|
+
};
|
|
39
|
+
exports.getPinnedVersion = getPinnedVersion;
|
|
40
|
+
//# sourceMappingURL=pinned-versions.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/create-iris-app-workspace",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.50",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24.x"
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
"tslib": "^2.6.2"
|
|
15
15
|
},
|
|
16
16
|
"migrations": "./migrations.json",
|
|
17
|
+
"pinnedVersions": {
|
|
18
|
+
"@trackunit/iris-app": "2.16.17"
|
|
19
|
+
},
|
|
17
20
|
"types": "./bin/index.d.ts",
|
|
18
21
|
"main": "./bin/index.js"
|
|
19
22
|
}
|