create-zephyr-apps 0.0.3 → 0.0.5
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 +57 -62
- package/dist/index.mjs +57 -62
- package/package/index.ts +1 -2
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -176,71 +176,66 @@ 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
|
-
console.error(error);
|
|
199
|
-
process.exit(2);
|
|
200
|
-
} finally{
|
|
201
|
-
await external_node_fs_namespaceObject.promises.rm(temp_dir, {
|
|
202
|
-
recursive: true,
|
|
203
|
-
force: true
|
|
204
|
-
});
|
|
205
|
-
end_note({
|
|
206
|
-
project
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
if ('react-native' === project.type) {
|
|
213
|
-
s.start(external_chalk_default().cyan("Cloning repository https://github.com/ZephyrCloudIO/zephyr-repack-example.git"));
|
|
214
|
-
(0, external_node_child_process_namespaceObject.exec)(command_react_native, async (err, stdout, stderr)=>{
|
|
215
|
-
if (err) {
|
|
216
|
-
s.stop(external_chalk_default().bgRed(external_chalk_default().black(`Error cloning to ${project_path}...`)));
|
|
217
|
-
console.error(err);
|
|
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);
|
|
218
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
|
+
});
|
|
219
207
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
if ('react-native' === project.type) (0, external_node_child_process_namespaceObject.exec)(command_react_native, async (err, stdout, stderr)=>{
|
|
211
|
+
if (err) {
|
|
212
|
+
s.stop(external_chalk_default().bgRed(external_chalk_default().black(`Error cloning to ${project_path}...`)));
|
|
213
|
+
console.error(err);
|
|
214
|
+
process.exit(2);
|
|
215
|
+
}
|
|
216
|
+
if (!err) {
|
|
217
|
+
const outputPath = external_path_default().join(process.cwd(), project.path);
|
|
218
|
+
try {
|
|
219
|
+
await external_node_fs_namespaceObject.promises.cp(temp_dir, outputPath, {
|
|
220
|
+
recursive: true,
|
|
221
|
+
force: true
|
|
222
|
+
});
|
|
223
|
+
s.stop(external_chalk_default().green(`Project successfully created at ${external_chalk_default().underline(project_path)}`));
|
|
224
|
+
} catch (error) {
|
|
225
|
+
s.stop(external_chalk_default().bgRed(external_chalk_default().black(`Error clonin to ${project_path}`)));
|
|
226
|
+
console.error(error);
|
|
227
|
+
process.exit(2);
|
|
228
|
+
} finally{
|
|
229
|
+
await external_node_fs_namespaceObject.promises.rm(temp_dir, {
|
|
230
|
+
recursive: true,
|
|
231
|
+
force: true
|
|
232
|
+
});
|
|
233
|
+
end_note({
|
|
234
|
+
project
|
|
235
|
+
});
|
|
241
236
|
}
|
|
242
|
-
}
|
|
243
|
-
}
|
|
237
|
+
}
|
|
238
|
+
});
|
|
244
239
|
}
|
|
245
240
|
main().catch(console.error);
|
|
246
241
|
var __webpack_export_target__ = exports;
|
package/dist/index.mjs
CHANGED
|
@@ -145,70 +145,65 @@ 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
|
-
console.error(error);
|
|
168
|
-
process.exit(2);
|
|
169
|
-
} finally{
|
|
170
|
-
await __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.promises.rm(temp_dir, {
|
|
171
|
-
recursive: true,
|
|
172
|
-
force: true
|
|
173
|
-
});
|
|
174
|
-
end_note({
|
|
175
|
-
project
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
if ('react-native' === project.type) {
|
|
182
|
-
s.start(__WEBPACK_EXTERNAL_MODULE_chalk__["default"].cyan("Cloning repository https://github.com/ZephyrCloudIO/zephyr-repack-example.git"));
|
|
183
|
-
(0, __WEBPACK_EXTERNAL_MODULE_node_child_process_27f17141__.exec)(command_react_native, async (err, stdout, stderr)=>{
|
|
184
|
-
if (err) {
|
|
185
|
-
s.stop(__WEBPACK_EXTERNAL_MODULE_chalk__["default"].bgRed(__WEBPACK_EXTERNAL_MODULE_chalk__["default"].black(`Error cloning to ${project_path}...`)));
|
|
186
|
-
console.error(err);
|
|
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);
|
|
187
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
|
+
});
|
|
188
176
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
if ('react-native' === project.type) (0, __WEBPACK_EXTERNAL_MODULE_node_child_process_27f17141__.exec)(command_react_native, async (err, stdout, stderr)=>{
|
|
180
|
+
if (err) {
|
|
181
|
+
s.stop(__WEBPACK_EXTERNAL_MODULE_chalk__["default"].bgRed(__WEBPACK_EXTERNAL_MODULE_chalk__["default"].black(`Error cloning to ${project_path}...`)));
|
|
182
|
+
console.error(err);
|
|
183
|
+
process.exit(2);
|
|
184
|
+
}
|
|
185
|
+
if (!err) {
|
|
186
|
+
const outputPath = __WEBPACK_EXTERNAL_MODULE_path__["default"].join(process.cwd(), project.path);
|
|
187
|
+
try {
|
|
188
|
+
await __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.promises.cp(temp_dir, outputPath, {
|
|
189
|
+
recursive: true,
|
|
190
|
+
force: true
|
|
191
|
+
});
|
|
192
|
+
s.stop(__WEBPACK_EXTERNAL_MODULE_chalk__["default"].green(`Project successfully created at ${__WEBPACK_EXTERNAL_MODULE_chalk__["default"].underline(project_path)}`));
|
|
193
|
+
} catch (error) {
|
|
194
|
+
s.stop(__WEBPACK_EXTERNAL_MODULE_chalk__["default"].bgRed(__WEBPACK_EXTERNAL_MODULE_chalk__["default"].black(`Error clonin to ${project_path}`)));
|
|
195
|
+
console.error(error);
|
|
196
|
+
process.exit(2);
|
|
197
|
+
} finally{
|
|
198
|
+
await __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.promises.rm(temp_dir, {
|
|
199
|
+
recursive: true,
|
|
200
|
+
force: true
|
|
201
|
+
});
|
|
202
|
+
end_note({
|
|
203
|
+
project
|
|
204
|
+
});
|
|
210
205
|
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
206
|
+
}
|
|
207
|
+
});
|
|
213
208
|
}
|
|
214
209
|
main().catch(console.error);
|
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
|
|
|
@@ -153,7 +153,6 @@ async function main() {
|
|
|
153
153
|
|
|
154
154
|
if (project.type === 'react-native') {
|
|
155
155
|
|
|
156
|
-
s.start(c.cyan(`Cloning repository https://github.com/ZephyrCloudIO/zephyr-repack-example.git`))
|
|
157
156
|
|
|
158
157
|
exec(command_react_native, async (err, stdout, stderr) => {
|
|
159
158
|
if (err) {
|
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.5",
|
|
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,4 +46,4 @@
|
|
|
46
46
|
"example",
|
|
47
47
|
"template"
|
|
48
48
|
]
|
|
49
|
-
}
|
|
49
|
+
}
|