@next2d/builder 0.0.21 → 0.0.23

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.
Files changed (3) hide show
  1. package/README.md +12 -12
  2. package/dist/index.js +92 -3
  3. package/package.json +10 -10
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Multi-platform Builder
2
2
  =============
3
3
 
4
- [![CodeQL](https://github.com/Next2D/builder/actions/workflows/codeql-analysis.yml/badge.svg?branch=main)](https://github.com/Next2D/builder/actions/workflows/codeql-analysis.yml)
4
+ [![CodeQL](https://github.com/Next2D/builder/actions/workflows/github-code-scanning/codeql/badge.svg?branch=main)](https://github.com/Next2D/builder/actions/workflows/github-code-scanning/codeql)
5
5
  [![Lint](https://github.com/Next2D/builder/actions/workflows/lint.yml/badge.svg?branch=main)](https://github.com/Next2D/builder/actions/workflows/lint.yml)
6
6
  [![release](https://img.shields.io/github/v/release/Next2D/builder)](https://github.com/Next2D/builder/releases)
7
7
  [![license](https://img.shields.io/github/license/Next2D/builder)](https://github.com/Next2D/builder/blob/main/LICENSE)
@@ -28,22 +28,22 @@ With Next2D Framework, you can efficiently develop and deploy applications optim
28
28
 
29
29
  ## Supported
30
30
 
31
- | platform | detail |
32
- |-----------------|--------------------------|
33
- | Windows | Export an exe file |
34
- | macOS | Export dmg, app file |
35
- | Linux | Export deb file |
36
- | Steam:Windows | Export an exe file |
37
- | Steam:macOS | Export dmg, app file |
38
- | Steam:Linux | Export deb file |
39
- | web | Export minfy'd JS files |
31
+ | platform | detail |
32
+ |-----------------|-------------------------------------|
33
+ | Windows | Export an exe file |
34
+ | macOS | Export dmg, app file |
35
+ | Linux | Export deb file |
36
+ | Steam:Windows | Export an exe file |
37
+ | Steam:macOS | Export dmg, app file |
38
+ | Steam:Linux | Export deb file |
39
+ | web | Export minfy'd JS files |
40
+ | iOS | open Xcode, and Export ipa |
41
+ | iOS | open Android Studio, and Export apk |
40
42
 
41
43
  ### Scheduled introduction
42
44
 
43
45
  | platform |
44
46
  |-----------------|
45
- | iOS |
46
- | Android |
47
47
  | Nintendo Switch |
48
48
 
49
49
  ### build example.
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import fs from "fs";
5
5
  import cp from "child_process";
6
6
  import { loadConfigFromFile } from "vite";
7
7
  import { api } from "@electron-forge/core";
8
- const recommendeVersion = 18;
8
+ const recommendeVersion = 22;
9
9
  const version = process.versions.node;
10
10
  if (recommendeVersion > parseInt(version.split(".")[0])) {
11
11
  pc.red(`You are running Node Version:${version}.
@@ -17,11 +17,19 @@ let platform = "";
17
17
  let environment = "";
18
18
  let hasHelp = false;
19
19
  let preview = false;
20
+ let open = false;
21
+ let build = false;
20
22
  for (let idx = 0; idx < process.argv.length; ++idx) {
21
23
  switch (process.argv[idx]) {
22
24
  case "--preview":
23
25
  preview = true;
24
26
  break;
27
+ case "--open":
28
+ open = true;
29
+ break;
30
+ case "--build":
31
+ build = true;
32
+ break;
25
33
  case "--help":
26
34
  case "--h":
27
35
  hasHelp = true;
@@ -358,6 +366,74 @@ const runNative = async () => {
358
366
  platform
359
367
  ], { "stdio": "inherit" });
360
368
  };
369
+ /**
370
+ * @description iOS/Androidアプリのオープン関数
371
+ * Open function for iOS/Android apps
372
+ *
373
+ * @return {Promise}
374
+ * @method
375
+ * @public
376
+ */
377
+ const openNative = async () => {
378
+ await generateNativeProject();
379
+ /**
380
+ * Capacitorの書き出しに必要な設定を生成
381
+ * Generate settings necessary for exporting Capacitor
382
+ */
383
+ const config = JSON.parse(fs.readFileSync(`${process.cwd()}/${CAPACITOR_CONFIG_NAME}`, { "encoding": "utf8" }));
384
+ config.webDir = `${$outDir}/${platformDir}/${environment}/`;
385
+ fs.writeFileSync(`${process.cwd()}/${CAPACITOR_CONFIG_NAME}`, JSON.stringify(config, null, 2));
386
+ const stream = cp.spawn("npx", [
387
+ "cap",
388
+ "sync",
389
+ platform
390
+ ], { "stdio": "inherit" });
391
+ stream.on("close", (code) => {
392
+ if (code !== 0) {
393
+ console.log(pc.red(`Failed to sync ${platform} project.`));
394
+ return;
395
+ }
396
+ cp.spawn("npx", [
397
+ "cap",
398
+ "open",
399
+ platform
400
+ ], { "stdio": "inherit" });
401
+ });
402
+ };
403
+ /**
404
+ * @description iOS/Androidアプリのビルド関数
405
+ * Build function for iOS/Android apps
406
+ *
407
+ * @return {Promise}
408
+ * @method
409
+ * @public
410
+ */
411
+ const buildNative = async () => {
412
+ await generateNativeProject();
413
+ /**
414
+ * Capacitorの書き出しに必要な設定を生成
415
+ * Generate settings necessary for exporting Capacitor
416
+ */
417
+ const config = JSON.parse(fs.readFileSync(`${process.cwd()}/${CAPACITOR_CONFIG_NAME}`, { "encoding": "utf8" }));
418
+ config.webDir = `${$outDir}/${platformDir}/${environment}/`;
419
+ fs.writeFileSync(`${process.cwd()}/${CAPACITOR_CONFIG_NAME}`, JSON.stringify(config, null, 2));
420
+ const stream = cp.spawn("npx", [
421
+ "cap",
422
+ "sync",
423
+ platform
424
+ ], { "stdio": "inherit" });
425
+ stream.on("close", (code) => {
426
+ if (code !== 0) {
427
+ console.log(pc.red(`Failed to sync ${platform} project.`));
428
+ return;
429
+ }
430
+ cp.spawn("npx", [
431
+ "cap",
432
+ "build",
433
+ platform
434
+ ], { "stdio": "inherit" });
435
+ });
436
+ };
361
437
  /**
362
438
  * @description ビルドの実行関数
363
439
  * Build Execution Functions
@@ -378,10 +454,23 @@ const multiBuild = async () => {
378
454
  break;
379
455
  case "ios":
380
456
  case "android":
381
- if (preview) {
382
- await runNative();
457
+ switch (true) {
458
+ case open:
459
+ await openNative();
460
+ break;
461
+ case build:
462
+ await buildNative();
463
+ break;
464
+ case preview:
465
+ await runNative();
466
+ break;
467
+ default:
468
+ break;
383
469
  }
384
470
  break;
471
+ case "open:ios":
472
+ await openNative();
473
+ break;
385
474
  case "web":
386
475
  console.log();
387
476
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next2d/builder",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "description": "Multi-platform builder for Next2d Framework, supporting export to various platforms such as macOS, Windows, iOS, Android and Web(HTML)",
5
5
  "author": "Toshiyuki Ienaga <ienaga@next2d.app>",
6
6
  "license": "MIT",
@@ -8,7 +8,7 @@
8
8
  "types": "dist/index.d.ts",
9
9
  "type": "module",
10
10
  "homepage": "https://next2d.app",
11
- "bugs": "https://github.com/Next2D/view-generator/issues",
11
+ "bugs": "https://github.com/Next2D/builder/issues",
12
12
  "keywords": [
13
13
  "Next2D",
14
14
  "JavaScript for Linux",
@@ -35,18 +35,18 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@electron-forge/core": "^7.10.2",
38
- "@types/node": "^24.9.2",
38
+ "@types/node": "^24.10.1",
39
39
  "picocolors": "^1.1.1",
40
- "vite": "^7.1.12"
40
+ "vite": "^7.2.4"
41
41
  },
42
42
  "devDependencies": {
43
- "@eslint/eslintrc": "^3.3.1",
44
- "@eslint/js": "^9.39.0",
45
- "@typescript-eslint/eslint-plugin": "^8.46.2",
46
- "@typescript-eslint/parser": "^8.46.2",
47
- "eslint": "^9.39.0",
43
+ "@eslint/eslintrc": "^3.3.3",
44
+ "@eslint/js": "^9.39.1",
45
+ "@typescript-eslint/eslint-plugin": "^8.48.0",
46
+ "@typescript-eslint/parser": "^8.48.0",
47
+ "eslint": "^9.39.1",
48
48
  "eslint-plugin-unused-imports": "^4.3.0",
49
- "globals": "^16.4.0",
49
+ "globals": "^16.5.0",
50
50
  "typescript": "^5.9.3"
51
51
  }
52
52
  }