@smartsoft001/core 2.145.0 → 2.146.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smartsoft001/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.146.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
"description": "Every framework-agnostic @smartsoft001 package in one install: the model decorators, the domain contracts, the helpers and the shared DTOs.",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@smartsoft001/models": "2.
|
|
15
|
-
"@smartsoft001/domain-core": "2.
|
|
16
|
-
"@smartsoft001/utils": "2.
|
|
17
|
-
"@smartsoft001/users": "2.
|
|
18
|
-
"@smartsoft001/auth-domain": "2.
|
|
19
|
-
"@smartsoft001/crud-domain": "2.
|
|
20
|
-
"@smartsoft001/crud-shell-dtos": "2.
|
|
21
|
-
"@smartsoft001/auth-shell-dtos": "2.
|
|
22
|
-
"@smartsoft001/crud-shell-app-services": "2.
|
|
23
|
-
"@smartsoft001/auth-shell-app-services": "2.
|
|
14
|
+
"@smartsoft001/models": "2.146.0",
|
|
15
|
+
"@smartsoft001/domain-core": "2.146.0",
|
|
16
|
+
"@smartsoft001/utils": "2.146.0",
|
|
17
|
+
"@smartsoft001/users": "2.146.0",
|
|
18
|
+
"@smartsoft001/auth-domain": "2.146.0",
|
|
19
|
+
"@smartsoft001/crud-domain": "2.146.0",
|
|
20
|
+
"@smartsoft001/crud-shell-dtos": "2.146.0",
|
|
21
|
+
"@smartsoft001/auth-shell-dtos": "2.146.0",
|
|
22
|
+
"@smartsoft001/crud-shell-app-services": "2.146.0",
|
|
23
|
+
"@smartsoft001/auth-shell-app-services": "2.146.0"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* A migration runs in the consumer's workspace, where the only thing it may
|
|
3
|
+
* assume is the `Tree` Nx hands it. `@nx/devkit` is a development dependency of
|
|
4
|
+
* this repository, not of a project that installs the framework, so importing
|
|
5
|
+
* its helpers at runtime fails with `Cannot find module '@nx/devkit'` the first
|
|
6
|
+
* time someone runs the migration. The type import below is erased at compile
|
|
7
|
+
* time and costs the consumer nothing.
|
|
8
|
+
*/
|
|
9
|
+
import type { Tree } from '@nx/devkit';
|
|
2
10
|
export default function update(tree: Tree): Promise<void>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = update;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
4
|
/**
|
|
6
5
|
* The meta packages and the packages each of them pins.
|
|
7
6
|
*
|
|
@@ -70,6 +69,18 @@ function compareVersions(a, b) {
|
|
|
70
69
|
function highestVersion(versions) {
|
|
71
70
|
return versions.reduce((highest, version) => compareVersions(version, highest) > 0 ? version : highest);
|
|
72
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* A plain version or range: `2.145.0`, `^2.145.0`, `>=2.145.0 <3.0.0`.
|
|
74
|
+
*
|
|
75
|
+
* Anything else — `file:`, `workspace:`, a git URL, an alias — means the
|
|
76
|
+
* project resolves that package its own way, and the stack's pinned version
|
|
77
|
+
* would not be the same thing. Those groups are left alone rather than
|
|
78
|
+
* guessed at: comparing the digits inside `file:smartsoft001-core-2.145.0.tgz`
|
|
79
|
+
* produces a number, and the wrong one.
|
|
80
|
+
*/
|
|
81
|
+
function isVersionRange(specifier) {
|
|
82
|
+
return /^[\^~>=< ]*\d+\.\d+\.\d+[\w.+-]*( .*)?$/.test(specifier.trim());
|
|
83
|
+
}
|
|
73
84
|
function isSorted(names) {
|
|
74
85
|
return names.every((name, index) => index === 0 || names[index - 1] <= name);
|
|
75
86
|
}
|
|
@@ -80,12 +91,20 @@ function isSorted(names) {
|
|
|
80
91
|
function collapse(deps) {
|
|
81
92
|
const keepSorted = isSorted(Object.keys(deps));
|
|
82
93
|
const replacements = [];
|
|
94
|
+
const skipped = [];
|
|
83
95
|
let entries = Object.entries(deps);
|
|
84
96
|
for (const [stack, members] of Object.entries(STACKS)) {
|
|
85
97
|
const present = entries.filter(([name]) => members.includes(name));
|
|
86
98
|
if (present.length < 2) {
|
|
87
99
|
continue;
|
|
88
100
|
}
|
|
101
|
+
const unusual = present.filter(([, version]) => !isVersionRange(version));
|
|
102
|
+
if (unusual.length > 0) {
|
|
103
|
+
skipped.push(`${stack}: left alone, ${unusual
|
|
104
|
+
.map(([name, version]) => `${name} is "${version}"`)
|
|
105
|
+
.join(', ')}`);
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
89
108
|
// An entry for the stack itself is folded in rather than left duplicated.
|
|
90
109
|
const replaces = ([name]) => members.includes(name) || name === stack;
|
|
91
110
|
const versions = entries.filter(replaces).map(([, version]) => version);
|
|
@@ -110,7 +129,7 @@ function collapse(deps) {
|
|
|
110
129
|
if (keepSorted) {
|
|
111
130
|
entries.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0));
|
|
112
131
|
}
|
|
113
|
-
return { deps: Object.fromEntries(entries), replacements };
|
|
132
|
+
return { deps: Object.fromEntries(entries), replacements, skipped };
|
|
114
133
|
}
|
|
115
134
|
function describeReplacement(section, replacement) {
|
|
116
135
|
const { stack, version, versions, replaced } = replacement;
|
|
@@ -119,29 +138,45 @@ function describeReplacement(section, replacement) {
|
|
|
119
138
|
: '';
|
|
120
139
|
return `${section}: ${replaced.join(', ')} -> ${stack}@${version}${disagreed}`;
|
|
121
140
|
}
|
|
141
|
+
/** The shape `updateJson` writes: two spaces and a trailing newline. */
|
|
142
|
+
function serialize(json) {
|
|
143
|
+
return `${JSON.stringify(json, null, 2)}\n`;
|
|
144
|
+
}
|
|
122
145
|
async function update(tree) {
|
|
146
|
+
const contents = tree.exists('package.json')
|
|
147
|
+
? tree.read('package.json', 'utf-8')
|
|
148
|
+
: null;
|
|
149
|
+
if (!contents) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const json = JSON.parse(contents);
|
|
123
153
|
const leftovers = [];
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
154
|
+
const messages = [];
|
|
155
|
+
for (const section of SECTIONS) {
|
|
156
|
+
const current = json[section];
|
|
157
|
+
if (!current) {
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
const { deps, replacements, skipped } = collapse(current);
|
|
161
|
+
json[section] = deps;
|
|
162
|
+
for (const replacement of replacements) {
|
|
163
|
+
messages.push(describeReplacement(section, replacement));
|
|
164
|
+
}
|
|
165
|
+
for (const note of skipped) {
|
|
166
|
+
messages.push(`${section}: ${note}`);
|
|
167
|
+
}
|
|
168
|
+
for (const name of Object.keys(deps)) {
|
|
169
|
+
if (MEMBERS.has(name) && !leftovers.includes(name)) {
|
|
170
|
+
leftovers.push(name);
|
|
139
171
|
}
|
|
140
172
|
}
|
|
141
|
-
|
|
142
|
-
|
|
173
|
+
}
|
|
174
|
+
tree.write('package.json', serialize(json));
|
|
175
|
+
for (const message of messages) {
|
|
176
|
+
console.log(message);
|
|
177
|
+
}
|
|
143
178
|
if (leftovers.length > 0) {
|
|
144
|
-
|
|
179
|
+
console.log(`Still installed individually: ${leftovers.join(', ')}`);
|
|
145
180
|
}
|
|
146
181
|
}
|
|
147
182
|
//# sourceMappingURL=use-stack-packages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-stack-packages.js","sourceRoot":"","sources":["../../../../../../../packages/meta/core/src/migrations/use-stack-packages/use-stack-packages.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"use-stack-packages.js","sourceRoot":"","sources":["../../../../../../../packages/meta/core/src/migrations/use-stack-packages/use-stack-packages.ts"],"names":[],"mappings":";;AA8MA,yBAgDC;AApPD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,GAA6B;IACvC,oBAAoB,EAAE;QACpB,sBAAsB;QACtB,2BAA2B;QAC3B,qBAAqB;QACrB,qBAAqB;QACrB,2BAA2B;QAC3B,2BAA2B;QAC3B,+BAA+B;QAC/B,+BAA+B;QAC/B,uCAAuC;QACvC,uCAAuC;KACxC;IACD,6BAA6B,EAAE;QAC7B,oBAAoB;QACpB,uBAAuB;QACvB,kCAAkC;KACnC;IACD,4BAA4B,EAAE;QAC5B,oBAAoB;QACpB,sBAAsB;QACtB,qBAAqB;QACrB,iCAAiC;QACjC,iCAAiC;KAClC;IACD,8BAA8B,EAAE;QAC9B,4BAA4B;QAC5B,wCAAwC;QACxC,kCAAkC;QAClC,sBAAsB;QACtB,oBAAoB;QACpB,sBAAsB;QACtB,uBAAuB;KACxB;CACF,CAAC;AAEF,kEAAkE;AAClE,MAAM,OAAO,GAAG,IAAI,GAAG,CACrB,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;KAClB,IAAI,EAAE;KACN,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC,CACvC,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,cAAc,EAAE,iBAAiB,CAAU,CAAC;AAiB9D,iFAAiF;AACjF,SAAS,eAAe,CAAC,CAAS,EAAE,CAAS;IAC3C,MAAM,OAAO,GAAG,CAAC,KAAa,EAAY,EAAE,CAC1C,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAE1C,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC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