@pulse-editor/cli 0.1.0-beta.4 → 0.1.0-beta.6
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.
|
@@ -46,9 +46,15 @@ export default function Create({ cli }) {
|
|
|
46
46
|
}, [cli]);
|
|
47
47
|
useEffect(() => {
|
|
48
48
|
if (framework) {
|
|
49
|
-
|
|
49
|
+
const name = cli.flags.name;
|
|
50
|
+
if (name) {
|
|
51
|
+
setProjectName(name);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
setIsShowProjectNameInput(true);
|
|
55
|
+
}
|
|
50
56
|
}
|
|
51
|
-
}, [framework]);
|
|
57
|
+
}, [framework, cli]);
|
|
52
58
|
useEffect(() => {
|
|
53
59
|
if (projectName) {
|
|
54
60
|
// Check if the project already exists
|
|
@@ -60,9 +66,15 @@ export default function Create({ cli }) {
|
|
|
60
66
|
}, 0);
|
|
61
67
|
return;
|
|
62
68
|
}
|
|
63
|
-
|
|
69
|
+
const visibility = cli.flags.visibility;
|
|
70
|
+
if (visibility) {
|
|
71
|
+
setVisibility(visibility);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
setIsShowVisibilitySelect(true);
|
|
75
|
+
}
|
|
64
76
|
}
|
|
65
|
-
}, [projectName]);
|
|
77
|
+
}, [projectName, cli]);
|
|
66
78
|
useEffect(() => {
|
|
67
79
|
if (visibility && projectName) {
|
|
68
80
|
createFromTemplate(projectName, visibility);
|
|
@@ -113,7 +125,7 @@ export default function Create({ cli }) {
|
|
|
113
125
|
});
|
|
114
126
|
}
|
|
115
127
|
catch (error) {
|
|
116
|
-
setCreateMessage(
|
|
128
|
+
setCreateMessage(_jsxs(Text, { color: "redBright", children: ["\u274C Failed to install dependencies. Please check your internet connection and try again. ", error.message] }));
|
|
117
129
|
return;
|
|
118
130
|
}
|
|
119
131
|
setCreateMessage(_jsx(Text, { children: "\uD83D\uDE80 Pulse Editor React app project created successfully!" }));
|
|
@@ -45,14 +45,24 @@ export default function Publish({ cli }) {
|
|
|
45
45
|
// Build the extension
|
|
46
46
|
useEffect(() => {
|
|
47
47
|
async function buildExtension() {
|
|
48
|
+
setIsBuilding(true);
|
|
48
49
|
try {
|
|
49
|
-
setIsBuilding(true);
|
|
50
50
|
await $ `npm run build`;
|
|
51
|
-
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
setIsBuildingError(true);
|
|
54
|
+
setIsBuilding(false);
|
|
55
|
+
setFailureMessage('Build failed. Please run `npm run build` to see the error.');
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
// Zip the dist folder
|
|
59
|
+
try {
|
|
52
60
|
await $({ cwd: 'dist' }) `zip -r ../node_modules/@pulse-editor/dist.zip *`;
|
|
53
61
|
}
|
|
54
62
|
catch (error) {
|
|
55
63
|
setIsBuildingError(true);
|
|
64
|
+
setIsBuilding(false);
|
|
65
|
+
setFailureMessage('Failed to zip the build output.');
|
|
56
66
|
return;
|
|
57
67
|
}
|
|
58
68
|
finally {
|
package/dist/lib/cli-flags.d.ts
CHANGED
package/dist/lib/cli-flags.js
CHANGED
package/dist/lib/manual.js
CHANGED
|
@@ -33,6 +33,11 @@ const create = `\
|
|
|
33
33
|
The framework to use for the new app.
|
|
34
34
|
Currently available options: react.
|
|
35
35
|
Future options: vue, angular, etc.
|
|
36
|
+
--name, -n [project-name]
|
|
37
|
+
The name of the new project.
|
|
38
|
+
--visibility, -v [visibility]
|
|
39
|
+
The visibility of the new project. Options are private,
|
|
40
|
+
public, and unlisted.
|
|
36
41
|
`;
|
|
37
42
|
export const commandsManual = {
|
|
38
43
|
help,
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pulse-editor/cli",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"bin": {
|
|
6
|
-
"pulse": "
|
|
6
|
+
"pulse": "dist/cli.js"
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
9
|
"engines": {
|
|
@@ -60,4 +60,4 @@
|
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
"prettier": "@vdemedes/prettier-config"
|
|
63
|
-
}
|
|
63
|
+
}
|