lincd-cli 0.2.41 → 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/lib/cli.js CHANGED
@@ -1,141 +1,154 @@
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('[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');
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
- .command('create-shape')
26
- .action((name, uriBase) => {
28
+ .command('create-shape')
29
+ .action((name, uriBase) => {
27
30
  return (0, cli_methods_1.createShape)(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');
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
- .command('create-component')
33
- .action((name, uriBase) => {
35
+ .command('create-component')
36
+ .action((name, uriBase) => {
34
37
  return (0, cli_methods_1.createComponent)(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');
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
- .command('create-set-component')
40
- .action((name, uriBase) => {
42
+ .command('create-set-component')
43
+ .action((name, uriBase) => {
41
44
  return (0, cli_methods_1.createSetComponent)(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');
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
- .command('create-ontology')
47
- .action((prefix, uriBase) => {
49
+ .command('create-ontology')
50
+ .action((prefix, uriBase) => {
48
51
  return (0, cli_methods_1.createOntology)(prefix, uriBase);
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');
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', { hidden: true }).action(() => {
57
- (0, cli_methods_1.register)('http://localhost:4101');
65
+ program.command('register-local', {hidden: true}).action(() => {
66
+ (0, cli_methods_1.register)('http://localhost:4101');
58
67
  });
59
- program.command('register-dev', { hidden: true }).action(() => {
60
- (0, cli_methods_1.register)('https://dev-registry.lincd.org');
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
- .command('register')
64
- .action(() => {
72
+ .command('register')
73
+ .action(() => {
65
74
  (0, cli_methods_1.register)('https://registry.lincd.org');
66
- })
67
- .description('Register (a new version of) this package to the LINCD registry. If successful your package will appear on www.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
+ );
68
79
  program
69
- .command('info')
70
- .action(() => {
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
- .description("Log the version of this tool and the path that it's running from");
76
- program.command('build [target] [target2]', { isDefault: true }).action((target, target2) => {
77
- (0, cli_methods_1.buildPackage)(target, target2);
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
- (0, cli_methods_1.buildMetadata)();
91
+ (0, cli_methods_1.buildMetadata)();
81
92
  });
82
93
  program.command('publish-updated').action(() => {
83
- return (0, cli_methods_1.publishUpdated)();
94
+ return (0, cli_methods_1.publishUpdated)();
84
95
  });
85
96
  program.command('publish [version]').action((version) => {
86
- return (0, cli_methods_1.publishPackage)(null, false, null, version);
97
+ return (0, cli_methods_1.publishPackage)(null, false, null, version);
87
98
  });
88
99
  program.command('status').action(() => {
89
- //log which packages need to be published
90
- return (0, cli_methods_1.publishUpdated)(true).then(() => {
91
- //log which packages need to be build
92
- return (0, cli_methods_1.buildUpdated)(undefined, '', '', true);
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
- return (0, cli_methods_1.buildUpdated)(1, target, target2);
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
- return (0, cli_methods_1.buildUpdated)(back, target, target2);
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
- (0, cli_methods_1.buildAll)(target, target2, target3);
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
- (0, cli_methods_1.executeCommandForEachPackage)((0, cli_methods_1.getLincdPackages)(), command, filter, filterValue);
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
- (0, cli_methods_1.developPackage)(target, mode);
122
+ (0, cli_methods_1.developPackage)(target, mode);
112
123
  });
113
124
  program.command('depcheck').action((target, mode) => {
114
- (0, cli_methods_1.depCheck)();
125
+ (0, cli_methods_1.depCheck)();
115
126
  });
116
127
  program
117
- .command('package')
118
- .action((name, command, args) => {
128
+ .command('package')
129
+ .action((name, command, args) => {
119
130
  let fullCommand = command
120
- ? command +
121
- ' ' +
122
- ' ' +
123
- args
124
- .slice(0, 3)
125
- .filter((a) => a && true)
126
- .join(' ')
127
- : null;
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
- .alias('p')
131
- .alias('pkg')
132
- .alias('m')
133
- .alias('module')
134
- .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)')
135
- .argument('<name>', 'the name of the package. Can be a part of the name.')
136
- .argument('[command]', 'the lincd command you want to execute. Like dev or build')
137
- .argument('[args...]', 'the additional arguments of that command');
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
- (0, cli_methods_1.addCapacitor)();
152
+ (0, cli_methods_1.addCapacitor)();
140
153
  });
141
154
  program.parse(process.argv);