create-gasket-app 7.0.4 → 7.0.9

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.
@@ -1,20 +1,18 @@
1
1
  /**
2
2
  * isValidArg - Validates the argument configuration
3
- * @param {CLICommandArg} arg The argument configuration
4
- * @returns {boolean} True if valid, false otherwise
3
+ * @type {import('../internal').isValidArg}
5
4
  */
6
5
  function isValidArg(arg) {
7
6
  const keys = Object.keys(arg);
8
7
  if (arg.required && arg.default) return false;
9
- return keys.length &&
10
- keys.length <= 4 &&
11
- arg.name && arg.description;
8
+ return !!keys.length &&
9
+ !!(keys.length <= 4) &&
10
+ !!arg.name && !!arg.description;
12
11
  }
13
12
 
14
13
  /**
15
14
  * processArgs - Process the arguments configuration
16
- * @param {CLICommandArg[]} args Array of argument configurations
17
- * @returns {ProccesedCLICommandArg[]} Array of argument definitions
15
+ * @type {import('../internal').processArgs}
18
16
  */
19
17
  export function processArgs(args) {
20
18
  if (!Array.isArray(args) || !args.every(isValidArg)) throw new Error('Invalid argument(s) configuration');
@@ -6,8 +6,7 @@ const program = new Command();
6
6
 
7
7
  /**
8
8
  * isValidCommand - Validates the command configuration
9
- * @param {CLICommand} command The command configuration
10
- * @returns {boolean} True if valid, false otherwise
9
+ * @type {import('../internal').isValidCommand}
11
10
  */
12
11
  function isValidCommand(command) {
13
12
  const keys = Object.keys(command);
@@ -22,8 +21,7 @@ function isValidCommand(command) {
22
21
 
23
22
  /**
24
23
  * processCommand - Process the command configuration
25
- * @param {CLICommand} command The command configuration
26
- * @returns {ProccesedCLICommand} The command instance
24
+ * @type {import('../internal').processCommand}
27
25
  */
28
26
  export function processCommand(command) {
29
27
  if (!isValidCommand(command)) throw new Error('Invalid command configuration');
@@ -1,20 +1,18 @@
1
1
  /**
2
2
  * isValidOption - Validate the option
3
- * @param {CLICommandOption} option The option configuration
4
- * @returns {boolean} True if valid, false otherwise
3
+ * @type {import('../internal').isValidOption}
5
4
  */
6
5
  function isValidOption(option) {
7
6
  const keys = Object.keys(option);
8
- return keys.length &&
9
- keys.length <= 5 &&
10
- option.name &&
11
- option.description;
7
+ return !!keys.length &&
8
+ !!(keys.length <= 5) &&
9
+ !!option.name &&
10
+ !!option.description;
12
11
  }
13
12
 
14
13
  /**
15
14
  * processOptions - Process the options configuration
16
- * @param {CLICommandOption[]} options Array of option configurations
17
- * @returns {ProccesedCLICommandOption[]} Processed option definitions
15
+ * @type {import('../internal').processOptions}
18
16
  */
19
17
  export function processOptions(options) {
20
18
  if (!Array.isArray(options) || !options.every(isValidOption)) throw new Error('Invalid option(s) configuration');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-gasket-app",
3
- "version": "7.0.4",
3
+ "version": "7.0.9",
4
4
  "description": "starter pack for creating a gasket app",
5
5
  "type": "module",
6
6
  "bin": {
@@ -17,7 +17,9 @@
17
17
  "test": "cross-env NODE_OPTIONS='--unhandled-rejections=strict --experimental-vm-modules' jest",
18
18
  "test:watch": "npm run test -- --watch",
19
19
  "test:coverage": "jest --coverage",
20
- "posttest": "npm run lint"
20
+ "typecheck": "tsc",
21
+ "typecheck:watch": "tsc --watch",
22
+ "posttest": "npm run lint && npm run typecheck"
21
23
  },
22
24
  "repository": {
23
25
  "type": "git",
@@ -33,14 +35,14 @@
33
35
  },
34
36
  "homepage": "https://github.com/godaddy/gasket/tree/main/packages/create-gasket-app",
35
37
  "dependencies": {
36
- "@gasket/core": "^7.0.1",
37
- "@gasket/plugin-command": "^7.0.1",
38
- "@gasket/plugin-docs": "^7.0.4",
39
- "@gasket/plugin-docusaurus": "^7.0.3",
40
- "@gasket/plugin-git": "^7.0.1",
41
- "@gasket/plugin-logger": "^7.0.4",
42
- "@gasket/plugin-metadata": "^7.0.4",
43
- "@gasket/utils": "^7.0.1",
38
+ "@gasket/core": "^7.0.9",
39
+ "@gasket/plugin-command": "^7.0.9",
40
+ "@gasket/plugin-docs": "^7.0.9",
41
+ "@gasket/plugin-docusaurus": "^7.0.9",
42
+ "@gasket/plugin-git": "^7.0.9",
43
+ "@gasket/plugin-logger": "^7.0.9",
44
+ "@gasket/plugin-metadata": "^7.0.9",
45
+ "@gasket/utils": "^7.0.9",
44
46
  "commander": "^12.0.0",
45
47
  "deepmerge": "^4.3.1",
46
48
  "glob": "^8.1.0",
@@ -69,10 +71,12 @@
69
71
  "eslintConfig": {
70
72
  "extends": [
71
73
  "godaddy",
72
- "plugin:jest/recommended"
74
+ "plugin:jest/recommended",
75
+ "plugin:jsdoc/recommended-typescript-flavor"
73
76
  ],
74
77
  "plugins": [
75
- "unicorn"
78
+ "unicorn",
79
+ "jsdoc"
76
80
  ],
77
81
  "rules": {
78
82
  "unicorn/filename-case": "error"
@@ -84,5 +88,5 @@
84
88
  "jest": {
85
89
  "transform": {}
86
90
  },
87
- "gitHead": "af49c0e42e7947e000faa771777b815b90aaffa3"
91
+ "gitHead": "ff3acd042a9a22cd43ac29c6b064bd2f49304b9e"
88
92
  }