@ramme-io/create-app 3.0.1 → 3.0.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/index.js +31 -8
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -26,8 +26,24 @@ if (!projectName) {
|
|
|
26
26
|
const templatePath = path.resolve(__dirname, 'template');
|
|
27
27
|
const destinationPath = path.resolve(process.cwd(), projectName);
|
|
28
28
|
|
|
29
|
-
// THE STABILITY PACT:
|
|
30
|
-
|
|
29
|
+
// THE STABILITY PACT: pinned target ranges for the public release.
|
|
30
|
+
//
|
|
31
|
+
// One shared constant used to cover all three packages, which silently broke
|
|
32
|
+
// the moment their majors diverged: @ramme-io/ui went to 4.x and
|
|
33
|
+
// @ramme-io/kernel to 5.x while this still said "^3.0.0", so every scaffolded
|
|
34
|
+
// app resolved the previous major and nothing errored — ^3.0.0 is perfectly
|
|
35
|
+
// satisfied by 3.1.0. Per-package ranges make that failure impossible to
|
|
36
|
+
// express.
|
|
37
|
+
//
|
|
38
|
+
// These MUST be bumped whenever a framework package takes a major. The
|
|
39
|
+
// verification step is scaffolding an app and confirming the installed
|
|
40
|
+
// versions match what was just published, not merely that the build passes —
|
|
41
|
+
// a stale pin builds fine, it just ships the wrong framework.
|
|
42
|
+
const RELEASE_VERSIONS = {
|
|
43
|
+
'@ramme-io/ui': '^4.0.0',
|
|
44
|
+
'@ramme-io/kernel': '^5.0.0',
|
|
45
|
+
'@ramme-io/shared': '^3.1.1',
|
|
46
|
+
};
|
|
31
47
|
|
|
32
48
|
try {
|
|
33
49
|
console.log(`\n🚀 Creating new Ramme app in: ${destinationPath}`);
|
|
@@ -46,14 +62,21 @@ try {
|
|
|
46
62
|
// 3. HARDEN SUPPLY CHAIN — Strip workspace:* for public installs
|
|
47
63
|
if (fs.existsSync(targetPkgPath)) {
|
|
48
64
|
const pkg = fs.readJsonSync(targetPkgPath);
|
|
49
|
-
const
|
|
65
|
+
for (const section of ['dependencies', 'devDependencies']) {
|
|
66
|
+
for (const dep of Object.keys(pkg[section] || {})) {
|
|
67
|
+
if (!pkg[section][dep].includes('workspace:')) continue;
|
|
50
68
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
69
|
+
const pinned = RELEASE_VERSIONS[dep];
|
|
70
|
+
if (!pinned) {
|
|
71
|
+
// A workspace dependency with no pinned range would ship as a
|
|
72
|
+
// literal "workspace:*" and fail on install with an opaque error.
|
|
73
|
+
// Fail here instead, where the cause is obvious.
|
|
74
|
+
throw new Error(
|
|
75
|
+
`No published version pinned for "${dep}". Add it to RELEASE_VERSIONS in index.js.`
|
|
76
|
+
);
|
|
56
77
|
}
|
|
78
|
+
pkg[section][dep] = pinned;
|
|
79
|
+
console.log(` 🔧 ${section} → ${dep}: workspace:* → ${pinned}`);
|
|
57
80
|
}
|
|
58
81
|
}
|
|
59
82
|
|