@jsonpages/cli 3.0.58 → 3.0.60
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/assets/src_tenant_alpha.sh +762 -1491
- package/package.json +1 -1
- package/src/index.js +16 -7
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -134,14 +134,23 @@ program
|
|
|
134
134
|
await processScriptInNode(scriptPath, targetDir);
|
|
135
135
|
spinner.succeed('Source code and assets projected successfully.');
|
|
136
136
|
|
|
137
|
-
// 5. DEPENDENCY RESOLUTION (
|
|
137
|
+
// 5. DEPENDENCY RESOLUTION (SOT: apps/tenant-alpha/package.json; fallback: @jsonpages/stack)
|
|
138
138
|
spinner.start('Installing dependencies (this may take a minute)...');
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
139
|
+
const sotPath = path.resolve(process.cwd(), 'apps', 'tenant-alpha', 'package.json');
|
|
140
|
+
let depSpecs = [];
|
|
141
|
+
let devDepSpecs = [];
|
|
142
|
+
if (await fs.pathExists(sotPath)) {
|
|
143
|
+
const sot = await fs.readJson(sotPath);
|
|
144
|
+
depSpecs = Object.entries(sot.dependencies || {}).map(([n, v]) => `${n}@${v}`);
|
|
145
|
+
devDepSpecs = Object.entries(sot.devDependencies || {}).map(([n, v]) => `${n}@${v}`);
|
|
146
|
+
}
|
|
147
|
+
if (depSpecs.length === 0 && devDepSpecs.length === 0) {
|
|
148
|
+
const stack = (await import('@jsonpages/stack')).default;
|
|
149
|
+
depSpecs = Object.entries(stack.dependencies || {}).map(([name, ver]) => `${name}@${ver}`);
|
|
150
|
+
devDepSpecs = Object.entries(stack.devDependencies || {}).map(([name, ver]) => `${name}@${ver}`);
|
|
151
|
+
}
|
|
152
|
+
if (depSpecs.length > 0) await execa(npmCmd, ['install', ...depSpecs], { cwd: targetDir });
|
|
153
|
+
if (devDepSpecs.length > 0) await execa(npmCmd, ['install', '-D', ...devDepSpecs], { cwd: targetDir });
|
|
145
154
|
|
|
146
155
|
spinner.succeed(chalk.green.bold('✨ Tenant Ready!'));
|
|
147
156
|
|