@jakubmazanec/carson 0.1.2-20482c1 → 0.1.2-a69e5e1
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.
|
@@ -8,6 +8,14 @@ export const createProjectCommand = new Command('create project', async (args, p
|
|
|
8
8
|
let workspace = await Workspace.findAndRead(targetPath, {
|
|
9
9
|
throwIfNotFound: true
|
|
10
10
|
});
|
|
11
|
+
if (workspace.errors[0]) {
|
|
12
|
+
throw workspace.errors[0];
|
|
13
|
+
}
|
|
14
|
+
for (let project of workspace.projects){
|
|
15
|
+
if (project.errors[0]) {
|
|
16
|
+
throw project.errors[0];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
11
19
|
await program.renderElement(/*#__PURE__*/ _jsx(CreateProject, {
|
|
12
20
|
args: args,
|
|
13
21
|
workspace: workspace
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/commands/create-project/createProjectCommand.tsx"],"sourcesContent":["import {Command} from '@jakubmazanec/cli';\nimport path from 'node:path';\n\nimport {CreateProject} from './CreateProject.js';\nimport {Workspace} from '../../workspace.js';\n\nexport const createProjectCommand = new Command(\n 'create project',\n async (args, program) => {\n let targetPath = path.resolve(process.cwd(), args.options.path ?? '');\n let workspace = await Workspace.findAndRead(targetPath, {throwIfNotFound: true});\n\n await program.renderElement(<CreateProject args={args} workspace={workspace} />);\n },\n {\n description: 'Creates a new project in an existing workspace.',\n options: {\n path: {\n type: 'string',\n },\n template: {\n type: 'string',\n },\n name: {\n type: 'string',\n },\n },\n },\n);\n"],"names":["Command","path","CreateProject","Workspace","createProjectCommand","args","program","targetPath","resolve","process","cwd","options","workspace","findAndRead","throwIfNotFound","renderElement","description","type","template","name"],"mappings":";AAAA,SAAQA,OAAO,QAAO,oBAAoB;AAC1C,OAAOC,UAAU,YAAY;AAE7B,SAAQC,aAAa,QAAO,qBAAqB;AACjD,SAAQC,SAAS,QAAO,qBAAqB;AAE7C,OAAO,MAAMC,uBAAuB,IAAIJ,QACtC,kBACA,OAAOK,MAAMC;IACX,IAAIC,aAAaN,KAAKO,OAAO,CAACC,QAAQC,GAAG,IAAIL,KAAKM,OAAO,CAACV,IAAI,IAAI;IAClE,IAAIW,YAAY,MAAMT,UAAUU,WAAW,CAACN,YAAY;QAACO,iBAAiB;IAAI;IAE9E,
|
|
1
|
+
{"version":3,"sources":["../../../src/commands/create-project/createProjectCommand.tsx"],"sourcesContent":["import {Command} from '@jakubmazanec/cli';\nimport path from 'node:path';\n\nimport {CreateProject} from './CreateProject.js';\nimport {Workspace} from '../../workspace.js';\n\nexport const createProjectCommand = new Command(\n 'create project',\n async (args, program) => {\n let targetPath = path.resolve(process.cwd(), args.options.path ?? '');\n let workspace = await Workspace.findAndRead(targetPath, {throwIfNotFound: true});\n\n if (workspace.errors[0]) {\n throw workspace.errors[0];\n }\n\n for (let project of workspace.projects) {\n if (project.errors[0]) {\n throw project.errors[0];\n }\n }\n\n await program.renderElement(<CreateProject args={args} workspace={workspace} />);\n },\n {\n description: 'Creates a new project in an existing workspace.',\n options: {\n path: {\n type: 'string',\n },\n template: {\n type: 'string',\n },\n name: {\n type: 'string',\n },\n },\n },\n);\n"],"names":["Command","path","CreateProject","Workspace","createProjectCommand","args","program","targetPath","resolve","process","cwd","options","workspace","findAndRead","throwIfNotFound","errors","project","projects","renderElement","description","type","template","name"],"mappings":";AAAA,SAAQA,OAAO,QAAO,oBAAoB;AAC1C,OAAOC,UAAU,YAAY;AAE7B,SAAQC,aAAa,QAAO,qBAAqB;AACjD,SAAQC,SAAS,QAAO,qBAAqB;AAE7C,OAAO,MAAMC,uBAAuB,IAAIJ,QACtC,kBACA,OAAOK,MAAMC;IACX,IAAIC,aAAaN,KAAKO,OAAO,CAACC,QAAQC,GAAG,IAAIL,KAAKM,OAAO,CAACV,IAAI,IAAI;IAClE,IAAIW,YAAY,MAAMT,UAAUU,WAAW,CAACN,YAAY;QAACO,iBAAiB;IAAI;IAE9E,IAAIF,UAAUG,MAAM,CAAC,EAAE,EAAE;QACvB,MAAMH,UAAUG,MAAM,CAAC,EAAE;IAC3B;IAEA,KAAK,IAAIC,WAAWJ,UAAUK,QAAQ,CAAE;QACtC,IAAID,QAAQD,MAAM,CAAC,EAAE,EAAE;YACrB,MAAMC,QAAQD,MAAM,CAAC,EAAE;QACzB;IACF;IAEA,MAAMT,QAAQY,aAAa,eAAC,KAAChB;QAAcG,MAAMA;QAAMO,WAAWA;;AACpE,GACA;IACEO,aAAa;IACbR,SAAS;QACPV,MAAM;YACJmB,MAAM;QACR;QACAC,UAAU;YACRD,MAAM;QACR;QACAE,MAAM;YACJF,MAAM;QACR;IACF;AACF,GACA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jakubmazanec/carson",
|
|
3
|
-
"version": "0.1.2-
|
|
3
|
+
"version": "0.1.2-a69e5e1",
|
|
4
4
|
"description": "Tool for managing workspace and project configuration.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@jakubmazanec/args": "^1.0.0",
|
|
35
|
-
"@jakubmazanec/cli": "0.1.3-
|
|
35
|
+
"@jakubmazanec/cli": "0.1.3-a69e5e1",
|
|
36
36
|
"@jakubmazanec/error": "^2.0.0",
|
|
37
37
|
"@jakubmazanec/fs-utils": "^0.1.0",
|
|
38
38
|
"@jakubmazanec/template": "^1.0.0",
|
|
@@ -10,6 +10,16 @@ export const createProjectCommand = new Command(
|
|
|
10
10
|
let targetPath = path.resolve(process.cwd(), args.options.path ?? '');
|
|
11
11
|
let workspace = await Workspace.findAndRead(targetPath, {throwIfNotFound: true});
|
|
12
12
|
|
|
13
|
+
if (workspace.errors[0]) {
|
|
14
|
+
throw workspace.errors[0];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
for (let project of workspace.projects) {
|
|
18
|
+
if (project.errors[0]) {
|
|
19
|
+
throw project.errors[0];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
13
23
|
await program.renderElement(<CreateProject args={args} workspace={workspace} />);
|
|
14
24
|
},
|
|
15
25
|
{
|