@mouryaamit/nx-polystack 1.0.1 → 1.0.3
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/USER-MANUAL.md +5 -4
- package/dist/migrations.json +5 -0
- package/dist/src/cli/commands/update.js +12 -3
- package/dist/src/cli/commands/update.js.map +1 -1
- package/dist/src/cli/update-plan.d.ts +11 -1
- package/dist/src/cli/update-plan.js +12 -3
- package/dist/src/cli/update-plan.js.map +1 -1
- package/dist/src/generators/infra/files/ci/github-actions/.github/workflows/ci.yml__template__ +4 -4
- package/dist/src/generators/infra/files/ci/github-actions/.github/workflows/pr-title.yml__template__ +2 -2
- package/dist/src/generators/infra/files/upgrades/.github/workflows/dependency-upgrade.yml__template__ +3 -3
- package/dist/src/migrations/github-actions-node24/github-actions-node24.d.ts +18 -0
- package/dist/src/migrations/github-actions-node24/github-actions-node24.js +54 -0
- package/dist/src/migrations/github-actions-node24/github-actions-node24.js.map +1 -0
- package/package.json +1 -1
package/USER-MANUAL.md
CHANGED
|
@@ -267,7 +267,8 @@ pstack update [--to=<version>] [--dry-run] [--allow-dirty] [--force]
|
|
|
267
267
|
```
|
|
268
268
|
|
|
269
269
|
1. Reads the pinned version of `@mouryaamit/nx-polystack` from `package.json` (`1.2.0`, or the installed
|
|
270
|
-
version for a range such as `^1.2.0`).
|
|
270
|
+
version for a range such as `^1.2.0`). Any other spec (a git tag, a tarball, `latest`) uses the installed
|
|
271
|
+
version, and is rewritten to a normal pin.
|
|
271
272
|
2. Target is `--to`, else the global CLI's version. Downgrades need `--force`. If the global CLI is older than the
|
|
272
273
|
workspace pin, `update` tells you to upgrade the global CLI first (or pass `--force`).
|
|
273
274
|
3. Needs a clean git tree unless `--allow-dirty`. The check covers only the workspace folder.
|
|
@@ -364,13 +365,13 @@ that, and `--ci`, `--ci-cache`, `--flutter`, `--upgrade-schedule` and `--upgrade
|
|
|
364
365
|
UTC), plus a manual run. `polystack` scope: `pstack update --to=<latest release>`; `nx-minor` also
|
|
365
366
|
runs `nx migrate nx@<current major>`, `npm install` and the Nx migrations. Opens or updates the
|
|
366
367
|
`chore/dependency-upgrade` pull request (`chore(deps): scheduled dependency upgrade`) with
|
|
367
|
-
`peter-evans/create-pull-request@
|
|
368
|
+
`peter-evans/create-pull-request@v8`, and `subosito/flutter-action@v2` when Flutter is set up. With only `--ci=jenkins` it is skipped, with a note.
|
|
368
369
|
|
|
369
370
|
- **Settings.** The upgrade workflow finds the latest version with `npm view` and needs "Allow GitHub
|
|
370
371
|
Actions to create and approve pull requests" in the repo settings.
|
|
371
372
|
|
|
372
|
-
- Actions are pinned to major tags: `actions/checkout@
|
|
373
|
-
`nrwl/nx-set-shas@
|
|
373
|
+
- Actions are pinned to major tags: `actions/checkout@v5`, `actions/setup-node@v5`,
|
|
374
|
+
`nrwl/nx-set-shas@v5`, `actions/cache@v5`, `peter-evans/create-pull-request@v8`.
|
|
374
375
|
|
|
375
376
|
The llm block is refreshed and lists the new npm scripts. Through the global CLI, `pstack infra`
|
|
376
377
|
needs nx-polystack 0.9.0 or newer pinned in the workspace.
|
package/dist/migrations.json
CHANGED
|
@@ -82,6 +82,11 @@
|
|
|
82
82
|
"version": "1.0.0",
|
|
83
83
|
"description": "Add the web/ folder (index.html, manifest.json) that flutter build web needs to Flutter apps generated without one",
|
|
84
84
|
"implementation": "./src/migrations/flutter-web-platform/flutter-web-platform"
|
|
85
|
+
},
|
|
86
|
+
"github-actions-node24": {
|
|
87
|
+
"version": "1.0.2",
|
|
88
|
+
"description": "Move GitHub workflows to the Node 24 action versions (checkout, setup-node, cache, nx-set-shas v5; create-pull-request v8)",
|
|
89
|
+
"implementation": "./src/migrations/github-actions-node24/github-actions-node24"
|
|
85
90
|
}
|
|
86
91
|
}
|
|
87
92
|
}
|
|
@@ -35,10 +35,14 @@ async function runUpdate(ctx, deps = defaultDeps) {
|
|
|
35
35
|
throw new types_1.CliError('--to requires a version, e.g. --to=0.3.0');
|
|
36
36
|
}
|
|
37
37
|
const pkgText = fs.readFileSync(pkgPath, 'utf8');
|
|
38
|
-
const
|
|
38
|
+
const installedVersion = (0, context_1.resolveLocalPlugin)(root)?.version;
|
|
39
|
+
const pin = (0, update_plan_1.findPluginPin)(JSON.parse(pkgText.replace(/^\uFEFF/, '')), ctx.selfVersion, installedVersion);
|
|
40
|
+
if (pin.fromInstalled) {
|
|
41
|
+
console.log(`${pin.field}: "${pin.spec}" is not a version pin; migrating from the installed v${pin.version}.`);
|
|
42
|
+
}
|
|
39
43
|
if (pin.range) {
|
|
40
44
|
// ^x.y.z may have installed a newer version: migrate from what is installed.
|
|
41
|
-
const installed =
|
|
45
|
+
const installed = installedVersion;
|
|
42
46
|
if (installed &&
|
|
43
47
|
/^\d+\.\d+\.\d+$/.test(installed) &&
|
|
44
48
|
(0, versions_1.compareVersions)(installed, pin.version) > 0) {
|
|
@@ -46,7 +50,8 @@ async function runUpdate(ctx, deps = defaultDeps) {
|
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
52
|
const target = (0, update_plan_1.resolveTarget)(pin.version, (0, args_1.flagString)(ctx.flags, 'to'), ctx.selfVersion, !!ctx.flags['force']);
|
|
49
|
-
|
|
53
|
+
// An unreadable pin on the current version is still rewritten to a normal pin.
|
|
54
|
+
if (target.action === 'noop' && !pin.fromInstalled) {
|
|
50
55
|
console.log(`Already on nx-polystack v${target.to}.`);
|
|
51
56
|
return 0;
|
|
52
57
|
}
|
|
@@ -90,6 +95,10 @@ async function runUpdate(ctx, deps = defaultDeps) {
|
|
|
90
95
|
`${local ? `v${local.version}` : 'nothing'}. package.json and package-lock.json were restored; ` +
|
|
91
96
|
'node_modules may now hold another version — run npm install to resync.');
|
|
92
97
|
}
|
|
98
|
+
if (target.action === 'noop') {
|
|
99
|
+
console.log(`\nPinned nx-polystack v${target.to}. Review with "git diff".`);
|
|
100
|
+
return 0;
|
|
101
|
+
}
|
|
93
102
|
const code = deps.runLocalMigrate(local.cliPath, pin.version, target.to, root, ctx.verbose);
|
|
94
103
|
if (code !== 0) {
|
|
95
104
|
console.error(`\nThe plugin is already on v${target.to}, but migrations from v${pin.version} did not all apply.\n` +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/cli/commands/update.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;AACzB,mDAA6B;AAE7B,kCAAqC;AACrC,wCAAmE;AACnE,kCAAiD;AACjD,sDAAkD;AAClD,0CAAuC;AACvC,oCAAoD;AACpD,gDAA8D;AAC9D,0CAA8F;AAgB9F,kDAAkD;AAClD,SAAgB,WAAW,CAAC,IAAY,EAAE,EAAU,EAAE,OAAO,GAAG,KAAK;IACnE,OAAO,CAAC,UAAU,EAAE,UAAU,IAAI,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACzF,CAAC;AAFD,kCAEC;AAED,MAAM,WAAW,GAAe;IAC9B,IAAI,EAAE,kBAAW;IACjB,SAAS,EAAT,gBAAS;IACT,eAAe,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,CACnD,IAAA,mBAAQ,EAAC,OAAO,EAAE,WAAW,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC;CACzD,CAAC;AAEK,KAAK,UAAU,SAAS,CAC7B,GAAmB,EACnB,OAAmB,WAAW;IAE9B,MAAM,IAAI,GAAG,IAAA,2BAAiB,EAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxC,IAAI,CAAC,IAAI,EAAE;QACT,MAAM,IAAI,gBAAQ,CAChB,2FAA2F,CAC5F,CAAC;KACH;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAChD,MAAM,QAAQ,GAAG,IA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C,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACjC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;SACnF,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -6,10 +6,20 @@ export interface PluginPin {
|
|
|
6
6
|
spec: string;
|
|
7
7
|
/** An npm range (^x.y.z, ~x.y.z): the installed version may be newer than `version`. */
|
|
8
8
|
range: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* The spec names no version pstack recognises (a git tag of another repo, a tarball, a tag such
|
|
11
|
+
* as "latest"); `version` is the installed plugin's version.
|
|
12
|
+
*/
|
|
13
|
+
fromInstalled?: boolean;
|
|
9
14
|
}
|
|
10
15
|
export interface UpdateTarget {
|
|
11
16
|
action: 'noop' | 'upgrade' | 'downgrade';
|
|
12
17
|
to: string;
|
|
13
18
|
}
|
|
14
|
-
|
|
19
|
+
/**
|
|
20
|
+
* The plugin entry of package.json. A spec pstack cannot read a version from falls back to
|
|
21
|
+
* `installed` (the version in node_modules), so `pstack update` can move such a workspace to a
|
|
22
|
+
* normal pin; without an installed copy it is an error.
|
|
23
|
+
*/
|
|
24
|
+
export declare function findPluginPin(pkg: any, example?: string, installed?: string): PluginPin;
|
|
15
25
|
export declare function resolveTarget(from: string, toFlag: string | undefined, selfVersion: string, force: boolean): UpdateTarget;
|
|
@@ -7,16 +7,25 @@ const versions_1 = require("./versions");
|
|
|
7
7
|
function pinCommand(version) {
|
|
8
8
|
return ['npm i -D', `${versions_1.PLUGIN_NAME}@${(0, versions_1.formatPluginSpec)(version)}`, ...(0, versions_1.pinInstallFlags)()].join(' ');
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* The plugin entry of package.json. A spec pstack cannot read a version from falls back to
|
|
12
|
+
* `installed` (the version in node_modules), so `pstack update` can move such a workspace to a
|
|
13
|
+
* normal pin; without an installed copy it is an error.
|
|
14
|
+
*/
|
|
15
|
+
function findPluginPin(
|
|
10
16
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
-
|
|
17
|
+
pkg, example = '0.3.0', installed) {
|
|
12
18
|
for (const field of ['devDependencies', 'dependencies']) {
|
|
13
19
|
const spec = pkg?.[field]?.[versions_1.PLUGIN_NAME];
|
|
14
20
|
if (spec === undefined)
|
|
15
21
|
continue;
|
|
16
22
|
const version = (0, versions_1.parsePluginSpec)(spec);
|
|
23
|
+
if (!version && installed && /^\d+\.\d+\.\d+$/.test(installed)) {
|
|
24
|
+
return { field, version: installed, spec, range: false, fromInstalled: true };
|
|
25
|
+
}
|
|
17
26
|
if (!version) {
|
|
18
|
-
throw new types_1.CliError(`${versions_1.PLUGIN_NAME} is "${spec}" in ${field}
|
|
19
|
-
`pin one first: ${pinCommand(example)}`);
|
|
27
|
+
throw new types_1.CliError(`${versions_1.PLUGIN_NAME} is "${spec}" in ${field} and no installed copy was found. ` +
|
|
28
|
+
`pstack update needs a pinned version — pin one first: ${pinCommand(example)}`);
|
|
20
29
|
}
|
|
21
30
|
return { field, version, spec, range: /^\s*[\^~]/.test(spec) };
|
|
22
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-plan.js","sourceRoot":"","sources":["../../../src/cli/update-plan.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,yCAQoB;AAEpB,yFAAyF;AACzF,SAAS,UAAU,CAAC,OAAe;IACjC,OAAO,CAAC,UAAU,EAAE,GAAG,sBAAW,IAAI,IAAA,2BAAgB,EAAC,OAAO,CAAC,EAAE,EAAE,GAAG,IAAA,0BAAe,GAAE,CAAC,CAAC,IAAI,CAC3F,GAAG,CACJ,CAAC;AACJ,CAAC;
|
|
1
|
+
{"version":3,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D,UAAU,CAAC,OAAO,CAAC,EAAE,CACrF,CAAC;AACJ,CAAC;AAxBD,sCAwBC;AAED,SAAgB,aAAa,CAC3B,IAAY,EACZ,MAA0B,EAC1B,WAAmB,EACnB,KAAc;IAEd,MAAM,EAAE,GAAG,IAAA,2BAAgB,EAAC,MAAM,IAAI,WAAW,CAAC,CAAC;IACnD,MAAM,GAAG,GAAG,IAAA,0BAAe,EAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IACtC,IAAI,GAAG,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IAC7C,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE;QACrB,MAAM,IAAI,gBAAQ,CAChB,MAAM,KAAK,SAAS;YAClB,CAAC,CAAC,mBAAmB,EAAE,mCAAmC,IAAI,mBAAmB;gBAC/E,IAAI,IAAA,+BAAoB,EAAC,IAAI,CAAC,2DAA2D;YAC3F,CAAC,CAAC,IAAI,EAAE,iCAAiC,IAAI,8BAA8B,CAC9E,CAAC;KACH;IACD,OAAO,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,EAAE,CAAC;AAC3D,CAAC;AAlBD,sCAkBC"}
|
package/dist/src/generators/infra/files/ci/github-actions/.github/workflows/ci.yml__template__
CHANGED
|
@@ -25,10 +25,10 @@ jobs:
|
|
|
25
25
|
main:
|
|
26
26
|
runs-on: ubuntu-latest
|
|
27
27
|
steps:
|
|
28
|
-
- uses: actions/checkout@
|
|
28
|
+
- uses: actions/checkout@v5
|
|
29
29
|
with:
|
|
30
30
|
fetch-depth: 0
|
|
31
|
-
- uses: actions/setup-node@
|
|
31
|
+
- uses: actions/setup-node@v5
|
|
32
32
|
with:
|
|
33
33
|
node-version-file: .nvmrc
|
|
34
34
|
cache: npm
|
|
@@ -53,7 +53,7 @@ jobs:
|
|
|
53
53
|
- run: npm ci
|
|
54
54
|
<%_ if (ciCache) { _%>
|
|
55
55
|
- name: Nx cache
|
|
56
|
-
uses: actions/cache@
|
|
56
|
+
uses: actions/cache@v5
|
|
57
57
|
with:
|
|
58
58
|
path: <%= cacheDirectory %>
|
|
59
59
|
key: nx-${{ runner.os }}-${{ hashFiles('package-lock.json') }}-${{ github.sha }}
|
|
@@ -61,7 +61,7 @@ jobs:
|
|
|
61
61
|
nx-${{ runner.os }}-${{ hashFiles('package-lock.json') }}-
|
|
62
62
|
nx-${{ runner.os }}-
|
|
63
63
|
<%_ } _%>
|
|
64
|
-
- uses: nrwl/nx-set-shas@
|
|
64
|
+
- uses: nrwl/nx-set-shas@v5
|
|
65
65
|
with:
|
|
66
66
|
main-branch-name: <%= baseBranch %>
|
|
67
67
|
- run: npx nx affected -t lint typecheck test build --parallel=3
|
|
@@ -24,10 +24,10 @@ jobs:
|
|
|
24
24
|
upgrade:
|
|
25
25
|
runs-on: ubuntu-latest
|
|
26
26
|
steps:
|
|
27
|
-
- uses: actions/checkout@
|
|
27
|
+
- uses: actions/checkout@v5
|
|
28
28
|
with:
|
|
29
29
|
ref: <%= baseBranch %>
|
|
30
|
-
- uses: actions/setup-node@
|
|
30
|
+
- uses: actions/setup-node@v5
|
|
31
31
|
with:
|
|
32
32
|
node-version-file: .nvmrc
|
|
33
33
|
cache: npm
|
|
@@ -67,7 +67,7 @@ jobs:
|
|
|
67
67
|
rm migrations.json
|
|
68
68
|
fi
|
|
69
69
|
<%_ } _%>
|
|
70
|
-
- uses: peter-evans/create-pull-request@
|
|
70
|
+
- uses: peter-evans/create-pull-request@v8
|
|
71
71
|
with:
|
|
72
72
|
branch: chore/dependency-upgrade
|
|
73
73
|
base: <%= baseBranch %>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Tree } from '@nx/devkit';
|
|
2
|
+
/**
|
|
3
|
+
* Action versions the plugin's workflows used, and the first version of each that runs on
|
|
4
|
+
* Node 24 (GitHub deprecated Node 20 for actions). Only these exact refs are moved.
|
|
5
|
+
*/
|
|
6
|
+
export declare const NODE24_ACTIONS: Readonly<Record<string, {
|
|
7
|
+
from: string;
|
|
8
|
+
to: string;
|
|
9
|
+
}>>;
|
|
10
|
+
/** `uses:` lines of the listed actions at their old major moved to the Node 24 major. */
|
|
11
|
+
export declare function bumpWorkflowActions(text: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* v1.0.2: GitHub runs Node 20 actions on Node 24 and has deprecated them. Workflows the plugin
|
|
14
|
+
* generated (CI, PR title, dependency upgrade) move to the actions' Node 24 majors:
|
|
15
|
+
* checkout/setup-node/cache/nx-set-shas v5 and create-pull-request v8. Other actions and pinned
|
|
16
|
+
* SHAs are left alone.
|
|
17
|
+
*/
|
|
18
|
+
export default function githubActionsNode24(tree: Tree): Promise<void>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bumpWorkflowActions = exports.NODE24_ACTIONS = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const WORKFLOWS = '.github/workflows';
|
|
6
|
+
/**
|
|
7
|
+
* Action versions the plugin's workflows used, and the first version of each that runs on
|
|
8
|
+
* Node 24 (GitHub deprecated Node 20 for actions). Only these exact refs are moved.
|
|
9
|
+
*/
|
|
10
|
+
exports.NODE24_ACTIONS = {
|
|
11
|
+
'actions/checkout': { from: 'v4', to: 'v5' },
|
|
12
|
+
'actions/setup-node': { from: 'v4', to: 'v5' },
|
|
13
|
+
'actions/cache': { from: 'v4', to: 'v5' },
|
|
14
|
+
'nrwl/nx-set-shas': { from: 'v4', to: 'v5' },
|
|
15
|
+
'peter-evans/create-pull-request': { from: 'v6', to: 'v8' },
|
|
16
|
+
};
|
|
17
|
+
const escapeRegExp = (s) => s.replace(/[.*+?^${}()|[\]\\/]/g, '\\$&');
|
|
18
|
+
/** `uses:` lines of the listed actions at their old major moved to the Node 24 major. */
|
|
19
|
+
function bumpWorkflowActions(text) {
|
|
20
|
+
let out = text;
|
|
21
|
+
for (const [action, { from, to }] of Object.entries(exports.NODE24_ACTIONS)) {
|
|
22
|
+
const re = new RegExp(`(\\buses:\\s*['"]?${escapeRegExp(action)})@${from}(?![\\w.])`, 'g');
|
|
23
|
+
out = out.replace(re, `$1@${to}`);
|
|
24
|
+
}
|
|
25
|
+
return out;
|
|
26
|
+
}
|
|
27
|
+
exports.bumpWorkflowActions = bumpWorkflowActions;
|
|
28
|
+
/**
|
|
29
|
+
* v1.0.2: GitHub runs Node 20 actions on Node 24 and has deprecated them. Workflows the plugin
|
|
30
|
+
* generated (CI, PR title, dependency upgrade) move to the actions' Node 24 majors:
|
|
31
|
+
* checkout/setup-node/cache/nx-set-shas v5 and create-pull-request v8. Other actions and pinned
|
|
32
|
+
* SHAs are left alone.
|
|
33
|
+
*/
|
|
34
|
+
async function githubActionsNode24(tree) {
|
|
35
|
+
if (!tree.exists(WORKFLOWS))
|
|
36
|
+
return;
|
|
37
|
+
const changed = [];
|
|
38
|
+
for (const name of tree.children(WORKFLOWS)) {
|
|
39
|
+
const file = `${WORKFLOWS}/${name}`;
|
|
40
|
+
if (!/\.ya?ml$/.test(name) || !tree.isFile(file))
|
|
41
|
+
continue;
|
|
42
|
+
const text = tree.read(file, 'utf-8') ?? '';
|
|
43
|
+
const next = bumpWorkflowActions(text);
|
|
44
|
+
if (next !== text) {
|
|
45
|
+
tree.write(file, next);
|
|
46
|
+
changed.push(file);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (changed.length > 0) {
|
|
50
|
+
devkit_1.logger.info(`github-actions-node24: ${changed.join(', ')} moved to the Node 24 action versions.`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.default = githubActionsNode24;
|
|
54
|
+
//# sourceMappingURL=github-actions-node24.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-actions-node24.js","sourceRoot":"","sources":["../../../../src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OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;QAC3C,MAAM,IAAI,GAAG,GAAG,SAAS,IAAI,IAAI,EAAE,CAAC;QACpC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YAAE,SAAS;QAC3D,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;QAC5C,MAAM,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,IAAI,KAAK,IAAI,EAAE;YACjB,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACvB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACpB;KACF;IACD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;QACtB,eAAM,CAAC,IAAI,CACT,0BAA0B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,wCAAwC,CACrF,CAAC;KACH;AACH,CAAC;AAlBD,sCAkBC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mouryaamit/nx-polystack",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Nx plugin and pstack CLI that scaffold and build multi-tech monorepos (Angular, Ionic, Flutter) with a hardened release pipeline.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "commonjs",
|