create-zephyr-apps 0.0.2 → 0.0.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.
- package/dist/index.cjs +31 -33
- package/dist/index.mjs +31 -33
- package/dist/package/utils/end.d.ts +1 -1
- package/package/index.ts +1 -1
- package/package.json +3 -4
package/dist/index.cjs
CHANGED
|
@@ -41,7 +41,7 @@ function end_note({ project }) {
|
|
|
41
41
|
const user_name = stdout.toString().trim();
|
|
42
42
|
const repo_name = project.path.split('/').pop();
|
|
43
43
|
let next_steps;
|
|
44
|
-
next_steps = 'web' === project.type ? `cd ${repo_name} \npnpm install\ngit remote add origin https://github.com/${user_name ?? 'YourUsername'}/${repo_name}.git\npnpm run build` : `cd ${repo_name} \npnpm install\nrm -rf .git\ngit remote set origin https://github.com/${user_name
|
|
44
|
+
next_steps = 'web' === project.type ? `cd ${repo_name} \npnpm install\ngit remote add origin https://github.com/${user_name ?? 'YourUsername'}/${repo_name}.git\npnpm run build` : `cd ${repo_name} \npnpm install\nrm -rf .git\ngit remote set origin https://github.com/${user_name.length >= 1 ? user_name : 'YourUsername'}/${repo_name}.git\npnpm run build`;
|
|
45
45
|
(0, prompts_namespaceObject.note)(next_steps, 'Next steps.');
|
|
46
46
|
});
|
|
47
47
|
} catch (error) {
|
|
@@ -176,39 +176,37 @@ async function main() {
|
|
|
176
176
|
const command_react_native = `git clone --depth 1 https://github.com/ZephyrCloudIO/zephyr-repack-example.git -b main ${temp_dir}`;
|
|
177
177
|
const project_path = project.path.replace('./', '').trim();
|
|
178
178
|
const s = (0, prompts_namespaceObject.spinner)();
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
});
|
|
208
|
-
}
|
|
179
|
+
s.start(external_chalk_default().cyan(`Creating project in ${project_path}`));
|
|
180
|
+
if ('web' === project.type) (0, external_node_child_process_namespaceObject.exec)(command_web, async (err, stdout, stderr)=>{
|
|
181
|
+
if (err) {
|
|
182
|
+
s.stop(external_chalk_default().bgRed(external_chalk_default().black(`Error cloning ${command_web} to ${project_path}...`)));
|
|
183
|
+
console.error(err);
|
|
184
|
+
process.exit(0);
|
|
185
|
+
}
|
|
186
|
+
if (!err) {
|
|
187
|
+
const outputPath = external_path_default().join(process.cwd(), project.path);
|
|
188
|
+
const clonedPath = external_path_default().join(temp_dir, 'examples', project.templates);
|
|
189
|
+
try {
|
|
190
|
+
await external_node_fs_namespaceObject.promises.cp(clonedPath, outputPath, {
|
|
191
|
+
recursive: true,
|
|
192
|
+
force: true
|
|
193
|
+
});
|
|
194
|
+
s.stop(external_chalk_default().green(`Project successfully created at ${external_chalk_default().underline(project_path)}`));
|
|
195
|
+
} catch (error) {
|
|
196
|
+
console.error(external_chalk_default().bgRed(external_chalk_default().black(`Error cloning to ${project_path}...`)));
|
|
197
|
+
console.error(error);
|
|
198
|
+
process.exit(2);
|
|
199
|
+
} finally{
|
|
200
|
+
await external_node_fs_namespaceObject.promises.rm(temp_dir, {
|
|
201
|
+
recursive: true,
|
|
202
|
+
force: true
|
|
203
|
+
});
|
|
204
|
+
end_note({
|
|
205
|
+
project
|
|
206
|
+
});
|
|
209
207
|
}
|
|
210
|
-
}
|
|
211
|
-
}
|
|
208
|
+
}
|
|
209
|
+
});
|
|
212
210
|
if ('react-native' === project.type) {
|
|
213
211
|
s.start(external_chalk_default().cyan("Cloning repository https://github.com/ZephyrCloudIO/zephyr-repack-example.git"));
|
|
214
212
|
(0, external_node_child_process_namespaceObject.exec)(command_react_native, async (err, stdout, stderr)=>{
|
package/dist/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@ function end_note({ project }) {
|
|
|
14
14
|
const user_name = stdout.toString().trim();
|
|
15
15
|
const repo_name = project.path.split('/').pop();
|
|
16
16
|
let next_steps;
|
|
17
|
-
next_steps = 'web' === project.type ? `cd ${repo_name} \npnpm install\ngit remote add origin https://github.com/${user_name ?? 'YourUsername'}/${repo_name}.git\npnpm run build` : `cd ${repo_name} \npnpm install\nrm -rf .git\ngit remote set origin https://github.com/${user_name
|
|
17
|
+
next_steps = 'web' === project.type ? `cd ${repo_name} \npnpm install\ngit remote add origin https://github.com/${user_name ?? 'YourUsername'}/${repo_name}.git\npnpm run build` : `cd ${repo_name} \npnpm install\nrm -rf .git\ngit remote set origin https://github.com/${user_name.length >= 1 ? user_name : 'YourUsername'}/${repo_name}.git\npnpm run build`;
|
|
18
18
|
(0, __WEBPACK_EXTERNAL_MODULE__clack_prompts_3cae1695__.note)(next_steps, 'Next steps.');
|
|
19
19
|
});
|
|
20
20
|
} catch (error) {
|
|
@@ -145,39 +145,37 @@ async function main() {
|
|
|
145
145
|
const command_react_native = `git clone --depth 1 https://github.com/ZephyrCloudIO/zephyr-repack-example.git -b main ${temp_dir}`;
|
|
146
146
|
const project_path = project.path.replace('./', '').trim();
|
|
147
147
|
const s = (0, __WEBPACK_EXTERNAL_MODULE__clack_prompts_3cae1695__.spinner)();
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
});
|
|
177
|
-
}
|
|
148
|
+
s.start(__WEBPACK_EXTERNAL_MODULE_chalk__["default"].cyan(`Creating project in ${project_path}`));
|
|
149
|
+
if ('web' === project.type) (0, __WEBPACK_EXTERNAL_MODULE_node_child_process_27f17141__.exec)(command_web, async (err, stdout, stderr)=>{
|
|
150
|
+
if (err) {
|
|
151
|
+
s.stop(__WEBPACK_EXTERNAL_MODULE_chalk__["default"].bgRed(__WEBPACK_EXTERNAL_MODULE_chalk__["default"].black(`Error cloning ${command_web} to ${project_path}...`)));
|
|
152
|
+
console.error(err);
|
|
153
|
+
process.exit(0);
|
|
154
|
+
}
|
|
155
|
+
if (!err) {
|
|
156
|
+
const outputPath = __WEBPACK_EXTERNAL_MODULE_path__["default"].join(process.cwd(), project.path);
|
|
157
|
+
const clonedPath = __WEBPACK_EXTERNAL_MODULE_path__["default"].join(temp_dir, 'examples', project.templates);
|
|
158
|
+
try {
|
|
159
|
+
await __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.promises.cp(clonedPath, outputPath, {
|
|
160
|
+
recursive: true,
|
|
161
|
+
force: true
|
|
162
|
+
});
|
|
163
|
+
s.stop(__WEBPACK_EXTERNAL_MODULE_chalk__["default"].green(`Project successfully created at ${__WEBPACK_EXTERNAL_MODULE_chalk__["default"].underline(project_path)}`));
|
|
164
|
+
} catch (error) {
|
|
165
|
+
console.error(__WEBPACK_EXTERNAL_MODULE_chalk__["default"].bgRed(__WEBPACK_EXTERNAL_MODULE_chalk__["default"].black(`Error cloning to ${project_path}...`)));
|
|
166
|
+
console.error(error);
|
|
167
|
+
process.exit(2);
|
|
168
|
+
} finally{
|
|
169
|
+
await __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.promises.rm(temp_dir, {
|
|
170
|
+
recursive: true,
|
|
171
|
+
force: true
|
|
172
|
+
});
|
|
173
|
+
end_note({
|
|
174
|
+
project
|
|
175
|
+
});
|
|
178
176
|
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
177
|
+
}
|
|
178
|
+
});
|
|
181
179
|
if ('react-native' === project.type) {
|
|
182
180
|
s.start(__WEBPACK_EXTERNAL_MODULE_chalk__["default"].cyan("Cloning repository https://github.com/ZephyrCloudIO/zephyr-repack-example.git"));
|
|
183
181
|
(0, __WEBPACK_EXTERNAL_MODULE_node_child_process_27f17141__.exec)(command_react_native, async (err, stdout, stderr)=>{
|
package/package/index.ts
CHANGED
|
@@ -111,9 +111,9 @@ async function main() {
|
|
|
111
111
|
const project_path = project.path.replace('./', '').trim()
|
|
112
112
|
|
|
113
113
|
const s = spinner()
|
|
114
|
+
s.start(c.cyan(`Creating project in ${project_path}`))
|
|
114
115
|
if (project.type === 'web') {
|
|
115
116
|
|
|
116
|
-
s.start(c.cyan('Cloning subfolder ' + c.green(project.templates) + ' from repository https://github.com/ZephyrCloudIO/zephyr-examples.git'))
|
|
117
117
|
|
|
118
118
|
exec(command_web, async (err, stdout, stderr) => {
|
|
119
119
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-zephyr-apps",
|
|
3
3
|
"module": "./src/index.ts",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "rslib build",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"url": "https://github.com/ZephyrCloudIO"
|
|
13
13
|
},
|
|
14
14
|
"bin": {
|
|
15
|
-
"create-zephyr-apps": "
|
|
15
|
+
"create-zephyr-apps": "dist/index.mjs"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@clack/core": "^0.4.1",
|
|
@@ -46,5 +46,4 @@
|
|
|
46
46
|
"example",
|
|
47
47
|
"template"
|
|
48
48
|
]
|
|
49
|
-
}
|
|
50
|
-
|
|
49
|
+
}
|