simple-scaffold 1.9.0 → 1.10.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 +44 -36
- package/cmd.js +60 -56
- package/cmd.js.map +1 -1
- package/config.d.ts +7 -7
- package/config.js +42 -46
- package/config.js.map +1 -1
- package/file.js +15 -16
- package/file.js.map +1 -1
- package/git.d.ts +10 -1
- package/git.js +43 -17
- package/git.js.map +1 -1
- package/logger.js +20 -14
- package/logger.js.map +1 -1
- package/package.json +22 -27
- package/parser.d.ts +1 -0
- package/parser.js +6 -6
- package/parser.js.map +1 -1
- package/scaffold.js +5 -5
- package/scaffold.js.map +1 -1
- package/types.d.ts +62 -47
- package/types.js +7 -19
- package/types.js.map +1 -1
- package/utils.js.map +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[Documentation](https://chenasraf.github.io/simple-scaffold) |
|
|
7
7
|
[NPM](https://npmjs.com/package/simple-scaffold) | [casraf.dev](https://casraf.dev)
|
|
8
8
|
|
|
9
|
-

|
|
10
10
|

|
|
11
11
|
|
|
12
12
|
</h2>
|
|
@@ -25,7 +25,7 @@ lifting for you and start building your projects faster and more efficiently tod
|
|
|
25
25
|
|
|
26
26
|
<div align="center">
|
|
27
27
|
|
|
28
|
-

|
|
29
29
|
|
|
30
30
|
</div>
|
|
31
31
|
|
|
@@ -57,7 +57,7 @@ export default {{pascalCase name}}: React.FC = (props) => {
|
|
|
57
57
|
|
|
58
58
|
To generate the template output, run:
|
|
59
59
|
|
|
60
|
-
```
|
|
60
|
+
```sh
|
|
61
61
|
# generate single component
|
|
62
62
|
$ npx simple-scaffold@latest \
|
|
63
63
|
-t templates/component -o src/components PageWrapper
|
|
@@ -98,7 +98,7 @@ module.exports = {
|
|
|
98
98
|
|
|
99
99
|
Then call your scaffold like this:
|
|
100
100
|
|
|
101
|
-
```
|
|
101
|
+
```sh
|
|
102
102
|
$ npx simple-scaffold@latest -c scaffold.config.js PageWrapper
|
|
103
103
|
```
|
|
104
104
|
|
|
@@ -108,8 +108,8 @@ This will allow you to avoid needing to remember which configs are needed or to
|
|
|
108
108
|
Also, this allows you to define more complex scaffolds with logic without having to use the Node.js
|
|
109
109
|
API directly. (Of course you always have the option to still do so if you wish)
|
|
110
110
|
|
|
111
|
-
See more at the [CLI documentation](https://chenasraf.github.io/simple-scaffold/
|
|
112
|
-
[Configuration Files](https://chenasraf.github.io/simple-scaffold/
|
|
111
|
+
See more at the [CLI documentation](https://chenasraf.github.io/simple-scaffold/docs/usage/cli) and
|
|
112
|
+
[Configuration Files](https://chenasraf.github.io/simple-scaffold/docs/usage/configuration_files).
|
|
113
113
|
|
|
114
114
|
### Remote Configurations
|
|
115
115
|
|
|
@@ -118,41 +118,47 @@ repository.
|
|
|
118
118
|
|
|
119
119
|
A remote config can be loaded in one of these ways:
|
|
120
120
|
|
|
121
|
-
- If it's on GitHub, you can use `-
|
|
121
|
+
- If it's on GitHub, you can use `-g user/repository_name`
|
|
122
122
|
- If it's on another git server (such as GitLab), you can use
|
|
123
|
-
`-
|
|
123
|
+
`-g https://example.com/user/repository_name.git`
|
|
124
124
|
|
|
125
125
|
Configurations can hold multiple scaffold groups. Each group can be accessed using its key by
|
|
126
|
-
supplying the `--key` or `-k` argument,
|
|
127
|
-
|
|
126
|
+
supplying the `--key` or `-k` argument, like so:
|
|
127
|
+
|
|
128
|
+
```sh
|
|
129
|
+
-g user/repository_name -c scaffold.js -k key_name`.
|
|
130
|
+
```
|
|
128
131
|
|
|
129
132
|
Here is an example for loading the example component templates in this very repository:
|
|
130
133
|
|
|
131
|
-
```
|
|
134
|
+
```sh
|
|
132
135
|
$ npx simple-scaffold@latest \
|
|
133
|
-
-
|
|
136
|
+
-g chenasraf/simple-scaffold \
|
|
137
|
+
-k component \
|
|
134
138
|
PageWrapper
|
|
135
139
|
|
|
136
140
|
# equivalent to:
|
|
137
141
|
$ npx simple-scaffold@latest \
|
|
138
|
-
-
|
|
142
|
+
-g https://github.com/chenasraf/simple-scaffold.git \
|
|
143
|
+
-c scaffold.config.js \
|
|
144
|
+
-k component \
|
|
139
145
|
PageWrapper
|
|
140
146
|
```
|
|
141
147
|
|
|
142
|
-
When template name (
|
|
148
|
+
When template name (`-k component`) is omitted, `default` is used.
|
|
143
149
|
|
|
144
|
-
See more at the [CLI documentation](https://chenasraf.github.io/simple-scaffold/
|
|
145
|
-
[Configuration Files](https://chenasraf.github.io/simple-scaffold/
|
|
150
|
+
See more at the [CLI documentation](https://chenasraf.github.io/simple-scaffold/docs/usage/cli) and
|
|
151
|
+
[Configuration Files](https://chenasraf.github.io/simple-scaffold/docs/usage/configuration_files).
|
|
146
152
|
|
|
147
153
|
## Documentation
|
|
148
154
|
|
|
149
155
|
See full documentation [here](https://chenasraf.github.io/simple-scaffold).
|
|
150
156
|
|
|
151
|
-
- [Command Line Interface (CLI) usage](https://chenasraf.github.io/simple-scaffold/
|
|
152
|
-
- [Node.js usage](https://chenasraf.github.io/simple-scaffold/
|
|
153
|
-
- [Templates](https://chenasraf.github.io/simple-scaffold/
|
|
154
|
-
- [Configuration Files](https://chenasraf.github.io/simple-scaffold/
|
|
155
|
-
- [
|
|
157
|
+
- [Command Line Interface (CLI) usage](https://chenasraf.github.io/simple-scaffold/docs/usage/cli)
|
|
158
|
+
- [Node.js usage](https://chenasraf.github.io/simple-scaffold/docs/usage/node)
|
|
159
|
+
- [Templates](https://chenasraf.github.io/simple-scaffold/docs/usage/templates)
|
|
160
|
+
- [Configuration Files](https://chenasraf.github.io/simple-scaffold/docs/usage/configuration_files)
|
|
161
|
+
- [Migration](https://chenasraf.github.io/simple-scaffold/docs/usage/migration)
|
|
156
162
|
|
|
157
163
|
## Contributing
|
|
158
164
|
|
|
@@ -161,9 +167,11 @@ very helpful to sustaining its life. If you are feeling incredibly generous and
|
|
|
161
167
|
just a small amount to help sustain this project, I would be very very thankful!
|
|
162
168
|
|
|
163
169
|
<a href='https://ko-fi.com/casraf' target='_blank'>
|
|
164
|
-
<img
|
|
170
|
+
<img
|
|
171
|
+
height='36'
|
|
165
172
|
src='https://cdn.ko-fi.com/cdn/kofi1.png?v=3'
|
|
166
|
-
alt='Buy Me a Coffee at ko-fi.com'
|
|
173
|
+
alt='Buy Me a Coffee at ko-fi.com'
|
|
174
|
+
/>
|
|
167
175
|
</a>
|
|
168
176
|
|
|
169
177
|
I welcome any issues or pull requests on GitHub. If you find a bug, or would like a new feature,
|
|
@@ -172,8 +180,8 @@ don't hesitate to open an appropriate issue and I will do my best to reply promp
|
|
|
172
180
|
If you are a developer and want to contribute code, here are some starting tips:
|
|
173
181
|
|
|
174
182
|
1. Fork this repository
|
|
175
|
-
2. Run `
|
|
176
|
-
3. Run `
|
|
183
|
+
2. Run `pnpm install`
|
|
184
|
+
3. Run `pnpm dev` to start file watch mode
|
|
177
185
|
4. Make any changes you would like
|
|
178
186
|
5. Create tests for your changes
|
|
179
187
|
6. Update the relevant documentation (readme, code comments, type comments)
|
|
@@ -181,22 +189,22 @@ If you are a developer and want to contribute code, here are some starting tips:
|
|
|
181
189
|
|
|
182
190
|
Some tips on getting around the code:
|
|
183
191
|
|
|
184
|
-
- Use `
|
|
185
|
-
changes and immediately be able to try them using `
|
|
186
|
-
- Use `
|
|
187
|
-
- Use `
|
|
188
|
-
- Use `
|
|
189
|
-
you to test different behaviors. See `
|
|
192
|
+
- Use `pnpm dev` for development - it runs TypeScript compile in watch mode, allowing you to make
|
|
193
|
+
changes and immediately be able to try them using `pnpm cmd`.
|
|
194
|
+
- Use `pnpm build` to build the output once
|
|
195
|
+
- Use `pnpm test` to run tests
|
|
196
|
+
- Use `pnpm cmd` to use the CLI feature of Simple Scaffold from within the root directory, enabling
|
|
197
|
+
you to test different behaviors. See `pnpm cmd -h` for more information.
|
|
190
198
|
|
|
191
199
|
> This requires an updated build, and does not trigger one itself. From here you have several
|
|
192
200
|
> options:
|
|
193
201
|
>
|
|
194
|
-
> - Run `
|
|
195
|
-
> - Run `
|
|
196
|
-
> - Run `
|
|
202
|
+
> - Run `pnpm dev` to watch for file changes and build automatically
|
|
203
|
+
> - Run `pnpm build` before running this to trigger a one-time build
|
|
204
|
+
> - Run `pnpm build-cmd` which triggers a build right before running `pnpm cmd` automatically with
|
|
197
205
|
> the rest of the given arguments.
|
|
198
206
|
|
|
199
|
-
- Use `
|
|
200
|
-
- Use `
|
|
207
|
+
- Use `pnpm build-docs` to build the documentation once
|
|
208
|
+
- Use `pnpm watch-docs` to start docs in watch mode
|
|
201
209
|
- To see the documentation, currently you have to serve the directory yourself with a static web
|
|
202
210
|
server (like node's built in serve, VS code's "Go Live" mode, etc)
|
package/cmd.js
CHANGED
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.parseCliArgs = void 0;
|
|
8
|
-
const massarg_1 =
|
|
8
|
+
const massarg_1 = require("massarg");
|
|
9
9
|
const chalk_1 = __importDefault(require("chalk"));
|
|
10
10
|
const types_1 = require("./types");
|
|
11
11
|
const scaffold_1 = require("./scaffold");
|
|
@@ -13,56 +13,67 @@ const node_path_1 = __importDefault(require("node:path"));
|
|
|
13
13
|
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
14
14
|
const config_1 = require("./config");
|
|
15
15
|
async function parseCliArgs(args = process.argv.slice(2)) {
|
|
16
|
-
const
|
|
16
|
+
const isProjectRoot = Boolean(await promises_1.default.stat(node_path_1.default.join(__dirname, "package.json")).catch(() => false));
|
|
17
|
+
const pkgFile = await promises_1.default.readFile(node_path_1.default.resolve(__dirname, isProjectRoot ? "." : "..", "package.json"));
|
|
17
18
|
const pkg = JSON.parse(pkgFile.toString());
|
|
18
|
-
const isConfigProvided = args.includes("--config") || args.includes("-c") || args.includes("--
|
|
19
|
-
return (
|
|
19
|
+
const isConfigProvided = args.includes("--config") || args.includes("-c") || args.includes("--git") || args.includes("-g");
|
|
20
|
+
return (0, massarg_1.massarg)({
|
|
21
|
+
name: pkg.name,
|
|
22
|
+
description: pkg.description,
|
|
23
|
+
})
|
|
20
24
|
.main(async (config) => {
|
|
21
|
-
const
|
|
22
|
-
return (0, scaffold_1.Scaffold)(
|
|
25
|
+
const parsed = await (0, config_1.parseConfigFile)(config);
|
|
26
|
+
return (0, scaffold_1.Scaffold)(parsed);
|
|
23
27
|
})
|
|
24
28
|
.option({
|
|
25
29
|
name: "name",
|
|
26
30
|
aliases: ["n"],
|
|
27
|
-
description: "Name to be passed to the generated files. {{name}} and
|
|
31
|
+
description: "Name to be passed to the generated files. `{{name}}` and other data parameters inside " +
|
|
32
|
+
"contents and file names will be replaced accordingly. You may omit the `--name` or `-n` for this specific option.",
|
|
28
33
|
isDefault: true,
|
|
29
34
|
required: true,
|
|
30
35
|
})
|
|
31
36
|
.option({
|
|
32
37
|
name: "config",
|
|
33
38
|
aliases: ["c"],
|
|
34
|
-
description: "Filename
|
|
39
|
+
description: "Filename to load config from instead of passing arguments to CLI or using a Node.js " +
|
|
40
|
+
"script. See examples for syntax. This can also work in conjunction with `--git` or `--github` to point " +
|
|
41
|
+
"to remote files, and with `--key` to denote which key to select from the file.",
|
|
35
42
|
})
|
|
36
43
|
.option({
|
|
37
|
-
name: "
|
|
38
|
-
aliases: ["
|
|
39
|
-
description: "
|
|
44
|
+
name: "git",
|
|
45
|
+
aliases: ["g"],
|
|
46
|
+
description: "Git URL to load config from instead of passing arguments to CLI or using a Node.js script. See " +
|
|
47
|
+
"examples for syntax.",
|
|
40
48
|
})
|
|
41
49
|
.option({
|
|
42
50
|
name: "key",
|
|
43
51
|
aliases: ["k"],
|
|
44
|
-
description: "Key to load inside the config file. This overwrites the config key provided after the colon in
|
|
52
|
+
description: "Key to load inside the config file. This overwrites the config key provided after the colon in `--config` " +
|
|
53
|
+
"(e.g. `--config scaffold.cmd.js:component)`",
|
|
45
54
|
})
|
|
46
55
|
.option({
|
|
47
56
|
name: "output",
|
|
48
57
|
aliases: ["o"],
|
|
49
|
-
description:
|
|
58
|
+
description: "Path to output to. If `--subdir` is enabled, the subfolder will be created inside " +
|
|
59
|
+
"this path. Default is current working directory.",
|
|
50
60
|
required: !isConfigProvided,
|
|
51
61
|
})
|
|
52
62
|
.option({
|
|
53
63
|
name: "templates",
|
|
54
64
|
aliases: ["t"],
|
|
55
65
|
array: true,
|
|
56
|
-
description: "Template files to use as input. You may provide multiple files, each of which can be a relative or
|
|
66
|
+
description: "Template files to use as input. You may provide multiple files, each of which can be a relative or " +
|
|
67
|
+
"absolute path, " +
|
|
57
68
|
"or a glob pattern for multiple file matching easily.",
|
|
58
69
|
required: !isConfigProvided,
|
|
59
70
|
})
|
|
60
|
-
.
|
|
71
|
+
.flag({
|
|
61
72
|
name: "overwrite",
|
|
62
73
|
aliases: ["w"],
|
|
63
|
-
boolean: true,
|
|
64
74
|
defaultValue: false,
|
|
65
75
|
description: "Enable to override output files, even if they already exist.",
|
|
76
|
+
negatable: true,
|
|
66
77
|
})
|
|
67
78
|
.option({
|
|
68
79
|
name: "data",
|
|
@@ -73,90 +84,83 @@ async function parseCliArgs(args = process.argv.slice(2)) {
|
|
|
73
84
|
.option({
|
|
74
85
|
name: "append-data",
|
|
75
86
|
aliases: ["D"],
|
|
76
|
-
description: "Append additional custom data to the templates, which will overwrite
|
|
87
|
+
description: "Append additional custom data to the templates, which will overwrite `--data`, using an alternate syntax, " +
|
|
88
|
+
"which is easier to use with CLI: `-D key1=string -D key2:=raw`",
|
|
77
89
|
parse: config_1.parseAppendData,
|
|
78
90
|
})
|
|
79
|
-
.
|
|
80
|
-
name: "
|
|
91
|
+
.flag({
|
|
92
|
+
name: "subdir",
|
|
81
93
|
aliases: ["s"],
|
|
82
|
-
boolean: true,
|
|
83
94
|
defaultValue: false,
|
|
84
|
-
description: "Create
|
|
95
|
+
description: "Create a parent directory with the input name (and possibly `--subdir-helper`",
|
|
96
|
+
negatable: true,
|
|
97
|
+
negationName: "no-subdir",
|
|
85
98
|
})
|
|
86
99
|
.option({
|
|
87
|
-
name: "
|
|
88
|
-
aliases: ["
|
|
89
|
-
description: "Default helper to apply to subfolder name when using `--
|
|
100
|
+
name: "subdir-helper",
|
|
101
|
+
aliases: ["H"],
|
|
102
|
+
description: "Default helper to apply to subfolder name when using `--subdir`.",
|
|
90
103
|
})
|
|
91
|
-
.
|
|
104
|
+
.flag({
|
|
92
105
|
name: "quiet",
|
|
93
106
|
aliases: ["q"],
|
|
94
|
-
boolean: true,
|
|
95
107
|
defaultValue: false,
|
|
96
|
-
description: "Suppress output logs (Same as
|
|
108
|
+
description: "Suppress output logs (Same as `--log-level none`)",
|
|
97
109
|
})
|
|
98
110
|
.option({
|
|
99
|
-
name: "
|
|
100
|
-
aliases: ["
|
|
101
|
-
defaultValue: types_1.LogLevel.
|
|
111
|
+
name: "log-level",
|
|
112
|
+
aliases: ["l"],
|
|
113
|
+
defaultValue: types_1.LogLevel.info,
|
|
102
114
|
description: "Determine amount of logs to display. The values are: " +
|
|
103
|
-
`${chalk_1.default.bold
|
|
115
|
+
`${chalk_1.default.bold `\`none | debug | info | warn | error\``}. ` +
|
|
104
116
|
"The provided level will display messages of the same level or higher.",
|
|
105
117
|
parse: Number,
|
|
106
118
|
})
|
|
107
|
-
.
|
|
119
|
+
.flag({
|
|
108
120
|
name: "dry-run",
|
|
109
121
|
aliases: ["dr"],
|
|
110
|
-
boolean: true,
|
|
111
122
|
defaultValue: false,
|
|
112
123
|
description: "Don't emit files. This is good for testing your scaffolds and making sure they " +
|
|
113
124
|
"don't fail, without having to write actual file contents or create directories.",
|
|
114
125
|
})
|
|
115
|
-
// .example({
|
|
116
|
-
// input: `yarn cmd -t examples/test-input/Component -o examples/test-output -d '{"property":"myProp","value":"10"}'`,
|
|
117
|
-
// description: "Usage",
|
|
118
|
-
// output: "",
|
|
119
|
-
// })
|
|
120
126
|
.example({
|
|
121
127
|
description: "Usage with config file",
|
|
122
128
|
input: "simple-scaffold -c scaffold.cmd.js --key component",
|
|
123
129
|
})
|
|
124
130
|
.example({
|
|
125
131
|
description: "Usage with GitHub config file",
|
|
126
|
-
input: "simple-scaffold -
|
|
132
|
+
input: "simple-scaffold -g chenasraf/simple-scaffold --key component",
|
|
127
133
|
})
|
|
128
134
|
.example({
|
|
129
135
|
description: "Usage with https git URL (for non-GitHub)",
|
|
130
|
-
input: "simple-scaffold -
|
|
131
|
-
})
|
|
132
|
-
.example({
|
|
133
|
-
description: "Full syntax with config path and template key (applicable to all above methods)",
|
|
134
|
-
input: "simple-scaffold -c scaffold.cmd.js:component MyComponent",
|
|
136
|
+
input: "simple-scaffold -g https://example.com/user/template.git -c scaffold.cmd.js --key component",
|
|
135
137
|
})
|
|
136
138
|
.example({
|
|
137
139
|
description: "Excluded template key, assumes 'default' key",
|
|
138
140
|
input: "simple-scaffold -c scaffold.cmd.js MyComponent",
|
|
139
141
|
})
|
|
140
142
|
.example({
|
|
141
|
-
description: "Shortest syntax for GitHub,
|
|
142
|
-
input: "simple-scaffold -
|
|
143
|
+
description: "Shortest syntax for GitHub, searches for config file automaticlly, assumes and template key 'default'",
|
|
144
|
+
input: "simple-scaffold -g chenasraf/simple-scaffold MyComponent",
|
|
143
145
|
})
|
|
144
146
|
.help({
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
147
|
+
bindOption: true,
|
|
148
|
+
lineLength: 100,
|
|
149
|
+
useGlobalTableColumns: true,
|
|
150
|
+
usageText: [chalk_1.default.yellow `simple-scaffold`, chalk_1.default.gray `[options]`, chalk_1.default.cyan `<name>`].join(" "),
|
|
151
|
+
optionOptions: {
|
|
152
|
+
displayNegations: true,
|
|
153
|
+
},
|
|
154
|
+
footerText: [
|
|
151
155
|
`Version: ${pkg.version}`,
|
|
152
156
|
`Copyright © Chen Asraf 2017-${new Date().getFullYear()}`,
|
|
153
157
|
``,
|
|
154
|
-
`Documentation:
|
|
155
|
-
`NPM:
|
|
156
|
-
`GitHub:
|
|
158
|
+
`Documentation: ${chalk_1.default.underline `https://chenasraf.github.io/simple-scaffold`}`,
|
|
159
|
+
`NPM: ${chalk_1.default.underline `https://npmjs.com/package/simple-scaffold`}`,
|
|
160
|
+
`GitHub: ${chalk_1.default.underline `https://github.com/chenasraf/simple-scaffold`}`,
|
|
157
161
|
].join("\n"),
|
|
158
162
|
})
|
|
159
|
-
.parse(args)
|
|
163
|
+
.parse(args);
|
|
160
164
|
}
|
|
161
165
|
exports.parseCliArgs = parseCliArgs;
|
|
162
166
|
parseCliArgs();
|
package/cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmd.js","sourceRoot":"","sources":["../src/cmd.ts"],"names":[],"mappings":";;;;;;;AACA,
|
|
1
|
+
{"version":3,"file":"cmd.js","sourceRoot":"","sources":["../src/cmd.ts"],"names":[],"mappings":";;;;;;;AACA,qCAAiC;AACjC,kDAAyB;AACzB,mCAAqD;AACrD,yCAAqC;AACrC,0DAA4B;AAC5B,gEAAiC;AACjC,qCAA2D;AAEpD,KAAK,UAAU,YAAY,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7D,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,kBAAE,CAAC,IAAI,CAAC,mBAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;IACrG,MAAM,OAAO,GAAG,MAAM,kBAAE,CAAC,QAAQ,CAAC,mBAAI,CAAC,OAAO,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,CAAA;IACtG,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC1C,MAAM,gBAAgB,GACpB,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IA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5E,CAAC,IAAI,CAAC,IAAI,CAAC;KACb,CAAC;SACD,KAAK,CAAC,IAAI,CAAC,CAAA;AAChB,CAAC;AAjKD,oCAiKC;AAED,YAAY,EAAE,CAAA"}
|
package/config.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ConfigLoadConfig, FileResponse, ScaffoldCmdConfig, ScaffoldConfig, ScaffoldConfigFile } from "./types";
|
|
1
|
+
import { ConfigLoadConfig, FileResponse, LogConfig, RemoteConfigLoadConfig, ScaffoldCmdConfig, ScaffoldConfig, ScaffoldConfigFile } from "./types";
|
|
2
|
+
/** @internal */
|
|
2
3
|
export declare function getOptionValueForFile<T>(config: ScaffoldConfig, filePath: string, fn: FileResponse<T>, defaultValue?: T): T;
|
|
4
|
+
/** @internal */
|
|
3
5
|
export declare function parseAppendData(value: string, options: ScaffoldCmdConfig): unknown;
|
|
4
6
|
/** @internal */
|
|
5
7
|
export declare function parseConfigFile(config: ScaffoldCmdConfig): Promise<ScaffoldConfig>;
|
|
6
|
-
|
|
7
|
-
configFile: string;
|
|
8
|
-
key: string;
|
|
9
|
-
isRemote: boolean;
|
|
10
|
-
};
|
|
8
|
+
/** @internal */
|
|
11
9
|
export declare function githubPartToUrl(part: string): string;
|
|
12
10
|
/** @internal */
|
|
13
|
-
export declare function
|
|
11
|
+
export declare function getLocalConfig(config: ConfigLoadConfig & Partial<LogConfig>): Promise<ScaffoldConfigFile>;
|
|
12
|
+
/** @internal */
|
|
13
|
+
export declare function getRemoteConfig(config: RemoteConfigLoadConfig & Partial<LogConfig>): Promise<ScaffoldConfigFile>;
|
package/config.js
CHANGED
|
@@ -26,13 +26,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
29
|
+
exports.getRemoteConfig = exports.getLocalConfig = exports.githubPartToUrl = exports.parseConfigFile = exports.parseAppendData = exports.getOptionValueForFile = void 0;
|
|
30
30
|
const node_path_1 = __importDefault(require("node:path"));
|
|
31
31
|
const types_1 = require("./types");
|
|
32
32
|
const parser_1 = require("./parser");
|
|
33
33
|
const logger_1 = require("./logger");
|
|
34
34
|
const utils_1 = require("./utils");
|
|
35
35
|
const git_1 = require("./git");
|
|
36
|
+
/** @internal */
|
|
36
37
|
function getOptionValueForFile(config, filePath, fn, defaultValue) {
|
|
37
38
|
if (typeof fn !== "function") {
|
|
38
39
|
return defaultValue ?? fn;
|
|
@@ -40,6 +41,7 @@ function getOptionValueForFile(config, filePath, fn, defaultValue) {
|
|
|
40
41
|
return fn(filePath, node_path_1.default.dirname((0, parser_1.handlebarsParse)(config, filePath, { isPath: true }).toString()), node_path_1.default.basename((0, parser_1.handlebarsParse)(config, filePath, { isPath: true }).toString()));
|
|
41
42
|
}
|
|
42
43
|
exports.getOptionValueForFile = getOptionValueForFile;
|
|
44
|
+
/** @internal */
|
|
43
45
|
function parseAppendData(value, options) {
|
|
44
46
|
const data = options.data ?? {};
|
|
45
47
|
const [key, val] = value.split(/\:?=/);
|
|
@@ -55,29 +57,35 @@ function isWrappedWithQuotes(string) {
|
|
|
55
57
|
}
|
|
56
58
|
/** @internal */
|
|
57
59
|
async function parseConfigFile(config) {
|
|
58
|
-
let
|
|
59
|
-
if (config.
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
let output = config;
|
|
61
|
+
if (config.quiet) {
|
|
62
|
+
config.logLevel = types_1.LogLevel.none;
|
|
63
|
+
}
|
|
64
|
+
if (config.git && !config.git.includes("://")) {
|
|
65
|
+
(0, logger_1.log)(config, types_1.LogLevel.info, `Loading config from GitHub ${config.git}`);
|
|
66
|
+
config.git = githubPartToUrl(config.git);
|
|
62
67
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
const shouldLoadConfig = config.config || config.git;
|
|
69
|
+
if (shouldLoadConfig) {
|
|
70
|
+
const isGit = Boolean(config.git);
|
|
71
|
+
const key = config.key ?? "default";
|
|
72
|
+
const configFilename = config.config;
|
|
73
|
+
const configPath = isGit ? config.git : configFilename;
|
|
74
|
+
(0, logger_1.log)(config, types_1.LogLevel.info, `Loading config from ${configFilename} with key ${key}`);
|
|
75
|
+
const configPromise = await (config.git
|
|
76
|
+
? getRemoteConfig({ git: configPath, config: configFilename, logLevel: config.logLevel })
|
|
77
|
+
: getLocalConfig({ config: configFilename, logLevel: config.logLevel }));
|
|
78
|
+
// resolve the config
|
|
72
79
|
let configImport = await (0, utils_1.resolve)(configPromise, config);
|
|
80
|
+
// If the config is a function or promise, return the output
|
|
73
81
|
if (typeof configImport.default === "function" || configImport.default instanceof Promise) {
|
|
74
82
|
configImport = await (0, utils_1.resolve)(configImport.default, config);
|
|
75
83
|
}
|
|
76
84
|
if (!configImport[key]) {
|
|
77
|
-
throw new Error(`Template "${key}" not found in ${
|
|
85
|
+
throw new Error(`Template "${key}" not found in ${configFilename}`);
|
|
78
86
|
}
|
|
79
87
|
const importedKey = configImport[key];
|
|
80
|
-
|
|
88
|
+
output = {
|
|
81
89
|
...config,
|
|
82
90
|
...importedKey,
|
|
83
91
|
data: {
|
|
@@ -86,22 +94,12 @@ async function parseConfigFile(config) {
|
|
|
86
94
|
},
|
|
87
95
|
};
|
|
88
96
|
}
|
|
89
|
-
|
|
97
|
+
output.data = { ...output.data, ...config.appendData };
|
|
90
98
|
delete config.appendData;
|
|
91
|
-
return
|
|
99
|
+
return output;
|
|
92
100
|
}
|
|
93
101
|
exports.parseConfigFile = parseConfigFile;
|
|
94
|
-
|
|
95
|
-
const isUrl = config.includes("://");
|
|
96
|
-
const hasColonToken = (!isUrl && config.includes(":")) || (isUrl && count(config, ":") > 1);
|
|
97
|
-
const colonIndex = config.lastIndexOf(":");
|
|
98
|
-
const [configFile, templateKey = "default"] = hasColonToken
|
|
99
|
-
? [config.substring(0, colonIndex), config.substring(colonIndex + 1)]
|
|
100
|
-
: [config, undefined];
|
|
101
|
-
const _key = (key ?? templateKey) || "default";
|
|
102
|
-
return { configFile, key: _key, isRemote: isUrl };
|
|
103
|
-
}
|
|
104
|
-
exports.parseConfigSelection = parseConfigSelection;
|
|
102
|
+
/** @internal */
|
|
105
103
|
function githubPartToUrl(part) {
|
|
106
104
|
const gitUrl = new URL(`https://github.com/${part}`);
|
|
107
105
|
if (!gitUrl.pathname.endsWith(".git")) {
|
|
@@ -111,26 +109,24 @@ function githubPartToUrl(part) {
|
|
|
111
109
|
}
|
|
112
110
|
exports.githubPartToUrl = githubPartToUrl;
|
|
113
111
|
/** @internal */
|
|
114
|
-
async function
|
|
115
|
-
const { config: configFile,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
112
|
+
async function getLocalConfig(config) {
|
|
113
|
+
const { config: configFile, ...logConfig } = config;
|
|
114
|
+
(0, logger_1.log)(logConfig, types_1.LogLevel.info, `Loading config from file ${configFile}`);
|
|
115
|
+
const absolutePath = node_path_1.default.resolve(process.cwd(), configFile);
|
|
116
|
+
return (0, utils_1.wrapNoopResolver)(Promise.resolve(`${absolutePath}`).then(s => __importStar(require(s))));
|
|
117
|
+
}
|
|
118
|
+
exports.getLocalConfig = getLocalConfig;
|
|
119
|
+
/** @internal */
|
|
120
|
+
async function getRemoteConfig(config) {
|
|
121
|
+
const { config: configFile, git, ...logConfig } = config;
|
|
122
|
+
(0, logger_1.log)(logConfig, types_1.LogLevel.info, `Loading config from remote ${git}, file ${configFile}`);
|
|
123
|
+
const url = new URL(git);
|
|
122
124
|
const isHttp = url.protocol === "http:" || url.protocol === "https:";
|
|
123
125
|
const isGit = url.protocol === "git:" || (isHttp && url.pathname.endsWith(".git"));
|
|
124
|
-
if (isGit) {
|
|
125
|
-
return (0, git_1.getGitConfig)(url, logConfig);
|
|
126
|
-
}
|
|
127
|
-
if (!isHttp) {
|
|
126
|
+
if (!isGit) {
|
|
128
127
|
throw new Error(`Unsupported protocol ${url.protocol}`);
|
|
129
128
|
}
|
|
130
|
-
return (0,
|
|
131
|
-
}
|
|
132
|
-
exports.getConfig = getConfig;
|
|
133
|
-
function count(string, substring) {
|
|
134
|
-
return string.split(substring).length - 1;
|
|
129
|
+
return (0, git_1.getGitConfig)(url, configFile, logConfig);
|
|
135
130
|
}
|
|
131
|
+
exports.getRemoteConfig = getRemoteConfig;
|
|
136
132
|
//# sourceMappingURL=config.js.map
|
package/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4B;AAC5B,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4B;AAC5B,mCAUgB;AAChB,qCAA0C;AAC1C,qCAA8B;AAC9B,mCAAmD;AACnD,+BAAoC;AAEpC,gBAAgB;AAChB,SAAgB,qBAAqB,CACnC,MAAsB,EACtB,QAAgB,EAChB,EAAmB,EACnB,YAAgB;IAEhB,IAAI,OAAO,EAAE,KAAK,UAAU,EAAE,CAAC;QAC7B,OAAO,YAAY,IAAK,EAAQ,CAAA;IAClC,CAAC;IACD,OAAQ,EAA6B,CACnC,QAAQ,EACR,mBAAI,CAAC,OAAO,CAAC,IAAA,wBAAe,EAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,EAC5E,mBAAI,CAAC,QAAQ,CAAC,IAAA,wBAAe,EAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAC9E,CAAA;AACH,CAAC;AAd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