create-next2d-app 1.0.0 → 1.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/README.md +9 -4
- package/index.js +39 -19
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
[](https://github.com/Next2D/create-next2d-app/actions/workflows/codeql-analysis.yml)
|
|
2
|
+
[](https://github.com/Next2D/create-next2d-app/releases)
|
|
3
|
+
[](https://github.com/Next2D/create-next2d-app/blob/main/LICENSE)
|
|
4
|
+
|
|
5
|
+
|
|
1
6
|
# Create Next2D App
|
|
2
7
|
|
|
3
8
|
Create Next2D apps with no build configuration.
|
|
@@ -5,8 +10,8 @@ Create Next2D apps with no build configuration.
|
|
|
5
10
|
## Quick Start
|
|
6
11
|
|
|
7
12
|
```sh
|
|
8
|
-
npx create-next2d-app
|
|
9
|
-
cd
|
|
13
|
+
npx create-next2d-app app-test
|
|
14
|
+
cd app-test
|
|
10
15
|
npm start
|
|
11
16
|
```
|
|
12
17
|
|
|
@@ -19,12 +24,12 @@ npm start
|
|
|
19
24
|
|
|
20
25
|
* Bundles the app into static files for develop.
|
|
21
26
|
```sh
|
|
22
|
-
npm build
|
|
27
|
+
npm run build
|
|
23
28
|
```
|
|
24
29
|
|
|
25
30
|
* Bundles the app into static files for production.
|
|
26
31
|
```sh
|
|
27
|
-
npm build --env="prd"
|
|
32
|
+
npm run build -- --env="prd"
|
|
28
33
|
```
|
|
29
34
|
|
|
30
35
|
* Starts the test runner.
|
package/index.js
CHANGED
|
@@ -202,11 +202,10 @@ function checkNpmVersion ()
|
|
|
202
202
|
* @param {string} root
|
|
203
203
|
* @param {string} app_name
|
|
204
204
|
* @param {string} template
|
|
205
|
-
* @param {object} package_json
|
|
206
205
|
* @param {array} dependencies
|
|
207
206
|
* @return {Promise<unknown>}
|
|
208
207
|
*/
|
|
209
|
-
function install (root, app_name, template,
|
|
208
|
+
function install (root, app_name, template, dependencies)
|
|
210
209
|
{
|
|
211
210
|
console.log("Installing packages. This may take a few minutes.");
|
|
212
211
|
|
|
@@ -335,11 +334,11 @@ function install (root, app_name, template, package_json, dependencies)
|
|
|
335
334
|
console.log(" Starts the development server.");
|
|
336
335
|
|
|
337
336
|
console.log();
|
|
338
|
-
console.log(` ${chalk.green("npm build")}`);
|
|
337
|
+
console.log(` ${chalk.green("npm run build")}`);
|
|
339
338
|
console.log(" Bundles the app into static files for develop.");
|
|
340
339
|
|
|
341
340
|
console.log();
|
|
342
|
-
console.log(` ${chalk.green("npm build --env=\"prd\"")}`);
|
|
341
|
+
console.log(` ${chalk.green("npm run build --env=\"prd\"")}`);
|
|
343
342
|
console.log(" Bundles the app into static files for production.");
|
|
344
343
|
|
|
345
344
|
console.log();
|
|
@@ -372,21 +371,19 @@ function createApp (app_name, template = "@next2d/framework-template")
|
|
|
372
371
|
console.log(`Creating a new Next2D app in ${chalk.green(root)}.`);
|
|
373
372
|
console.log();
|
|
374
373
|
|
|
375
|
-
const packageJson = {
|
|
376
|
-
"name": appName,
|
|
377
|
-
"version": "0.1.0",
|
|
378
|
-
"private": true,
|
|
379
|
-
"scripts": {
|
|
380
|
-
"start": "gulp",
|
|
381
|
-
"build": "gulp build",
|
|
382
|
-
"test": "gulp test",
|
|
383
|
-
"lint": "gulp lint"
|
|
384
|
-
}
|
|
385
|
-
};
|
|
386
|
-
|
|
387
374
|
fs.writeFileSync(
|
|
388
375
|
path.join(root, "package.json"),
|
|
389
|
-
JSON.stringify(
|
|
376
|
+
JSON.stringify({
|
|
377
|
+
"name": appName,
|
|
378
|
+
"version": "0.1.0",
|
|
379
|
+
"private": true,
|
|
380
|
+
"scripts": {
|
|
381
|
+
"start": "webpack serve",
|
|
382
|
+
"build": "webpack --mode production",
|
|
383
|
+
"lint": "eslint src/**/*.js",
|
|
384
|
+
"test": "jest"
|
|
385
|
+
}
|
|
386
|
+
}, null, 2) + os.EOL
|
|
390
387
|
);
|
|
391
388
|
|
|
392
389
|
process.chdir(root);
|
|
@@ -406,9 +403,32 @@ function createApp (app_name, template = "@next2d/framework-template")
|
|
|
406
403
|
}
|
|
407
404
|
}
|
|
408
405
|
|
|
409
|
-
|
|
406
|
+
const ignoreList = [
|
|
407
|
+
"node_modules",
|
|
408
|
+
"coverage",
|
|
409
|
+
".DS_Store",
|
|
410
|
+
".idea",
|
|
411
|
+
"Thumbs.db",
|
|
412
|
+
"npm-debug.log*",
|
|
413
|
+
"yarn-debug.log*",
|
|
414
|
+
"yarn-error.log*",
|
|
415
|
+
"src/config/Config.js",
|
|
416
|
+
"src/Packages.js"
|
|
417
|
+
];
|
|
418
|
+
|
|
419
|
+
fs.writeFileSync(
|
|
420
|
+
path.join(root, ".gitignore"),
|
|
421
|
+
ignoreList.join(os.EOL)
|
|
422
|
+
);
|
|
423
|
+
|
|
424
|
+
install(root, appName, template, [
|
|
410
425
|
"@next2d/player",
|
|
411
|
-
"@next2d/framework"
|
|
426
|
+
"@next2d/framework",
|
|
427
|
+
"@next2d/webpack-auto-loader-plugin",
|
|
428
|
+
"@next2d/env",
|
|
429
|
+
"webpack",
|
|
430
|
+
"webpack-cli",
|
|
431
|
+
"webpack-dev-server"
|
|
412
432
|
]);
|
|
413
433
|
}
|
|
414
434
|
|