@genesislcap/genx 14.142.1-alpha-21cf4c3.0 → 14.143.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
|
@@ -5,198 +5,6 @@ This repo contains our **genx** tool for rapid code scaffolding that adheres to
|
|
|
5
5
|
[](https://lerna.js.org/)
|
|
6
6
|
[](https://www.typescriptlang.org/)
|
|
7
7
|
|
|
8
|
-
## App Taks
|
|
9
|
-
|
|
10
|
-
Seeds can optionally define tasks in `.genx/tasks.json`.
|
|
11
|
-
|
|
12
|
-
A task contains one or more steps, which can execute various commands.
|
|
13
|
-
|
|
14
|
-
```json
|
|
15
|
-
{
|
|
16
|
-
"tasks": {
|
|
17
|
-
"hello": {
|
|
18
|
-
"name": "hello",
|
|
19
|
-
"description": "Sample task",
|
|
20
|
-
"steps": [
|
|
21
|
-
{
|
|
22
|
-
"say": "hello"
|
|
23
|
-
}
|
|
24
|
-
]
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Run `genx app` to see available tasks:
|
|
31
|
-
|
|
32
|
-
```sh
|
|
33
|
-
$ genx app
|
|
34
|
-
|
|
35
|
-
$ genx app <task>
|
|
36
|
-
|
|
37
|
-
Apps: Apps are seed instances. Tasks are commands provided by a seed.
|
|
38
|
-
|
|
39
|
-
$ genx app List all tasks
|
|
40
|
-
$ genx app hello Sample task
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Run `genx app hello`:
|
|
44
|
-
|
|
45
|
-
```sh
|
|
46
|
-
$ genx app hello
|
|
47
|
-
hello | hello
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### Executing commands
|
|
51
|
-
|
|
52
|
-
You can execute commands in a step as follows:
|
|
53
|
-
|
|
54
|
-
* `"exec": "gradle assemble"` runs a program or a script
|
|
55
|
-
* `"spawn": "taskname"` runs another task (see below)
|
|
56
|
-
* `"builtin": "hello"` runs a builtin task provided by CLI. Available tasks are in [tasks folder](src/tasks.ts).
|
|
57
|
-
* `"say": "text"` prints output
|
|
58
|
-
|
|
59
|
-
When using `exec` check that your command works on different platforms (Windows, Linux, OS X).
|
|
60
|
-
|
|
61
|
-
### Directories
|
|
62
|
-
|
|
63
|
-
You can provide `cwd` option to set the working directory for a task or for an invidual task step.
|
|
64
|
-
|
|
65
|
-
```json
|
|
66
|
-
{
|
|
67
|
-
"tasks": {
|
|
68
|
-
"build": {
|
|
69
|
-
"name": "build",
|
|
70
|
-
"description": "Build project",
|
|
71
|
-
"cwd": ".genx/generated",
|
|
72
|
-
"steps": [
|
|
73
|
-
{
|
|
74
|
-
"exec": "gradle assemble"
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
"exec": "npm run build"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"say": "all done"
|
|
81
|
-
}
|
|
82
|
-
]
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
### Environment variables
|
|
89
|
-
|
|
90
|
-
You can set environment variables for a task or for an individual step.
|
|
91
|
-
|
|
92
|
-
You can add `requiredEnv` array to a task to specify environment variables which must be set for it to run.
|
|
93
|
-
|
|
94
|
-
Note: in this example we could have simply done `"exec": "git branch --show-current"` instead - it just illustrates environment variable use.
|
|
95
|
-
|
|
96
|
-
```json
|
|
97
|
-
{
|
|
98
|
-
"tasks": {
|
|
99
|
-
"env": {
|
|
100
|
-
"name": "env",
|
|
101
|
-
"description": "Print current branch",
|
|
102
|
-
"env": {
|
|
103
|
-
"BRANCH": "$(git branch --show-current)"
|
|
104
|
-
},
|
|
105
|
-
"steps": [
|
|
106
|
-
{
|
|
107
|
-
"exec": "node -e \"console.log(process.env.BRANCH)\""
|
|
108
|
-
}
|
|
109
|
-
]
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
```sh
|
|
116
|
-
$ genx app env
|
|
117
|
-
env | node -e "console.log(process.env.BRANCH)"
|
|
118
|
-
master
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
### Conditions
|
|
122
|
-
|
|
123
|
-
You can define a condition to determine whether a task should be executed. If it returns a zero exit code, steps will be executed, otherwise skipped.
|
|
124
|
-
|
|
125
|
-
```json
|
|
126
|
-
{
|
|
127
|
-
"tasks": {
|
|
128
|
-
"diff": {
|
|
129
|
-
"name": "diff",
|
|
130
|
-
"description": "Detect changes",
|
|
131
|
-
"steps": [
|
|
132
|
-
{
|
|
133
|
-
"exec": "echo 'working tree contains changes'"
|
|
134
|
-
}
|
|
135
|
-
],
|
|
136
|
-
"condition": "git diff --exit-code"
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
Note: we could have done `git diff --exit-code > /dev/null` to turn off Git output on Linux/OS X, but that's not supported on Windows.
|
|
143
|
-
|
|
144
|
-
Assuming we have some changes in the working directory, which haven't beedn added to Git yet:
|
|
145
|
-
|
|
146
|
-
```sh
|
|
147
|
-
$ genx app diff
|
|
148
|
-
diff | condition: git diff --exit-code
|
|
149
|
-
# ... git diff output
|
|
150
|
-
diff | condition exited with non-zero - skipping
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
After running Git add command:
|
|
154
|
-
|
|
155
|
-
```sh
|
|
156
|
-
$ genx app diff
|
|
157
|
-
diff | condition: git diff --exit-code
|
|
158
|
-
diff | echo 'working tree contains changes'
|
|
159
|
-
working tree contains changes
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
### Dependent tasks
|
|
163
|
-
|
|
164
|
-
You can define dependent tasks:
|
|
165
|
-
|
|
166
|
-
```json
|
|
167
|
-
{
|
|
168
|
-
"tasks": {
|
|
169
|
-
"first": {
|
|
170
|
-
"name": "first",
|
|
171
|
-
"description": "First task",
|
|
172
|
-
"steps": [
|
|
173
|
-
{
|
|
174
|
-
"say": "first"
|
|
175
|
-
}
|
|
176
|
-
]
|
|
177
|
-
},
|
|
178
|
-
"second": {
|
|
179
|
-
"name": "second",
|
|
180
|
-
"description": "Second task",
|
|
181
|
-
"steps": [
|
|
182
|
-
{
|
|
183
|
-
"spawn": "first"
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
"say": "second"
|
|
187
|
-
}
|
|
188
|
-
]
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
```sh
|
|
195
|
-
$ genx app second
|
|
196
|
-
second » first | first
|
|
197
|
-
second | second
|
|
198
|
-
```
|
|
199
|
-
|
|
200
8
|
## License
|
|
201
9
|
|
|
202
10
|
Note: this project provides front end dependencies and uses licensed components listed in the next section, thus licenses for those components are required during development. Contact [Genesis Global](https://genesis.global/contact-us/) for more details.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-seed-command.d.ts","sourceRoot":"","sources":["../../src/commands/run-seed-command.ts"],"names":[],"mappings":"AACA,OAAO,EAQL,OAAO,EACR,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"run-seed-command.d.ts","sourceRoot":"","sources":["../../src/commands/run-seed-command.ts"],"names":[],"mappings":"AACA,OAAO,EAQL,OAAO,EACR,MAAM,wBAAwB,CAAC;2DAqCa,OAAO;AAApD,wBA+DE"}
|
|
@@ -5,6 +5,7 @@ const node_fs_1 = require("node:fs");
|
|
|
5
5
|
const build_kit_1 = require("@genesislcap/build-kit");
|
|
6
6
|
const consola_1 = require("consola");
|
|
7
7
|
const getOptions = (options) => {
|
|
8
|
+
consola_1.consola.debug('CLI options', options);
|
|
8
9
|
// param exclusion list needs to be updated if init options change
|
|
9
10
|
const params = (0, build_kit_1.excludeObjKeys)(options, [
|
|
10
11
|
'seed',
|
|
@@ -14,8 +15,10 @@ const getOptions = (options) => {
|
|
|
14
15
|
'x',
|
|
15
16
|
'logLevel',
|
|
16
17
|
'l',
|
|
18
|
+
'npm',
|
|
17
19
|
'remote',
|
|
18
20
|
'shell',
|
|
21
|
+
'scope',
|
|
19
22
|
'subdir',
|
|
20
23
|
'ref',
|
|
21
24
|
'--',
|
|
@@ -30,12 +33,14 @@ const getOptions = (options) => {
|
|
|
30
33
|
shell: options.shell,
|
|
31
34
|
isLogLevelVerbose: options.logLevel === 'verbose',
|
|
32
35
|
skipOptionalPrompts: options.skipOptionalPrompts,
|
|
36
|
+
npm: options.npm,
|
|
37
|
+
scope: options.scope,
|
|
33
38
|
};
|
|
34
39
|
};
|
|
35
40
|
exports.default = (dir, options, command = build_kit_1.COMMAND.INIT) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
36
41
|
const start = Date.now();
|
|
37
42
|
const isInit = command === build_kit_1.COMMAND.INIT;
|
|
38
|
-
const { insecure, seed, subdir, remote, ref, skipOptionalPrompts, params, isLogLevelVerbose, shell, } = getOptions(options);
|
|
43
|
+
const { insecure, seed, subdir, remote, ref, skipOptionalPrompts, params, isLogLevelVerbose, shell, scope, npm, } = getOptions(options);
|
|
39
44
|
if (isLogLevelVerbose) {
|
|
40
45
|
// Enables debug output in giget
|
|
41
46
|
process.env.DEBUG = '1';
|
|
@@ -54,7 +59,7 @@ exports.default = (dir, options, command = build_kit_1.COMMAND.INIT) => tslib_1.
|
|
|
54
59
|
process.exit();
|
|
55
60
|
}
|
|
56
61
|
// fetch remote or copy local seed
|
|
57
|
-
const result = yield (0, build_kit_1.fetchSeed)(seed, dir, remote, ref, insecure, subdir, isInit);
|
|
62
|
+
const result = yield (0, build_kit_1.fetchSeed)(seed, dir, remote, ref, insecure, subdir, isInit, npm, scope);
|
|
58
63
|
consola_1.consola.debug('Seed fetched', result);
|
|
59
64
|
// NPM install in .genx folder
|
|
60
65
|
yield (0, build_kit_1.installSeedDeps)(result.extractedSeedGenxDir, isLogLevelVerbose);
|
package/dist/index.js
CHANGED
|
@@ -60,6 +60,8 @@ cli
|
|
|
60
60
|
.option('--subdir <subdir>', 'subdirectory within seed repo')
|
|
61
61
|
.option('--remote', 'Remote seeds only')
|
|
62
62
|
.option('--no-shell', 'Do not launch a shell in the generated app')
|
|
63
|
+
.option('--no-npm', 'Skip seed resolution from NPM registry')
|
|
64
|
+
.option('--no-scope', 'Do not apply default NPM scope for this seed module')
|
|
63
65
|
.option('-l, --log-level [level]', 'info (default) or verbose')
|
|
64
66
|
.allowUnknownOptions()
|
|
65
67
|
.action((app, options) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -116,6 +118,8 @@ cli
|
|
|
116
118
|
.option('--insecure', 'Skip SSL certificate verification')
|
|
117
119
|
.option('--remote', 'Remote seeds only')
|
|
118
120
|
.option('--no-shell', 'Do not launch a shell in the generated app')
|
|
121
|
+
.option('--no-npm', 'Skip seed resolution from NPM registry')
|
|
122
|
+
.option('--no-scope', 'Do not apply default NPM scope for this seed module')
|
|
119
123
|
.option('-l, --log-level [level]', 'info (default) or verbose')
|
|
120
124
|
.allowUnknownOptions()
|
|
121
125
|
.action((app, options) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/genx",
|
|
3
3
|
"description": "Genx CLI",
|
|
4
|
-
"version": "14.
|
|
4
|
+
"version": "14.143.0",
|
|
5
5
|
"license": "SEE LICENSE IN license.txt",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=20.0.0"
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"typescript": "^4.5.5"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@genesislcap/build-kit": "14.
|
|
23
|
-
"@genesislcap/eslint-stylelint-builder": "14.
|
|
24
|
-
"@genesislcap/rollup-builder": "14.
|
|
25
|
-
"@genesislcap/ts-builder": "14.
|
|
26
|
-
"@genesislcap/uvu-playwright-builder": "14.
|
|
27
|
-
"@genesislcap/vite-builder": "14.
|
|
28
|
-
"@genesislcap/webpack-builder": "14.
|
|
22
|
+
"@genesislcap/build-kit": "14.143.0",
|
|
23
|
+
"@genesislcap/eslint-stylelint-builder": "14.143.0",
|
|
24
|
+
"@genesislcap/rollup-builder": "14.143.0",
|
|
25
|
+
"@genesislcap/ts-builder": "14.143.0",
|
|
26
|
+
"@genesislcap/uvu-playwright-builder": "14.143.0",
|
|
27
|
+
"@genesislcap/vite-builder": "14.143.0",
|
|
28
|
+
"@genesislcap/webpack-builder": "14.143.0",
|
|
29
29
|
"cac": "^6.7.14",
|
|
30
30
|
"consola": "^3.0.2",
|
|
31
31
|
"serve-handler": "^6.1.5",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "b04aa3adb04068dd8e5de4cb903c0eeebf0737f5"
|
|
43
43
|
}
|