lincd-cli 0.2.46 → 0.2.48

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/lib/cli.js CHANGED
@@ -1,154 +1,153 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';
3
- Object.defineProperty(exports, '__esModule', {value: true});
4
- const cli_methods_1 = require('./cli-methods');
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
- .command('create-app')
11
- .action((name) => {
10
+ .command('create-app')
11
+ .action((name) => {
12
12
  return (0, cli_methods_1.createApp)(name);
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.');
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
- .command('create-package')
18
- .action((name, uriBase) => {
17
+ .command('create-package')
18
+ .action((name, uriBase) => {
19
19
  return (0, cli_methods_1.createPackage)(name, uriBase);
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
- );
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('[uri_base]', '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');
27
24
  program
28
- .command('create-shape')
29
- .action((name, uriBase) => {
25
+ .command('create-shape')
26
+ .action((name, uriBase) => {
30
27
  return (0, cli_methods_1.createShape)(name);
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');
28
+ })
29
+ .description('Creates a new ShapeClass file for your package. Execute this from your package folder.')
30
+ .argument('<name>', 'The name of the shape. Will be used for the file name and the class name');
34
31
  program
35
- .command('create-component')
36
- .action((name, uriBase) => {
32
+ .command('create-component')
33
+ .action((name, uriBase) => {
37
34
  return (0, cli_methods_1.createComponent)(name);
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');
35
+ })
36
+ .description('Creates a new Component file for your package. Execute this from your package folder.')
37
+ .argument('<name>', 'The name of the component. Will be used for the file name and the export name');
41
38
  program
42
- .command('create-set-component')
43
- .action((name, uriBase) => {
39
+ .command('create-set-component')
40
+ .action((name, uriBase) => {
44
41
  return (0, cli_methods_1.createSetComponent)(name);
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');
42
+ })
43
+ .description('Creates a new SetComponent file for your package. Execute this from your package folder.')
44
+ .argument('<name>', 'The name of the component. Will be used for the file name and the export name');
48
45
  program
49
- .command('create-ontology')
50
- .action((prefix, uriBase) => {
46
+ .command('create-ontology')
47
+ .action((prefix, uriBase) => {
51
48
  return (0, cli_methods_1.createOntology)(prefix, uriBase);
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');
49
+ })
50
+ .description('Creates a new ontology file for your package. Execute this from your package folder.')
51
+ .argument('<suggested-prefix>', 'The suggested prefix for your ontology. Also the shorthand code used for the file name and the exported ontology object')
52
+ .argument('[uribase]', "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");
53
+ program.command('app [action]', { hidden: true }).action(() => {
54
+ (0, cli_methods_1.register)('http://localhost:4101');
64
55
  });
65
- program.command('register-local', {hidden: true}).action(() => {
66
- (0, cli_methods_1.register)('http://localhost:4101');
56
+ program.command('register-local', { hidden: true }).action(() => {
57
+ (0, cli_methods_1.register)('http://localhost:4101');
67
58
  });
68
- program.command('register-dev', {hidden: true}).action(() => {
69
- (0, cli_methods_1.register)('https://dev-registry.lincd.org');
59
+ program.command('register-dev', { hidden: true }).action(() => {
60
+ (0, cli_methods_1.register)('https://dev-registry.lincd.org');
70
61
  });
71
62
  program
72
- .command('register')
73
- .action(() => {
63
+ .command('register')
64
+ .action(() => {
74
65
  (0, cli_methods_1.register)('https://registry.lincd.org');
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
- );
66
+ })
67
+ .description('Register (a new version of) this package to the LINCD registry. If successful your package will appear on www.lincd.org');
79
68
  program
80
- .command('info')
81
- .action(() => {
69
+ .command('info')
70
+ .action(() => {
82
71
  var ownPackage = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8'));
83
72
  console.log(ownPackage.version);
84
73
  console.log('Running from: ' + __dirname);
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);
74
+ })
75
+ .description("Log the version of this tool and the path that it's running from");
76
+ program
77
+ .command('build [target] [target2]', { isDefault: true })
78
+ .action((target, target2) => {
79
+ (0, cli_methods_1.buildPackage)(target, target2);
89
80
  });
90
81
  program.command('build-metadata').action(() => {
91
- (0, cli_methods_1.buildMetadata)();
82
+ (0, cli_methods_1.buildMetadata)();
92
83
  });
93
84
  program.command('publish-updated').action(() => {
94
- return (0, cli_methods_1.publishUpdated)();
85
+ return (0, cli_methods_1.publishUpdated)();
95
86
  });
96
87
  program.command('publish [version]').action((version) => {
97
- return (0, cli_methods_1.publishPackage)(null, false, null, version);
88
+ return (0, cli_methods_1.publishPackage)(null, false, null, version);
98
89
  });
99
90
  program.command('status').action(() => {
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
- });
105
- });
106
- program.command('build-updated [target] [target2]').action((target, target2) => {
107
- return (0, cli_methods_1.buildUpdated)(1, target, target2);
91
+ //log which packages need to be published
92
+ return (0, cli_methods_1.publishUpdated)(true).then(() => {
93
+ //log which packages need to be build
94
+ return (0, cli_methods_1.buildUpdated)(undefined, '', '', true);
95
+ });
108
96
  });
109
- program.command('build-updated-since [num-commits-back] [target] [target2]').action((back, target, target2) => {
110
- return (0, cli_methods_1.buildUpdated)(back, target, target2);
97
+ program
98
+ .command('build-updated [target] [target2]')
99
+ .action((target, target2) => {
100
+ return (0, cli_methods_1.buildUpdated)(1, target, target2);
111
101
  });
112
- program.command('build-all [target] [target2] [target3]').action((target, target2, target3) => {
113
- (0, cli_methods_1.buildAll)(target, target2, target3);
102
+ program
103
+ .command('build-updated-since [num-commits-back] [target] [target2]')
104
+ .action((back, target, target2) => {
105
+ return (0, cli_methods_1.buildUpdated)(back, target, target2);
114
106
  });
115
- program.command('all [action] [filter] [filter-value]').action((command, filter, filterValue) => {
116
- (0, cli_methods_1.executeCommandForEachPackage)((0, cli_methods_1.getLincdPackages)(), command, filter, filterValue);
107
+ program
108
+ .command('build-all')
109
+ .action((options) => {
110
+ (0, cli_methods_1.buildAll)(options);
111
+ })
112
+ .option('--sync', 'build each package 1 by 1 - use this if you have build issues due to low available RAM memory')
113
+ .option('--from <char>', 'start from a specific package');
114
+ program
115
+ .command('all [action] [filter] [filter-value]')
116
+ .action((command, filter, filterValue) => {
117
+ (0, cli_methods_1.executeCommandForEachPackage)((0, cli_methods_1.getLincdPackages)(), command, filter, filterValue);
117
118
  });
118
119
  // program.command('all-except [excludedSpaces] [action]').action((excludedSpaces, command) => {
119
120
  // executeCommandForEachModule(getLincdModules(), command, null, excludedSpaces);
120
121
  // });
121
122
  program.command('dev [target] [mode]').action((target, mode) => {
122
- (0, cli_methods_1.developPackage)(target, mode);
123
+ (0, cli_methods_1.developPackage)(target, mode);
123
124
  });
124
125
  program.command('depcheck').action((target, mode) => {
125
- (0, cli_methods_1.depCheck)();
126
+ (0, cli_methods_1.depCheck)();
126
127
  });
127
128
  program
128
- .command('package')
129
- .action((name, command, args) => {
129
+ .command('package')
130
+ .action((name, command, args) => {
130
131
  let fullCommand = command
131
- ? command +
132
- ' ' +
133
- ' ' +
134
- args
135
- .slice(0, 3)
136
- .filter((a) => a && true)
137
- .join(' ')
138
- : null;
132
+ ? command +
133
+ ' ' +
134
+ ' ' +
135
+ args
136
+ .slice(0, 3)
137
+ .filter((a) => a && true)
138
+ .join(' ')
139
+ : null;
139
140
  (0, cli_methods_1.executeCommandForPackage)(name, fullCommand);
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');
141
+ })
142
+ .alias('p')
143
+ .alias('pkg')
144
+ .alias('m')
145
+ .alias('module')
146
+ .description('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
+ .argument('<name>', 'the name of the package. Can be a part of the name.')
148
+ .argument('[command]', 'the lincd command you want to execute. Like dev or build')
149
+ .argument('[args...]', 'the additional arguments of that command');
151
150
  program.command('enable-capacitor').action(() => {
152
- (0, cli_methods_1.addCapacitor)();
151
+ (0, cli_methods_1.addCapacitor)();
153
152
  });
154
153
  program.parse(process.argv);