@runwell/shopify-toolkit 0.10.0 → 0.11.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/lib/init.js +36 -1
- package/package.json +1 -1
package/lib/init.js
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
|
|
5
|
+
function copyRecursive(src, dst) {
|
|
6
|
+
if (src.endsWith('README.md')) return;
|
|
7
|
+
const stat = fs.statSync(src);
|
|
8
|
+
if (stat.isDirectory()) {
|
|
9
|
+
fs.mkdirSync(dst, { recursive: true });
|
|
10
|
+
for (const entry of fs.readdirSync(src)) {
|
|
11
|
+
copyRecursive(path.join(src, entry), path.join(dst, entry));
|
|
12
|
+
}
|
|
13
|
+
} else {
|
|
14
|
+
fs.mkdirSync(path.dirname(dst), { recursive: true });
|
|
15
|
+
fs.copyFileSync(src, dst);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
3
18
|
|
|
4
19
|
/* runwell-shopify init <client> [--baseline <pin>]: scaffold a new
|
|
5
20
|
tenant theme directory with the minimum required files.
|
|
@@ -19,10 +34,30 @@ export async function init(flags) {
|
|
|
19
34
|
}
|
|
20
35
|
|
|
21
36
|
fs.mkdirSync(targetDir, { recursive: true });
|
|
22
|
-
for (const d of ['layout', 'sections', 'snippets', 'assets', 'config', 'locales', 'templates', 'tenant-overrides']) {
|
|
37
|
+
for (const d of ['layout', 'sections', 'snippets', 'assets', 'config', 'locales', 'templates', 'tenant-overrides', '.github/workflows']) {
|
|
23
38
|
fs.mkdirSync(path.join(targetDir, d), { recursive: true });
|
|
24
39
|
}
|
|
25
40
|
|
|
41
|
+
// Copy scaffold files from the dawn-runwell baseline package if available
|
|
42
|
+
// locally. Resolution: baseline_path > installed package > skip.
|
|
43
|
+
try {
|
|
44
|
+
const candidates = [
|
|
45
|
+
flags.baselinePath,
|
|
46
|
+
flags.baseline_path,
|
|
47
|
+
path.join(os.homedir(), 'Documents/Code/runwell-dawn-runwell')
|
|
48
|
+
].filter(Boolean);
|
|
49
|
+
for (const baseRoot of candidates) {
|
|
50
|
+
const scaffoldDir = path.join(baseRoot, 'scaffold');
|
|
51
|
+
if (fs.existsSync(scaffoldDir)) {
|
|
52
|
+
copyRecursive(scaffoldDir, targetDir);
|
|
53
|
+
console.log(`Scaffold files copied from ${scaffoldDir}`);
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
} catch (e) {
|
|
58
|
+
console.warn(`Skipped scaffold copy: ${e.message}`);
|
|
59
|
+
}
|
|
60
|
+
|
|
26
61
|
const baseline = flags.baseline || '@runwell/dawn-runwell@^1.0.0';
|
|
27
62
|
|
|
28
63
|
const config = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runwell/shopify-toolkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Reusable Shopify theme modules from Runwell. Replaces typically app-driven features (reviews, wishlist, urgency, FAQ, post-purchase upsell, exit popups, free-ship progress, sticky ATC, testimonials, badges, bundles) with native Liquid + JS + CSS that ship across multiple client themes via a config-driven sync CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|