@webspatial/builder 0.1.15 → 0.1.17
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 +15 -75
- package/dist/index.js +99 -1
- package/dist/lib/cmds/build.js +116 -1
- package/dist/lib/cmds/check.js +41 -1
- package/dist/lib/cmds/help.js +66 -1
- package/dist/lib/cmds/launch.js +14 -1
- package/dist/lib/cmds/shutdown.js +8 -1
- package/dist/lib/cmds/version.js +11 -1
- package/dist/lib/pwa/config.js +208 -1
- package/dist/lib/pwa/index.js +92 -1
- package/dist/lib/pwa/validate.js +240 -1
- package/dist/lib/resource/file.js +45 -1
- package/dist/lib/resource/imageHelper.js +37 -1
- package/dist/lib/resource/index.js +102 -1
- package/dist/lib/resource/load.js +121 -1
- package/dist/lib/types.d.ts +2 -2
- package/dist/lib/types.js +2 -1
- package/dist/lib/utils/CustomError.js +11 -1
- package/dist/lib/utils/FetchUtils-1.js +25 -1
- package/dist/lib/utils/Log.js +98 -1
- package/dist/lib/utils/fetch.js +56 -1
- package/dist/lib/utils/history.d.ts +1 -0
- package/dist/lib/utils/history.js +116 -1
- package/dist/lib/utils/messages.js +102 -1
- package/dist/lib/utils/utils.js +15 -1
- package/dist/lib/xcode/index.js +35 -1
- package/dist/lib/xcode/manifestSwiftTemplate.js +109 -1
- package/dist/lib/xcode/xcodebuild.js +119 -1
- package/dist/lib/xcode/xcodeproject.js +239 -1
- package/dist/lib/xcode/xcrun.d.ts +1 -1
- package/dist/lib/xcode/xcrun.js +433 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,80 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="left">
|
|
2
|
+
<img src="../../docs/assets/logo.png" alt="WebSpatial Logo" width="400"/>
|
|
3
|
+
</div>
|
|
4
|
+
<br/>
|
|
2
5
|
|
|
3
|
-
#
|
|
6
|
+
# WebSpatial Builder
|
|
4
7
|
|
|
5
|
-
|
|
6
|
-
Currently supporting the generation of XRApp for Apple Vision Pro.
|
|
8
|
+
The build tool transforms websites into Packaged WebSpatial Apps for debugging and distributing on spatial computing platforms.
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
Ensure that you have installed Xcode and Apple Vision Pro simulator.
|
|
10
|
-
If you wish to package an IPA file or publish it to App Store Connect, you need to register an Apple developer account in advance and confirm that you have upload permissions.
|
|
11
|
-
## **Install**
|
|
12
|
-
`pnpm i @webspatial/builder`
|
|
10
|
+
## Documentation
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
|
|
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)
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- --bundle-id=com.webspatial.test
|
|
24
|
-
- --base=/
|
|
25
|
-
- If you don't have a manifest file, CLI will use the default configuration
|
|
26
|
-
```json
|
|
27
|
-
{
|
|
28
|
-
name: 'WebSpatialTest',
|
|
29
|
-
display: 'minimal-ui',
|
|
30
|
-
start_url: '/',
|
|
31
|
-
scope: '/',
|
|
32
|
-
}
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
- The --base is the root path to the project. It will be combined with start_url in the manifest.json file to generate the final URL.
|
|
36
|
-
```
|
|
37
|
-
Example 1:
|
|
38
|
-
start_url:./a/index.html
|
|
39
|
-
--base:dist/webspatial/avp
|
|
40
|
-
final url:dist/webspatial/avp/a/index.html
|
|
41
|
-
|
|
42
|
-
Example 2:
|
|
43
|
-
start_url:https://www.domain1.com/a/index.html
|
|
44
|
-
--base:http://localhost:5173
|
|
45
|
-
final url:http://localhost:5173/a/index.html
|
|
46
|
-
|
|
47
|
-
Example 3:
|
|
48
|
-
start_url:https://www.domain1.com/a/index.html
|
|
49
|
-
--base:dist/webspatial/avp
|
|
50
|
-
final url:dist/webspatial/avp/index.html
|
|
51
|
-
```
|
|
52
|
-
- The --bundle-id is the bundle identifier of the app.
|
|
53
|
-
**For example:**
|
|
54
|
-
|
|
55
|
-
2. Package an IPA file.
|
|
56
|
-
|
|
57
|
-
`webspatial-builder build --manifest=manifest.json --project=dist --base=dist/webspatial/avp --platform=visionos --teamId=yourTeamId --bundle-id=com.webspatial.test`
|
|
58
|
-
|
|
59
|
-
- Necessary parameters
|
|
60
|
-
- --base
|
|
61
|
-
- --teamId
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
3. Publish to App Store Connect.
|
|
65
|
-
`webspatial-builder publish --manifest=manifest.json --project=dist --base=dist/webspatial/avp --platform=visionos --teamId=yourTeamId --version=projectVersion --u=yourAppleId --p=yourAppSpecificCode --bundle-id=com.webspatial.test`
|
|
66
|
-
|
|
67
|
-
- Necessary parameters
|
|
68
|
-
- --base
|
|
69
|
-
- --teamId
|
|
70
|
-
- --version
|
|
71
|
-
- --u
|
|
72
|
-
- --p
|
|
73
|
-
|
|
74
|
-
4. Launch the app in the simulator without building.
|
|
75
|
-
>When the simulator is shut down, cli will automatically launch the simulator.
|
|
76
|
-
|
|
77
|
-
`webspatial-builder launch [--bundle-id=]`
|
|
78
|
-
|
|
79
|
-
5. Shutdown the simulator.
|
|
80
|
-
`webspatial-builder shutdown`
|
|
15
|
+
For WebSpatial:
|
|
16
|
+
- [Table of Contents](../../docs/en/README.md)
|
|
17
|
+
- [Introduction](../../docs/en/introduction/README.md)
|
|
18
|
+
- [Quick Start](../../docs/en/quick-start/README.md)
|
|
19
|
+
- [Core Concepts](../../docs/en/core-concepts/README.md)
|
|
20
|
+
- [Development Guide](../../docs/en/development-guide/README.md)
|
package/dist/index.js
CHANGED
|
@@ -1 +1,99 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const commander_1 = require("commander");
|
|
4
|
+
const semver_1 = require("semver");
|
|
5
|
+
const FetchUtils_1_1 = require("./lib/utils/FetchUtils-1");
|
|
6
|
+
const build_1 = require("./lib/cmds/build");
|
|
7
|
+
const version_1 = require("./lib/cmds/version");
|
|
8
|
+
const fetch_1 = require("./lib/utils/fetch");
|
|
9
|
+
const launch_1 = require("./lib/cmds/launch");
|
|
10
|
+
const shutdown_1 = require("./lib/cmds/shutdown");
|
|
11
|
+
module.exports = async () => {
|
|
12
|
+
if ((0, semver_1.major)(process.versions.node) < 14) {
|
|
13
|
+
throw new Error(`Current Node.js version is ${process.versions.node}.` +
|
|
14
|
+
' Node.js version 14 or above is required to run XRAPP BUILDER.');
|
|
15
|
+
}
|
|
16
|
+
const program = new commander_1.Command();
|
|
17
|
+
FetchUtils_1_1.fetchUtils.setFetch(fetch_1.fetch);
|
|
18
|
+
FetchUtils_1_1.fetchUtils.setDownloadFile(fetch_1.downloadFile);
|
|
19
|
+
FetchUtils_1_1.fetchUtils.setDecompressResponseBuffer(fetch_1.decompressResponseBuffer);
|
|
20
|
+
await setupCommands(program);
|
|
21
|
+
await program.parseAsync(process.argv);
|
|
22
|
+
};
|
|
23
|
+
async function setupCommands(program) {
|
|
24
|
+
const v = await (0, version_1.getVersion)();
|
|
25
|
+
program
|
|
26
|
+
.name('webspatial-builder')
|
|
27
|
+
.description('WebSpatial Builder is a client-side CLI tool used to generate cross platform XRApp projects.')
|
|
28
|
+
.version(v, '-v, --version')
|
|
29
|
+
.configureHelp({ showGlobalOptions: true });
|
|
30
|
+
// run command
|
|
31
|
+
program
|
|
32
|
+
.command('run')
|
|
33
|
+
.description('By compiling or running directly on the simulator the WebSpatial App')
|
|
34
|
+
.option('--manifest <manifest>', 'manifest path')
|
|
35
|
+
.option('--project <project>', 'project path')
|
|
36
|
+
.option('--manifest-url <manifestUrl>', 'manifest url')
|
|
37
|
+
.option('--platform <platform>', 'xr platform')
|
|
38
|
+
.option('--base <base>', 'base path')
|
|
39
|
+
.option('--bundle-id <bundleId>', 'bundle id')
|
|
40
|
+
.option('--tryWithoutBuild <tryWithoutBuild>', 'run without build')
|
|
41
|
+
.action(async (options) => {
|
|
42
|
+
await (0, build_1.run)(options);
|
|
43
|
+
});
|
|
44
|
+
// build command
|
|
45
|
+
program
|
|
46
|
+
.command('build')
|
|
47
|
+
.description('Build WebSpatial App')
|
|
48
|
+
.option('--manifest <manifest>', 'manifest path')
|
|
49
|
+
.option('--project <project>', 'project path')
|
|
50
|
+
.option('--manifest-url <manifest-url>', 'manifest url')
|
|
51
|
+
.option('--platform <platform>', 'xr platform')
|
|
52
|
+
.option('--version <version>', 'app version')
|
|
53
|
+
.option('--buildType <buildType>', 'app build type')
|
|
54
|
+
.option('--export <export>', 'export path')
|
|
55
|
+
.option('--bundle-id <bundleId>', 'bundle id')
|
|
56
|
+
.requiredOption('--base <base>', 'base path')
|
|
57
|
+
.requiredOption('--teamId <teamId>', 'team id')
|
|
58
|
+
.action(async (options) => {
|
|
59
|
+
console.log(options);
|
|
60
|
+
await (0, build_1.build)(options);
|
|
61
|
+
});
|
|
62
|
+
// store command
|
|
63
|
+
program
|
|
64
|
+
.command('publish')
|
|
65
|
+
.description('Publish WebSpatial App')
|
|
66
|
+
.option('--manifest <manifest>', 'manifest path')
|
|
67
|
+
.option('--project <project>', 'project path')
|
|
68
|
+
.option('--manifest-url <manifestUrl>', 'manifest url')
|
|
69
|
+
.option('--platform <platform>', 'xr platform')
|
|
70
|
+
.option('--buildType <buildType>', 'app build type')
|
|
71
|
+
.option('--export <export>', 'export path')
|
|
72
|
+
.option('--bundle-id <bundleId>', 'bundle id')
|
|
73
|
+
.requiredOption('--base <base>', 'base path')
|
|
74
|
+
.requiredOption('--teamId <teamId>', 'team id')
|
|
75
|
+
.requiredOption('--version <version>', 'app version')
|
|
76
|
+
.requiredOption('--u <username>', 'username')
|
|
77
|
+
.requiredOption('--p <password>', 'password')
|
|
78
|
+
.action(async (options) => {
|
|
79
|
+
console.log(options);
|
|
80
|
+
await (0, build_1.store)(options);
|
|
81
|
+
});
|
|
82
|
+
// launch command
|
|
83
|
+
program
|
|
84
|
+
.command('launch')
|
|
85
|
+
.description('Launch WebSpatial App')
|
|
86
|
+
.option('--bundle-id <bundleId>', 'bundle id')
|
|
87
|
+
.action(async (options) => {
|
|
88
|
+
console.log(options);
|
|
89
|
+
await (0, launch_1.launch)(options);
|
|
90
|
+
});
|
|
91
|
+
// shutdown command
|
|
92
|
+
program
|
|
93
|
+
.command('shutdown')
|
|
94
|
+
.description('Shutdown Simulator')
|
|
95
|
+
.action(async (options) => {
|
|
96
|
+
console.log(options);
|
|
97
|
+
await (0, shutdown_1.shutdown)(options);
|
|
98
|
+
});
|
|
99
|
+
}
|
package/dist/lib/cmds/build.js
CHANGED
|
@@ -1 +1,116 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.build = build;
|
|
4
|
+
exports.store = store;
|
|
5
|
+
exports.run = run;
|
|
6
|
+
const pwa_1 = require("../pwa");
|
|
7
|
+
const resource_1 = require("../resource");
|
|
8
|
+
const xcode_1 = require("../xcode");
|
|
9
|
+
const check_1 = require("./check");
|
|
10
|
+
const history_1 = require("../utils/history");
|
|
11
|
+
// build and export ipa
|
|
12
|
+
async function build(args) {
|
|
13
|
+
var _a;
|
|
14
|
+
console.log('------------------- parse start -------------------');
|
|
15
|
+
resource_1.ResourceManager.checkPlatformPath(args['platform']);
|
|
16
|
+
const manifestInfo = await doPwa(args);
|
|
17
|
+
const icon = await doReadyProject((_a = args['project']) !== null && _a !== void 0 ? _a : 'dist', manifestInfo);
|
|
18
|
+
await doXcode(args, icon, manifestInfo);
|
|
19
|
+
console.log('------------------- parse end -------------------');
|
|
20
|
+
await xcode_1.XcodeManager.build(args['export']);
|
|
21
|
+
return manifestInfo;
|
|
22
|
+
}
|
|
23
|
+
// build and upload ipa to App Store Connect
|
|
24
|
+
async function store(args) {
|
|
25
|
+
resource_1.ResourceManager.checkPlatformPath(args['platform']);
|
|
26
|
+
(0, check_1.checkStoreParams)(args);
|
|
27
|
+
/*
|
|
28
|
+
There are two ways to upload ipa to App Store Connect:
|
|
29
|
+
1. Using parameters from the build command, then this command will first archive and export before uploading
|
|
30
|
+
2. Use the name parameter to specify the IPA name, then this command will skip archiving and exporting, and directly find the specified IPA file in the export folder and execute the upload
|
|
31
|
+
*/
|
|
32
|
+
let appInfo = { name: 'WebSpatialTest' };
|
|
33
|
+
args['buildType'] = 'app-store-connect';
|
|
34
|
+
if (args['name']) {
|
|
35
|
+
appInfo.name = args['name'];
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
const manifestInfo = await build(args);
|
|
39
|
+
appInfo.name = manifestInfo.json.name;
|
|
40
|
+
}
|
|
41
|
+
await xcode_1.XcodeManager.upload(args, appInfo);
|
|
42
|
+
}
|
|
43
|
+
// build and run on simulator
|
|
44
|
+
async function run(args) {
|
|
45
|
+
var _a;
|
|
46
|
+
const runCmd = JSON.stringify(args);
|
|
47
|
+
history_1.default.init(runCmd);
|
|
48
|
+
console.log('------------------- parse start -------------------');
|
|
49
|
+
resource_1.ResourceManager.checkPlatformPath(args['platform']);
|
|
50
|
+
const manifestInfo = await doPwa(args, true);
|
|
51
|
+
history_1.default.recordManifest(manifestInfo.json);
|
|
52
|
+
/*
|
|
53
|
+
If it is an online project, there is no need to worry about project changes, just ensure that the parameters are consistent with the previous time and there is no need to compile again.
|
|
54
|
+
If it is a local project, there is a risk of project changes, so it needs to be compiled again.
|
|
55
|
+
If the --tryWithoutBuild=true parameter is used, it will be judged whether it is the same as the previous command.
|
|
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
|
+
*/
|
|
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
|
+
}
|
|
67
|
+
const icon = await doReadyProject((_a = args['project']) !== null && _a !== void 0 ? _a : 'dist', manifestInfo);
|
|
68
|
+
await doXcode(args, icon, manifestInfo, true);
|
|
69
|
+
console.log('------------------- parse end -------------------');
|
|
70
|
+
await xcode_1.XcodeManager.runWithSimulator();
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* PWA steps
|
|
74
|
+
* 1. Load manifestion.json
|
|
75
|
+
* 2. Check the integrity of manifestion.json parameters
|
|
76
|
+
* 3. Detecting start_url rule
|
|
77
|
+
* 4. Improve start_url, scope, display, and deeplink configurations
|
|
78
|
+
**/
|
|
79
|
+
async function doPwa(args, isDev = false) {
|
|
80
|
+
(0, check_1.checkBuildParams)(args, isDev);
|
|
81
|
+
return await pwa_1.PWAGenerator.generator(args, isDev);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* *Resource steps
|
|
85
|
+
* 1. If it is a local project, then
|
|
86
|
+
* A. Check and create project directory
|
|
87
|
+
* B. Mobile Web Engineering
|
|
88
|
+
* 2. Generate icon icon
|
|
89
|
+
**/
|
|
90
|
+
async function doReadyProject(project, manifestInfo) {
|
|
91
|
+
if (!manifestInfo.fromNet) {
|
|
92
|
+
// If it is a local project, the project needs to be moved.
|
|
93
|
+
await resource_1.ResourceManager.moveProjectFrom(project);
|
|
94
|
+
console.log('move web project: ok');
|
|
95
|
+
}
|
|
96
|
+
return await resource_1.ResourceManager.generateIcon(manifestInfo);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Xcode steps
|
|
100
|
+
* 1. Parse the project
|
|
101
|
+
* 2. Configure teamId
|
|
102
|
+
* 3. Bind web project
|
|
103
|
+
* 4. Configure icon
|
|
104
|
+
* 5. Configure manifest
|
|
105
|
+
* 6. Write project
|
|
106
|
+
**/
|
|
107
|
+
async function doXcode(args, icon, manifestInfo, isDev = false) {
|
|
108
|
+
await xcode_1.XcodeManager.parseProject({
|
|
109
|
+
icon,
|
|
110
|
+
manifestInfo,
|
|
111
|
+
teamId: args['teamId'],
|
|
112
|
+
version: args['version'],
|
|
113
|
+
buildType: args['buildType'],
|
|
114
|
+
export: args['export'],
|
|
115
|
+
}, isDev);
|
|
116
|
+
}
|
package/dist/lib/cmds/check.js
CHANGED
|
@@ -1 +1,41 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkBuildParams = checkBuildParams;
|
|
4
|
+
exports.checkStoreParams = checkStoreParams;
|
|
5
|
+
const validate_1 = require("../pwa/validate");
|
|
6
|
+
function checkBuildParams(args, isDev = false) {
|
|
7
|
+
if (args['manifest'] && args['manifestUrl']) {
|
|
8
|
+
throw new Error('--manifest and --manifest-url cannot be used at the same time');
|
|
9
|
+
}
|
|
10
|
+
if (!args['teamId'] && !isDev) {
|
|
11
|
+
throw new Error('--teamId is required');
|
|
12
|
+
}
|
|
13
|
+
if (args['base']) {
|
|
14
|
+
if ((0, validate_1.validateURL)(args['base'])) {
|
|
15
|
+
try {
|
|
16
|
+
const baseUrl = new URL(args['base']);
|
|
17
|
+
if (baseUrl.search || baseUrl.hash) {
|
|
18
|
+
throw new Error('The base parameter must be a path or url and cannot contain parameters or suffixes.');
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
catch (e) {
|
|
22
|
+
throw new Error('The base parameter must be a path or url and cannot contain parameters or suffixes.');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
const pathRegex = /(\?.*|\.\w+|#.*)$/;
|
|
27
|
+
const pathPart = args['base'].split('/').pop() || '';
|
|
28
|
+
if (pathRegex.test(pathPart)) {
|
|
29
|
+
throw new Error('The base parameter must be a path or url and cannot contain parameters or suffixes.');
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function checkStoreParams(args) {
|
|
35
|
+
if (!(args['u'] && args['p'])) {
|
|
36
|
+
throw new Error('--u and --p is required');
|
|
37
|
+
}
|
|
38
|
+
if (!args['version']) {
|
|
39
|
+
throw new Error('version is required');
|
|
40
|
+
}
|
|
41
|
+
}
|
package/dist/lib/cmds/help.js
CHANGED
|
@@ -1 +1,66 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.help = help;
|
|
4
|
+
const Log_1 = require("../utils/Log");
|
|
5
|
+
const HELP_MESSAGES = new Map([
|
|
6
|
+
[
|
|
7
|
+
'main',
|
|
8
|
+
[
|
|
9
|
+
'webspatial [command] <options>',
|
|
10
|
+
'',
|
|
11
|
+
'',
|
|
12
|
+
'help ................ shows this menu',
|
|
13
|
+
'build ................ initializes a new WebSpatial Project' +
|
|
14
|
+
' and generates an Apple Vision Pro App from a WebSpatial Project',
|
|
15
|
+
'run ................ build and run WebSpatial Project on Apple Vision Pro simulator',
|
|
16
|
+
'publish.............. upload WebSpatial Project to App Store Connect',
|
|
17
|
+
].join('\n'),
|
|
18
|
+
],
|
|
19
|
+
[
|
|
20
|
+
'build',
|
|
21
|
+
[
|
|
22
|
+
'Usage:',
|
|
23
|
+
'',
|
|
24
|
+
'',
|
|
25
|
+
'webspatial build --manifest=<local-manifest-path> --project=<local-web-project-path> --teamId=<teamId> [--version=version] [--buildType=release-testing]',
|
|
26
|
+
'',
|
|
27
|
+
'',
|
|
28
|
+
'webspatial build --manifest-url=<net-manifest-url> --teamId=<teamId> [--version=version] [--buildType=release-testing]',
|
|
29
|
+
].join('\n'),
|
|
30
|
+
],
|
|
31
|
+
[
|
|
32
|
+
'dev',
|
|
33
|
+
[
|
|
34
|
+
'Usage:',
|
|
35
|
+
'',
|
|
36
|
+
'',
|
|
37
|
+
'webspatial dev --manifest=<local-manifest-path> --project=<local-web-project-path>',
|
|
38
|
+
'',
|
|
39
|
+
'',
|
|
40
|
+
'webspatial dev --manifest-url=<net-manifest-url>',
|
|
41
|
+
].join('\n'),
|
|
42
|
+
],
|
|
43
|
+
[
|
|
44
|
+
'publish',
|
|
45
|
+
[
|
|
46
|
+
'Usage:',
|
|
47
|
+
'',
|
|
48
|
+
'',
|
|
49
|
+
'webspatial publish --manifest=<local-manifest-path> --project=<local-web-project-path> --teamId=<teamId> --version=<version> --u=<username> --p=<password>',
|
|
50
|
+
'',
|
|
51
|
+
'',
|
|
52
|
+
'webspatial publish --manifest-url=<net-manifest-url> --teamId=<teamId> --version=<version> --u=<username> --p=<password>',
|
|
53
|
+
'',
|
|
54
|
+
'',
|
|
55
|
+
'webspatial publish --name=<app-name> --version=<version> --u=<username> --p=<password>',
|
|
56
|
+
].join('\n'),
|
|
57
|
+
],
|
|
58
|
+
]);
|
|
59
|
+
async function help(args, log = new Log_1.ConsoleLog('help')) {
|
|
60
|
+
// minimist uses an `_` object to store details.
|
|
61
|
+
const command = args._[1];
|
|
62
|
+
const message = HELP_MESSAGES.get(command) || HELP_MESSAGES.get('main');
|
|
63
|
+
// We know we have a message for 'main', in case the command is invalid.
|
|
64
|
+
log.info(message);
|
|
65
|
+
return true;
|
|
66
|
+
}
|
package/dist/lib/cmds/launch.js
CHANGED
|
@@ -1 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.launch = launch;
|
|
4
|
+
const xcrun_1 = require("../xcode/xcrun");
|
|
5
|
+
async function launch(args) {
|
|
6
|
+
var _a;
|
|
7
|
+
const bundleId = (_a = args['bundleId']) !== null && _a !== void 0 ? _a : 'com.webspatial.test';
|
|
8
|
+
const appInfo = {
|
|
9
|
+
name: '',
|
|
10
|
+
id: bundleId,
|
|
11
|
+
};
|
|
12
|
+
xcrun_1.default.launchWithSimulator(appInfo);
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.shutdown = shutdown;
|
|
4
|
+
const xcrun_1 = require("../xcode/xcrun");
|
|
5
|
+
async function shutdown(args) {
|
|
6
|
+
xcrun_1.default.shutdownSimulator();
|
|
7
|
+
return true;
|
|
8
|
+
}
|
package/dist/lib/cmds/version.js
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getVersion = getVersion;
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
async function getVersion() {
|
|
7
|
+
const packageJsonFile = path.join(__dirname, '../../../package.json');
|
|
8
|
+
const packageJsonContents = await (await fs.promises.readFile(packageJsonFile)).toString();
|
|
9
|
+
const packageJson = JSON.parse(packageJsonContents);
|
|
10
|
+
return packageJson.version;
|
|
11
|
+
}
|