Skip to content

Commit d96992c

Browse files
committed
update deps + update cmd requirements
1 parent 9259939 commit d96992c

4 files changed

Lines changed: 35 additions & 31 deletions

File tree

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,11 @@ If you are a developer and want to contribute code, here are some starting tips:
240240

241241
1. Fork this repository
242242
2. Run `yarn install`
243-
3. Make any changes you would like
244-
4. Create tests for your changes, is possible
245-
5. Update the relevant documentation (readme, code comments, type comments)
246-
6. Create a PR on upstream
243+
3. Run `yarn dev` to start file watch mode
244+
4. Make any changes you would like
245+
5. Create tests for your changes
246+
6. Update the relevant documentation (readme, code comments, type comments)
247+
7. Create a PR on upstream
247248

248249
Some tips on getting around the code:
249250

@@ -253,6 +254,7 @@ Some tips on getting around the code:
253254
- Use `yarn test` to run tests
254255
- Use `yarn cmd` to use the CLI feature of Simple Scaffold from within the root directory,
255256
enabling you to test different behaviors. See `yarn cmd -h` for more information.
256-
This requires an updated build, and does not trigger one itself. Either use `yarn dev` or
257-
`yarn build` before running this, or use `yarn build-cmd` instead, which builds before running
258-
the cmd with args.
257+
258+
> This requires an updated build, and does not trigger one itself. Either use `yarn dev` or
259+
> `yarn build` before running this, or use `yarn build-cmd` instead, which triggers a build right
260+
> before running the command with the rest of the given arguments.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "simple-scaffold",
3-
"version": "1.0.0-alpha.11",
3+
"version": "1.0.0-alpha.12",
44
"description": "Create files based on templates",
55
"repository": "https://github.com/chenasraf/simple-scaffold.git",
66
"author": "Chen Asraf <inbox@casraf.com>",
@@ -23,7 +23,7 @@
2323
"glob": "^7.1.3",
2424
"handlebars": "^4.7.7",
2525
"lodash": "^4.17.21",
26-
"massarg": "^1.0.3",
26+
"massarg": "^1.0.4",
2727
"util.promisify": "^1.1.1"
2828
},
2929
"devDependencies": {

src/cmd_util.ts

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,67 +10,69 @@ export function parseCliArgs(args = process.argv.slice(2)) {
1010
.option({
1111
name: "name",
1212
aliases: ["n"],
13-
isDefault: true,
1413
description:
1514
"Name to be passed to the generated files. {{name}} and {{Name}} inside contents and file names will be replaced accordingly.",
15+
isDefault: true,
16+
required: true,
1617
})
1718
.option({
1819
name: "output",
1920
aliases: ["o"],
2021
description:
2122
"Path to output to. If --create-sub-folder is enabled, the subfolder will be created inside this path.",
23+
required: true,
2224
})
2325
.option({
2426
name: "templates",
2527
aliases: ["t"],
28+
array: true,
2629
description:
2730
"Template files to use as input. You may provide multiple files, each of which can be a relative or absolute path, " +
2831
"or a glob pattern for multiple file matching easily.",
29-
defaultValue: [],
30-
array: true,
32+
required: true,
3133
})
3234
.option({
33-
aliases: ["w"],
3435
name: "overwrite",
35-
description: "Enable to override output files, even if they already exist.",
36-
defaultValue: false,
36+
aliases: ["w"],
3737
boolean: true,
38+
defaultValue: false,
39+
description: "Enable to override output files, even if they already exist.",
3840
})
3941
.option({
40-
aliases: ["d"],
4142
name: "data",
43+
aliases: ["d"],
4244
description: "Add custom data to the templates. By default, only your app name is included.",
4345
parse: (v) => JSON.parse(v),
4446
})
4547
.option({
46-
aliases: ["s"],
4748
name: "create-sub-folder",
48-
description: "Create subfolder with the input name",
49-
defaultValue: false,
49+
aliases: ["s"],
5050
boolean: true,
51+
defaultValue: false,
52+
description: "Create subfolder with the input name",
5153
})
5254
.option({
53-
aliases: ["q"],
5455
name: "quiet",
55-
description: "Suppress output logs (Same as --verbose 0)",
56-
defaultValue: false,
56+
aliases: ["q"],
5757
boolean: true,
58+
defaultValue: false,
59+
description: "Suppress output logs (Same as --verbose 0)",
5860
})
5961
.option({
60-
aliases: ["v"],
6162
name: "verbose",
62-
description: `Determine amount of logs to display. The values are: ${chalk.bold`0 (none) | 1 (debug) | 2 (info) | 3 (warn) | 4 (error)`}. The provided level will display messages of the same level or higher.`,
63+
aliases: ["v"],
6364
defaultValue: LogLevel.Info,
65+
description: `Determine amount of logs to display. The values are: ${chalk.bold`0 (none) | 1 (debug) | 2 (info) | 3 (warn) | 4 (error)`}. The provided level will display messages of the same level or higher.`,
6466
parse: Number,
6567
})
6668
.option({
67-
aliases: ["dr"],
6869
name: "dry-run",
70+
aliases: ["dr"],
71+
boolean: true,
72+
defaultValue: false,
6973
description:
7074
"Don't emit files. This is good for testing your scaffolds and making sure they " +
7175
"don't fail, without having to write actual file contents or create directories.",
72-
defaultValue: false,
73-
boolean: true,
7476
})
7577
// .example({
7678
// input: `yarn cmd -t examples/test-input/Component -o examples/test-output -d '{"property":"myProp","value":"10"}'`,

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2161,10 +2161,10 @@ makeerror@1.0.x:
21612161
dependencies:
21622162
tmpl "1.0.x"
21632163

2164-
massarg@^1.0.3:
2165-
version "1.0.3"
2166-
resolved "https://registry.yarnpkg.com/massarg/-/massarg-1.0.3.tgz#228cf2d84896924b6b12021ea23ed9a9077e15b7"
2167-
integrity sha512-LYb4XvAQ+PbBClyfkn9B4JtfwycfpnOnGIznALt9YLnrmQaCcXXJBQsG5SA/2w+bmLOeYRoR9GqqFLyaniCn9g==
2164+
massarg@^1.0.4:
2165+
version "1.0.4"
2166+
resolved "https://registry.yarnpkg.com/massarg/-/massarg-1.0.4.tgz#8756193bee9bc7331b1f48a8840e86acf808f980"
2167+
integrity sha512-SakImNzZP8SN6tlcGBoC62z+12yv/To+h7KP8XapnOux5Mjiwprn4KhNHsjh2rbrKCAPqZQWYziAitSzGTkjMw==
21682168
dependencies:
21692169
chalk "^4.1.1"
21702170
lodash "^4.17.21"

0 commit comments

Comments
 (0)