@webspatial/builder 0.1.22 → 1.0.0

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  <div align="left">
2
- <img src="../../docs/assets/logo.png" alt="WebSpatial Logo" width="400"/>
2
+ <img src="../../assets/logo.png" alt="WebSpatial Logo" width="400"/>
3
3
  </div>
4
4
  <br/>
5
5
 
@@ -10,11 +10,10 @@ The build tool transforms websites into Packaged WebSpatial Apps for debugging a
10
10
  ## Documentation
11
11
 
12
12
  For WebSpatial Builder:
13
- - [Add Build Tool for Packaged WebSpatial Apps](../../docs/en/development-guide/enabling-webspatial-in-web-projects/step-2-add-build-tool-for-packaged-webspatial-apps.md)
13
+ - [Add Build Tool for Packaged WebSpatial Apps](https://webspatial.dev/docs/development-guide/enabling-webspatial-in-web-projects/step-2-add-build-tool-for-packaged-webspatial-apps)
14
14
 
15
15
  For WebSpatial:
16
- - [Table of Contents](../../docs/en/README.md)
17
- - [Introduction](../../docs/en/introduction/README.md)
18
- - [Quick Example](../../docs/en/quick-start/README.md)
19
- - [Core Concepts](../../docs/en/core-concepts/README.md)
20
- - [Development Guide](../../docs/en/development-guide/README.md)
16
+ - [Introduction](https://webspatial.dev/docs/introduction)
17
+ - [Quick Example](https://webspatial.dev/docs/quick-example)
18
+ - [Core Concepts](https://webspatial.dev/docs/core-concepts)
19
+ - [Development Guide](https://webspatial.dev/docs/development-guide)
@@ -55,15 +55,18 @@ async function run(args) {
55
55
  If the --tryWithoutBuild=true parameter is used, it will be judged whether it is the same as the previous command.
56
56
  If it is the same, it will be defaulted as already compiled, and the compilation will be skipped and the application will be launched directly.
57
57
  */
58
- if (manifestInfo.fromNet || args['tryWithoutBuild'] === 'true') {
59
- // If this command is a new command, go through the build process; otherwise, go through the launch process
60
- if (history_1.default.checkManifest(manifestInfo.json) &&
61
- history_1.default.checkTestAppIsExist()) {
62
- console.log('Same as the previous record');
63
- await xcode_1.XcodeManager.runWithHistory();
64
- return;
65
- }
66
- }
58
+ // fixme: the cache not invalidate when npm version change
59
+ // if (manifestInfo.fromNet || args['tryWithoutBuild'] === 'true') {
60
+ // // If this command is a new command, go through the build process; otherwise, go through the launch process
61
+ // if (
62
+ // CliHistory.checkManifest(manifestInfo.json) &&
63
+ // CliHistory.checkTestAppIsExist()
64
+ // ) {
65
+ // console.log('Same as the previous record')
66
+ // await XcodeManager.runWithHistory()
67
+ // return
68
+ // }
69
+ // }
67
70
  resource_1.ResourceManager.pullPlatformModule(args['platform']);
68
71
  const icon = await doReadyProject((_a = args['project']) !== null && _a !== void 0 ? _a : 'dist', manifestInfo);
69
72
  await doXcode(args, icon, manifestInfo, true);
@@ -27,7 +27,7 @@ function configId(manifestJson, bundleId) {
27
27
  }
28
28
  function configStartUrl(manifestJson, base, manifestUrl, isNet) {
29
29
  var _a;
30
- let start_url = (_a = manifestJson.start_url) !== null && _a !== void 0 ? _a : '/index.html';
30
+ let start_url = (_a = manifestJson.start_url) !== null && _a !== void 0 ? _a : '/';
31
31
  const isStartUrl = (0, validate_1.validateURL)(start_url);
32
32
  const hasBase = base.length > 0;
33
33
  if (hasBase) {
@@ -146,7 +146,7 @@ function configMainScene(manifestJson) {
146
146
  width: 1280,
147
147
  height: 1280,
148
148
  },
149
- resizability: 'automatic',
149
+ resizability: 'nil',
150
150
  };
151
151
  if (manifestJson.xr_main_scene) {
152
152
  if (typeof manifestJson.xr_main_scene === 'object') {
@@ -160,7 +160,7 @@ function configMainScene(manifestJson) {
160
160
  : 1280;
161
161
  mainScene.resizability = resizabilities.includes(manifestJson.xr_main_scene.resizability)
162
162
  ? manifestJson.xr_main_scene.resizability
163
- : 'automatic';
163
+ : 'nil';
164
164
  manifestJson.mainScene = mainScene;
165
165
  }
166
166
  else if (typeof manifestJson.xr_main_scene === 'string') {
@@ -6,5 +6,6 @@ export declare class PWAGenerator {
6
6
  private static useDefaultManifestJson;
7
7
  static generator(args: PWAInitArgs, isDev?: boolean): Promise<ManifestInfo>;
8
8
  static validate(args: PWAInitArgs, isDev?: boolean): Promise<ManifestInfo>;
9
+ private static compareManifest;
9
10
  static config(manifestInfo: ManifestInfo, args: PWAInitArgs, isDev: boolean): void;
10
11
  }
@@ -49,6 +49,8 @@ class PWAGenerator {
49
49
  manifest = useDefault
50
50
  ? this.defaultManifestJson
51
51
  : await (0, load_1.loadJsonFromDisk)(url);
52
+ manifest =
53
+ isDev && !useDefault ? this.compareManifest(manifest) : manifest;
52
54
  this.useDefaultManifestJson = useDefault;
53
55
  }
54
56
  // check manifest.json
@@ -65,6 +67,15 @@ class PWAGenerator {
65
67
  fromNet: isNetWeb,
66
68
  };
67
69
  }
70
+ static compareManifest(manifest) {
71
+ var _a, _b, _c, _d;
72
+ manifest.name = (_a = manifest.name) !== null && _a !== void 0 ? _a : this.defaultManifestJson.name;
73
+ manifest.display = (_b = manifest.display) !== null && _b !== void 0 ? _b : this.defaultManifestJson.display;
74
+ manifest.start_url =
75
+ (_c = manifest.start_url) !== null && _c !== void 0 ? _c : this.defaultManifestJson.start_url;
76
+ manifest.scope = (_d = manifest.scope) !== null && _d !== void 0 ? _d : this.defaultManifestJson.scope;
77
+ return manifest;
78
+ }
68
79
  // generate manifest
69
80
  static config(manifestInfo, args, isDev) {
70
81
  var _a;
@@ -86,7 +97,7 @@ PWAGenerator.defaultBundleId = 'com.webspatial.test';
86
97
  PWAGenerator.defaultManifestJson = {
87
98
  name: 'WebSpatialTest',
88
99
  display: 'minimal-ui',
89
- start_url: '/index.html',
100
+ start_url: '/',
90
101
  scope: '/',
91
102
  };
92
103
  PWAGenerator.useDefaultManifestJson = false;
@@ -18,11 +18,11 @@ class XcodeManager {
18
18
  static async upload(option, appInfo) {
19
19
  if (option['u'] && option['p']) {
20
20
  // use username, password
21
- xcrun_1.default.uploadApp((0, path_1.join)(resource_1.PROJECT_EXPORT_DIRECTORY, `${appInfo.name}.ipa`), option['u'], option['p'], true);
21
+ xcrun_1.default.uploadApp('"' + (0, path_1.join)(resource_1.PROJECT_EXPORT_DIRECTORY, `${appInfo.name}.ipa`) + '"', option['u'], option['p'], true);
22
22
  }
23
23
  else if (option['k'] && option['i']) {
24
24
  // use apiKey, apiIssuer
25
- xcrun_1.default.uploadApp((0, path_1.join)(resource_1.PROJECT_EXPORT_DIRECTORY, `${appInfo.name}.ipa`), option['k'], option['i'], false);
25
+ xcrun_1.default.uploadApp('"' + (0, path_1.join)(resource_1.PROJECT_EXPORT_DIRECTORY, `${appInfo.name}.ipa`) + '"', option['k'], option['i'], false);
26
26
  }
27
27
  }
28
28
  static async runWithSimulator() {
@@ -242,7 +242,7 @@ class XcodeProject {
242
242
  // set these to bypass lint
243
243
  manifestSwift = manifestSwift.replace('SceneWidth', '1280');
244
244
  manifestSwift = manifestSwift.replace('SceneHeight', '1280');
245
- manifestSwift = manifestSwift.replace('SceneResizability', `"automatic"`);
245
+ manifestSwift = manifestSwift.replace('SceneResizability', `nil`);
246
246
  manifestSwift = manifestSwift.replace('USE_MAIN_SCENE', 'false');
247
247
  }
248
248
  fs.writeFileSync(manifestSwiftPath, manifestSwift, 'utf-8');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webspatial/builder",
3
- "version": "0.1.22",
3
+ "version": "1.0.0",
4
4
  "description": "Client CLI tool to Generate XRApp project for Apple Vision Pro",
5
5
  "type": "commonjs",
6
6
  "engines": {
@@ -40,7 +40,7 @@
40
40
  "sharp": "^0.33.5",
41
41
  "valid-url": "^1.0.9",
42
42
  "xcode": "^3.0.1",
43
- "@webspatial/platform-visionos": "^0.1.22"
43
+ "@webspatial/platform-visionos": "^1.0.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@rollup/plugin-terser": "^0.4.3",