@techninja/clearstack 0.3.22 → 0.3.24
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/lib/platform-files.js
CHANGED
|
@@ -32,14 +32,17 @@ function copySkipExisting(src, dest, label) {
|
|
|
32
32
|
mkdirSync(dest, { recursive: true });
|
|
33
33
|
let count = 0;
|
|
34
34
|
for (const entry of readdirSync(src, { withFileTypes: true })) {
|
|
35
|
+
const srcPath = join(src, entry.name);
|
|
35
36
|
const destPath = join(dest, entry.name);
|
|
36
|
-
if (
|
|
37
|
+
if (entry.isDirectory()) {
|
|
38
|
+
count += copySkipExisting(srcPath, destPath, `${label}/${entry.name}`);
|
|
39
|
+
} else if (existsSync(destPath)) {
|
|
37
40
|
console.log(` ⏭ Skipped: ${label}/${entry.name} (exists)`);
|
|
38
|
-
|
|
41
|
+
} else {
|
|
42
|
+
cpSync(srcPath, destPath);
|
|
43
|
+
console.log(` ✓ Created: ${label}/${entry.name}`);
|
|
44
|
+
count++;
|
|
39
45
|
}
|
|
40
|
-
cpSync(join(src, entry.name), destPath, { recursive: entry.isDirectory() });
|
|
41
|
-
console.log(` ✓ Created: ${label}/${entry.name}`);
|
|
42
|
-
count++;
|
|
43
46
|
}
|
|
44
47
|
return count;
|
|
45
48
|
}
|
|
@@ -104,10 +107,16 @@ export function initPlatform(platform, projectDir) {
|
|
|
104
107
|
}
|
|
105
108
|
}
|
|
106
109
|
|
|
107
|
-
/** Run platform update: re-vendor
|
|
110
|
+
/** Run platform update: re-vendor, sync docs, add new scripts/api. */
|
|
108
111
|
export function updatePlatform(platform, projectDir) {
|
|
109
|
-
const { name, manifest } = platform;
|
|
112
|
+
const { name, manifest, pkgDir } = platform;
|
|
110
113
|
console.log(`\n📦 Platform: ${name} (${manifest.prefix})`);
|
|
111
114
|
vendorPlatform(platform, projectDir);
|
|
112
115
|
syncPlatformDocs(platform, projectDir);
|
|
116
|
+
if (manifest.scripts) {
|
|
117
|
+
copySkipExisting(resolve(pkgDir, manifest.scripts), resolve(projectDir, 'scripts'), 'scripts');
|
|
118
|
+
}
|
|
119
|
+
if (manifest.api) {
|
|
120
|
+
copySkipExisting(resolve(pkgDir, manifest.api), resolve(projectDir, 'api'), 'api');
|
|
121
|
+
}
|
|
113
122
|
}
|
package/package.json
CHANGED
|
@@ -36,7 +36,11 @@ const pkgPath = resolve(ROOT, 'package.json');
|
|
|
36
36
|
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
37
37
|
const [ma, mi, pa] = pkg.version.split('.').map(Number);
|
|
38
38
|
const next =
|
|
39
|
-
bump === 'major'
|
|
39
|
+
bump === 'major'
|
|
40
|
+
? `${ma + 1}.0.0`
|
|
41
|
+
: bump === 'minor'
|
|
42
|
+
? `${ma}.${mi + 1}.0`
|
|
43
|
+
: `${ma}.${mi}.${pa + 1}`;
|
|
40
44
|
pkg.version = next;
|
|
41
45
|
writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n');
|
|
42
46
|
console.log(`\n📦 ${pkg.name} → v${next}\n`);
|