lincd-cli 0.2.42 → 0.2.43
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/.husky/post-merge +4 -0
- package/.husky/pre-commit +4 -0
- package/.prettierignore +4 -0
- package/.prettierrc.json +24 -0
- package/defaults/app-static/capacitor.config.ts +31 -81
- package/defaults/app-static/src/index-static.tsx +28 -0
- package/defaults/capacitor/scripts/fix-namespace.js +41 -0
- package/lib/cli-methods.js +1468 -1198
- package/lib/cli.js +98 -85
- package/lib/config-grunt.js +298 -229
- package/lib/config-webpack.js +358 -344
- package/lib/index.js +67 -29
- package/lib/interfaces.js +2 -2
- package/lib/plugins/declaration-plugin.js +209 -193
- package/lib/plugins/externalise-modules.js +167 -163
- package/lib/plugins/watch-run.js +16 -14
- package/lib/utils.js +326 -274
- package/package.json +17 -3
- package/defaults/app-static/frontend/src/index-static.tsx +0 -16
- /package/defaults/app-static/{frontend/web → web}/apple-touch-icon-144x144.png +0 -0
- /package/defaults/app-static/{frontend/web → web}/apple-touch-icon-57x57.png +0 -0
- /package/defaults/app-static/{frontend/web → web}/apple-touch-icon-72x72.png +0 -0
- /package/defaults/app-static/{frontend/web → web}/index.html +0 -0
package/lib/cli.js
CHANGED
|
@@ -1,141 +1,154 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports,
|
|
4
|
-
const cli_methods_1 = require(
|
|
2
|
+
'use strict';
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {value: true});
|
|
4
|
+
const cli_methods_1 = require('./cli-methods');
|
|
5
5
|
require('require-extensions');
|
|
6
6
|
var program = require('commander');
|
|
7
7
|
var fs = require('fs-extra');
|
|
8
8
|
var path = require('path');
|
|
9
9
|
program
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
.command('create-app')
|
|
11
|
+
.action((name) => {
|
|
12
12
|
return (0, cli_methods_1.createApp)(name);
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
})
|
|
14
|
+
.description('Creates a new folder with all the required files for a LINCD app')
|
|
15
|
+
.argument('<name>', 'the name of your LINCD app. To use spaces, wrap the name in double quotes.');
|
|
16
16
|
program
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
.command('create-package')
|
|
18
|
+
.action((name, uriBase) => {
|
|
19
19
|
return (0, cli_methods_1.createPackage)(name, uriBase);
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
})
|
|
21
|
+
.description('Create a new folder with all the required files for a new LINCD package')
|
|
22
|
+
.argument('<name>', 'The name of the package. Will be used as package name in package.json')
|
|
23
|
+
.argument(
|
|
24
|
+
'[uri_base]',
|
|
25
|
+
'The base URL used for data of this package. Leave blank to use the URL of your package on lincd.org after you register it',
|
|
26
|
+
);
|
|
24
27
|
program
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
.command('create-shape')
|
|
29
|
+
.action((name, uriBase) => {
|
|
27
30
|
return (0, cli_methods_1.createShape)(name);
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
})
|
|
32
|
+
.description('Creates a new ShapeClass file for your package. Execute this from your package folder.')
|
|
33
|
+
.argument('<name>', 'The name of the shape. Will be used for the file name and the class name');
|
|
31
34
|
program
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
.command('create-component')
|
|
36
|
+
.action((name, uriBase) => {
|
|
34
37
|
return (0, cli_methods_1.createComponent)(name);
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
})
|
|
39
|
+
.description('Creates a new Component file for your package. Execute this from your package folder.')
|
|
40
|
+
.argument('<name>', 'The name of the component. Will be used for the file name and the export name');
|
|
38
41
|
program
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
.command('create-set-component')
|
|
43
|
+
.action((name, uriBase) => {
|
|
41
44
|
return (0, cli_methods_1.createSetComponent)(name);
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
})
|
|
46
|
+
.description('Creates a new SetComponent file for your package. Execute this from your package folder.')
|
|
47
|
+
.argument('<name>', 'The name of the component. Will be used for the file name and the export name');
|
|
45
48
|
program
|
|
46
|
-
|
|
47
|
-
|
|
49
|
+
.command('create-ontology')
|
|
50
|
+
.action((prefix, uriBase) => {
|
|
48
51
|
return (0, cli_methods_1.createOntology)(prefix, uriBase);
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
})
|
|
53
|
+
.description('Creates a new ontology file for your package. Execute this from your package folder.')
|
|
54
|
+
.argument(
|
|
55
|
+
'<suggested-prefix>',
|
|
56
|
+
'The suggested prefix for your ontology. Also the shorthand code used for the file name and the exported ontology object',
|
|
57
|
+
)
|
|
58
|
+
.argument(
|
|
59
|
+
'[uribase]',
|
|
60
|
+
"Optional argument to set the URI base for the URI's of all entities in your ontology. Leave blank to use the URI's provided by lincd.org once you register this package",
|
|
61
|
+
);
|
|
62
|
+
program.command('app [action]', {hidden: true}).action(() => {
|
|
63
|
+
(0, cli_methods_1.register)('http://localhost:4101');
|
|
55
64
|
});
|
|
56
|
-
program.command('register-local', {
|
|
57
|
-
|
|
65
|
+
program.command('register-local', {hidden: true}).action(() => {
|
|
66
|
+
(0, cli_methods_1.register)('http://localhost:4101');
|
|
58
67
|
});
|
|
59
|
-
program.command('register-dev', {
|
|
60
|
-
|
|
68
|
+
program.command('register-dev', {hidden: true}).action(() => {
|
|
69
|
+
(0, cli_methods_1.register)('https://dev-registry.lincd.org');
|
|
61
70
|
});
|
|
62
71
|
program
|
|
63
|
-
|
|
64
|
-
|
|
72
|
+
.command('register')
|
|
73
|
+
.action(() => {
|
|
65
74
|
(0, cli_methods_1.register)('https://registry.lincd.org');
|
|
66
|
-
})
|
|
67
|
-
|
|
75
|
+
})
|
|
76
|
+
.description(
|
|
77
|
+
'Register (a new version of) this package to the LINCD registry. If successful your package will appear on www.lincd.org',
|
|
78
|
+
);
|
|
68
79
|
program
|
|
69
|
-
|
|
70
|
-
|
|
80
|
+
.command('info')
|
|
81
|
+
.action(() => {
|
|
71
82
|
var ownPackage = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8'));
|
|
72
83
|
console.log(ownPackage.version);
|
|
73
84
|
console.log('Running from: ' + __dirname);
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
program.command('build [target] [target2]', {
|
|
77
|
-
|
|
85
|
+
})
|
|
86
|
+
.description("Log the version of this tool and the path that it's running from");
|
|
87
|
+
program.command('build [target] [target2]', {isDefault: true}).action((target, target2) => {
|
|
88
|
+
(0, cli_methods_1.buildPackage)(target, target2);
|
|
78
89
|
});
|
|
79
90
|
program.command('build-metadata').action(() => {
|
|
80
|
-
|
|
91
|
+
(0, cli_methods_1.buildMetadata)();
|
|
81
92
|
});
|
|
82
93
|
program.command('publish-updated').action(() => {
|
|
83
|
-
|
|
94
|
+
return (0, cli_methods_1.publishUpdated)();
|
|
84
95
|
});
|
|
85
96
|
program.command('publish [version]').action((version) => {
|
|
86
|
-
|
|
97
|
+
return (0, cli_methods_1.publishPackage)(null, false, null, version);
|
|
87
98
|
});
|
|
88
99
|
program.command('status').action(() => {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
100
|
+
//log which packages need to be published
|
|
101
|
+
return (0, cli_methods_1.publishUpdated)(true).then(() => {
|
|
102
|
+
//log which packages need to be build
|
|
103
|
+
return (0, cli_methods_1.buildUpdated)(undefined, '', '', true);
|
|
104
|
+
});
|
|
94
105
|
});
|
|
95
106
|
program.command('build-updated [target] [target2]').action((target, target2) => {
|
|
96
|
-
|
|
107
|
+
return (0, cli_methods_1.buildUpdated)(1, target, target2);
|
|
97
108
|
});
|
|
98
109
|
program.command('build-updated-since [num-commits-back] [target] [target2]').action((back, target, target2) => {
|
|
99
|
-
|
|
110
|
+
return (0, cli_methods_1.buildUpdated)(back, target, target2);
|
|
100
111
|
});
|
|
101
112
|
program.command('build-all [target] [target2] [target3]').action((target, target2, target3) => {
|
|
102
|
-
|
|
113
|
+
(0, cli_methods_1.buildAll)(target, target2, target3);
|
|
103
114
|
});
|
|
104
115
|
program.command('all [action] [filter] [filter-value]').action((command, filter, filterValue) => {
|
|
105
|
-
|
|
116
|
+
(0, cli_methods_1.executeCommandForEachPackage)((0, cli_methods_1.getLincdPackages)(), command, filter, filterValue);
|
|
106
117
|
});
|
|
107
118
|
// program.command('all-except [excludedSpaces] [action]').action((excludedSpaces, command) => {
|
|
108
119
|
// executeCommandForEachModule(getLincdModules(), command, null, excludedSpaces);
|
|
109
120
|
// });
|
|
110
121
|
program.command('dev [target] [mode]').action((target, mode) => {
|
|
111
|
-
|
|
122
|
+
(0, cli_methods_1.developPackage)(target, mode);
|
|
112
123
|
});
|
|
113
124
|
program.command('depcheck').action((target, mode) => {
|
|
114
|
-
|
|
125
|
+
(0, cli_methods_1.depCheck)();
|
|
115
126
|
});
|
|
116
127
|
program
|
|
117
|
-
|
|
118
|
-
|
|
128
|
+
.command('package')
|
|
129
|
+
.action((name, command, args) => {
|
|
119
130
|
let fullCommand = command
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
131
|
+
? command +
|
|
132
|
+
' ' +
|
|
133
|
+
' ' +
|
|
134
|
+
args
|
|
135
|
+
.slice(0, 3)
|
|
136
|
+
.filter((a) => a && true)
|
|
137
|
+
.join(' ')
|
|
138
|
+
: null;
|
|
128
139
|
(0, cli_methods_1.executeCommandForPackage)(name, fullCommand);
|
|
129
|
-
})
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
140
|
+
})
|
|
141
|
+
.alias('p')
|
|
142
|
+
.alias('pkg')
|
|
143
|
+
.alias('m')
|
|
144
|
+
.alias('module')
|
|
145
|
+
.description(
|
|
146
|
+
'Searches for a package in this workspace with a partially matching name and executes a command for that package (without needing to execute it from the folder of the package)',
|
|
147
|
+
)
|
|
148
|
+
.argument('<name>', 'the name of the package. Can be a part of the name.')
|
|
149
|
+
.argument('[command]', 'the lincd command you want to execute. Like dev or build')
|
|
150
|
+
.argument('[args...]', 'the additional arguments of that command');
|
|
138
151
|
program.command('enable-capacitor').action(() => {
|
|
139
|
-
|
|
152
|
+
(0, cli_methods_1.addCapacitor)();
|
|
140
153
|
});
|
|
141
154
|
program.parse(process.argv);
|