whiteport-design-studio 0.2.2 → 0.2.3
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/package.json +1 -1
- package/tools/cli/lib/installer.js +17 -39
- package/tools/cli/lib/ui.js +11 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "whiteport-design-studio",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.3",
|
|
5
5
|
"description": "Whiteport Design Studio - Strategic design methodology for AI-powered workflows",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"design",
|
|
@@ -25,7 +25,7 @@ class Installer {
|
|
|
25
25
|
* @param {Object} config - Configuration from UI prompts
|
|
26
26
|
*/
|
|
27
27
|
async install(config) {
|
|
28
|
-
const { projectDir, wdsFolder, ides, project_type, design_experience } = config;
|
|
28
|
+
const { projectDir, wdsFolder, ides, project_type, design_experience, root_folder } = config;
|
|
29
29
|
const wdsDir = path.join(projectDir, wdsFolder);
|
|
30
30
|
|
|
31
31
|
// Check if already installed
|
|
@@ -101,24 +101,22 @@ class Installer {
|
|
|
101
101
|
throw error;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
// Step 4: Create
|
|
105
|
-
const
|
|
106
|
-
|
|
104
|
+
// Step 4: Create work products folder structure
|
|
105
|
+
const rootFolder = root_folder || 'design-process';
|
|
106
|
+
const docsSpinner = ora(`Creating project folders in ${rootFolder}/...`).start();
|
|
107
107
|
try {
|
|
108
|
-
|
|
109
|
-
docsSpinner.succeed(`Project folders created in ${
|
|
108
|
+
await this.createDocsFolders(projectDir, rootFolder, config);
|
|
109
|
+
docsSpinner.succeed(`Project folders created in ${rootFolder}/`);
|
|
110
110
|
} catch (error) {
|
|
111
111
|
docsSpinner.fail('Failed to create project folders');
|
|
112
112
|
throw error;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
// Update config.yaml with
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
await fs.writeFile(configPath, configContent, 'utf8');
|
|
121
|
-
}
|
|
115
|
+
// Update config.yaml with root folder
|
|
116
|
+
const configPath = path.join(wdsDir, 'config.yaml');
|
|
117
|
+
let configContent = await fs.readFile(configPath, 'utf8');
|
|
118
|
+
configContent = configContent.replace(/output_folder:\s*docs/, `output_folder: ${rootFolder}`);
|
|
119
|
+
await fs.writeFile(configPath, configContent, 'utf8');
|
|
122
120
|
|
|
123
121
|
// Step 5: Set up IDEs
|
|
124
122
|
const ideList = ides || (config.ide ? [config.ide] : []);
|
|
@@ -242,30 +240,13 @@ class Installer {
|
|
|
242
240
|
}
|
|
243
241
|
|
|
244
242
|
/**
|
|
245
|
-
* Create the WDS
|
|
246
|
-
*
|
|
243
|
+
* Create the WDS work products folder structure
|
|
244
|
+
* @param {string} projectDir - Project root directory
|
|
245
|
+
* @param {string} rootFolder - Root folder name (design-process, docs, deliverables, etc.)
|
|
246
|
+
* @param {Object} config - Configuration object
|
|
247
247
|
*/
|
|
248
|
-
async createDocsFolders(projectDir, config) {
|
|
249
|
-
|
|
250
|
-
const possibleFolders = ['design-process', 'docs', 'deliverables', 'wds-deliverables'];
|
|
251
|
-
let existingFolder = null;
|
|
252
|
-
|
|
253
|
-
for (const folderName of possibleFolders) {
|
|
254
|
-
const folderPath = path.join(projectDir, folderName);
|
|
255
|
-
if (await fs.pathExists(folderPath)) {
|
|
256
|
-
// Check if it has WDS structure (A-Product-Brief, B-Trigger-Map, etc.)
|
|
257
|
-
const hasProductBrief = await fs.pathExists(path.join(folderPath, 'A-Product-Brief'));
|
|
258
|
-
const hasTriggerMap = await fs.pathExists(path.join(folderPath, 'B-Trigger-Map'));
|
|
259
|
-
if (hasProductBrief || hasTriggerMap) {
|
|
260
|
-
existingFolder = folderName;
|
|
261
|
-
break;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
// Use existing folder if found, otherwise default to 'docs'
|
|
267
|
-
const outputFolder = existingFolder || 'docs';
|
|
268
|
-
const docsPath = path.join(projectDir, outputFolder);
|
|
248
|
+
async createDocsFolders(projectDir, rootFolder, config) {
|
|
249
|
+
const docsPath = path.join(projectDir, rootFolder);
|
|
269
250
|
|
|
270
251
|
const folders = [
|
|
271
252
|
'A-Product-Brief',
|
|
@@ -296,9 +277,6 @@ class Installer {
|
|
|
296
277
|
|
|
297
278
|
// Create 00 guide files in each folder (if they don't exist)
|
|
298
279
|
await this.createFolderGuides(docsPath, config);
|
|
299
|
-
|
|
300
|
-
// Return the detected/used folder name so config.yaml can be updated
|
|
301
|
-
return outputFolder;
|
|
302
280
|
}
|
|
303
281
|
|
|
304
282
|
/**
|
package/tools/cli/lib/ui.js
CHANGED
|
@@ -78,6 +78,17 @@ class UI {
|
|
|
78
78
|
],
|
|
79
79
|
default: 'intermediate',
|
|
80
80
|
},
|
|
81
|
+
{
|
|
82
|
+
type: 'list',
|
|
83
|
+
name: 'root_folder',
|
|
84
|
+
message: 'Where should design work products be stored?',
|
|
85
|
+
choices: [
|
|
86
|
+
{ name: 'design-process/ - Recommended for clarity', value: 'design-process' },
|
|
87
|
+
{ name: 'docs/ - Standard documentation folder', value: 'docs' },
|
|
88
|
+
{ name: 'deliverables/ - Alternative naming', value: 'deliverables' },
|
|
89
|
+
],
|
|
90
|
+
default: 'design-process',
|
|
91
|
+
},
|
|
81
92
|
{
|
|
82
93
|
type: 'confirm',
|
|
83
94
|
name: 'include_learning',
|