@paths.design/caws-cli 3.2.2 → 3.2.4
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.js"],"names":[],"mappings":";mCAakD,OAAO;AAOzD;;;GAGG;AACH,6CAkBC;AAED;;;GAGG;AACH,uCAFa,MAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.js"],"names":[],"mappings":";mCAakD,OAAO;AAOzD;;;GAGG;AACH,6CAkBC;AAED;;;GAGG;AACH,uCAFa,MAAO,IAAI,CA2CvB;AAED;;;GAGG;AACH,6CAFa,MAAO,IAAI,CAmCvB;AAED;;;GAGG;AACH,0CAEC;AAED;;;GAGG;AACH,qDAEC"}
|
package/dist/config/index.js
CHANGED
|
@@ -49,21 +49,43 @@ function initializeGlobalSetup() {
|
|
|
49
49
|
function loadProvenanceTools() {
|
|
50
50
|
if (provenanceTools) return provenanceTools; // Already loaded
|
|
51
51
|
|
|
52
|
+
// Try multiple possible locations for provenance tools
|
|
53
|
+
const possiblePaths = [
|
|
54
|
+
// 1. Bundled templates in CLI package (for global installs)
|
|
55
|
+
path.join(__dirname, '../../templates/apps/tools/caws/provenance.js'),
|
|
56
|
+
// 2. Local project templates
|
|
57
|
+
path.join(process.cwd(), 'apps/tools/caws/provenance.js'),
|
|
58
|
+
// 3. Template package in monorepo
|
|
59
|
+
path.join(__dirname, '../../../caws-template/apps/tools/caws/provenance.js'),
|
|
60
|
+
// 4. Detected setup template directory
|
|
61
|
+
null, // Will be set from setup if available
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
// Add detected template directory if available
|
|
52
65
|
try {
|
|
53
66
|
const setup = cawsSetup || initializeGlobalSetup();
|
|
54
67
|
if (setup?.hasTemplateDir && setup?.templateDir) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
68
|
+
possiblePaths[3] = path.join(setup.templateDir, 'apps/tools/caws/provenance.js');
|
|
69
|
+
}
|
|
70
|
+
} catch (setupError) {
|
|
71
|
+
// Continue without detected setup
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Try each path until one works
|
|
75
|
+
for (const testPath of possiblePaths) {
|
|
76
|
+
if (!testPath) continue;
|
|
77
|
+
|
|
78
|
+
try {
|
|
79
|
+
const { generateProvenance, saveProvenance } = require(testPath);
|
|
58
80
|
provenanceTools = { generateProvenance, saveProvenance };
|
|
59
|
-
|
|
81
|
+
return provenanceTools;
|
|
82
|
+
} catch (pathError) {
|
|
83
|
+
// Continue to next path
|
|
60
84
|
}
|
|
61
|
-
} catch (error) {
|
|
62
|
-
// Fallback for environments without template
|
|
63
|
-
provenanceTools = null;
|
|
64
|
-
console.warn('⚠️ Provenance tools not available:', error.message);
|
|
65
85
|
}
|
|
66
86
|
|
|
87
|
+
// If all paths fail, return null (don't warn during init - templates aren't ready yet)
|
|
88
|
+
provenanceTools = null;
|
|
67
89
|
return provenanceTools;
|
|
68
90
|
}
|
|
69
91
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor-hooks.d.ts","sourceRoot":"","sources":["../../src/scaffold/cursor-hooks.js"],"names":[],"mappings":"AAaA;;;;GAIG;AACH,gDAHW,MAAM,WACN,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"cursor-hooks.d.ts","sourceRoot":"","sources":["../../src/scaffold/cursor-hooks.js"],"names":[],"mappings":"AAaA;;;;GAIG;AACH,gDAHW,MAAM,WACN,MAAM,EAAE,iBAsIlB"}
|
|
@@ -26,9 +26,12 @@ async function scaffoldCursorHooks(projectDir, levels = ['safety', 'quality', 's
|
|
|
26
26
|
await fs.ensureDir(cursorHooksDir);
|
|
27
27
|
await fs.ensureDir(path.join(cursorDir, 'logs'));
|
|
28
28
|
|
|
29
|
-
// Determine template directory
|
|
29
|
+
// Determine template directory - prefer bundled templates
|
|
30
30
|
const setup = detectCAWSSetup(projectDir);
|
|
31
|
-
const
|
|
31
|
+
const bundledTemplateDir = path.join(__dirname, '../../templates');
|
|
32
|
+
const templateDir = fs.existsSync(bundledTemplateDir)
|
|
33
|
+
? bundledTemplateDir
|
|
34
|
+
: setup.templateDir || path.resolve(__dirname, '../templates');
|
|
32
35
|
|
|
33
36
|
const cursorTemplateDir = path.join(templateDir, '.cursor');
|
|
34
37
|
const cursorHooksTemplateDir = path.join(cursorTemplateDir, 'hooks');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scaffold/index.js"],"names":[],"mappings":"AAkKA;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scaffold/index.js"],"names":[],"mappings":"AAkKA;;;GAGG;AACH,6DA6TC;AAhdD;;;;GAIG;AACH,mDAHW,MAAM;;;GA8HhB;AAMD;;;GAGG;AACH,yDAGC"}
|
package/dist/scaffold/index.js
CHANGED
|
@@ -193,9 +193,13 @@ async function scaffoldProject(options) {
|
|
|
193
193
|
} else if (!setup.templateDir) {
|
|
194
194
|
// Try to find template directory using absolute paths that work in CI
|
|
195
195
|
const possiblePaths = [
|
|
196
|
+
// 1. Bundled templates in CLI package (for global installs) - CHECK THIS FIRST!
|
|
197
|
+
path.join(__dirname, '../../templates'),
|
|
198
|
+
// 2. CI paths
|
|
196
199
|
'/home/runner/work/coding-agent-working-standard/coding-agent-working-standard/packages/caws-template',
|
|
197
200
|
'/workspace/packages/caws-template',
|
|
198
201
|
'/caws/packages/caws-template',
|
|
202
|
+
// 3. Monorepo relative paths
|
|
199
203
|
path.resolve(process.cwd(), '../../../packages/caws-template'),
|
|
200
204
|
path.resolve(process.cwd(), '../../packages/caws-template'),
|
|
201
205
|
path.resolve(process.cwd(), '../packages/caws-template'),
|