@goldstack/utils-package-config-generate 0.3.0 → 0.3.1

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,2 +1,2 @@
1
- export declare const run: (argv: string[]) => void;
1
+ export declare const run: (argv: string[]) => void;
2
2
  //# sourceMappingURL=utilsPackageConfigGenerate.d.ts.map
@@ -1,36 +1,36 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.run = void 0;
7
- // eslint-disable-next-line @typescript-eslint/no-var-requires
8
- const tsj = require('ts-json-schema-generator');
9
- const fs_1 = __importDefault(require("fs"));
10
- const run = (argv) => {
11
- if (!fs_1.default.existsSync('schemas/')) {
12
- throw new Error('Ensure that directory schemas/ exists in project');
13
- }
14
- const generateSchema = (schemaFile, type) => {
15
- const config = {
16
- // path: 'src/lib/types/*',
17
- tsconfig: 'tsconfig.generate.json',
18
- skipTypeCheck: true,
19
- type,
20
- };
21
- const outputPath = `schemas/${schemaFile}`;
22
- const schema = tsj.createGenerator(config).createSchema(config.type);
23
- const schemaString = JSON.stringify(schema, null, 2);
24
- fs_1.default.writeFileSync(outputPath, schemaString);
25
- };
26
- let prefix = 'This';
27
- if (argv.length > 2) {
28
- prefix = argv[2];
29
- }
30
- generateSchema('deployment.schema.json', `${prefix}Deployment`);
31
- generateSchema('package.schema.json', `${prefix}Package`);
32
- generateSchema('package-configuration.schema.json', `${prefix}PackageConfiguration`);
33
- generateSchema('deployment-configuration.schema.json', `${prefix}DeploymentConfiguration`);
34
- };
35
- exports.run = run;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.run = void 0;
7
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
8
+ const tsj = require('ts-json-schema-generator');
9
+ const fs_1 = __importDefault(require("fs"));
10
+ const run = (argv) => {
11
+ if (!fs_1.default.existsSync('schemas/')) {
12
+ throw new Error('Ensure that directory schemas/ exists in project');
13
+ }
14
+ const generateSchema = (schemaFile, type) => {
15
+ const config = {
16
+ // path: 'src/lib/types/*',
17
+ tsconfig: 'tsconfig.generate.json',
18
+ skipTypeCheck: true,
19
+ type,
20
+ };
21
+ const outputPath = `schemas/${schemaFile}`;
22
+ const schema = tsj.createGenerator(config).createSchema(config.type);
23
+ const schemaString = JSON.stringify(schema, null, 2);
24
+ fs_1.default.writeFileSync(outputPath, schemaString);
25
+ };
26
+ let prefix = 'This';
27
+ if (argv.length > 2) {
28
+ prefix = argv[2];
29
+ }
30
+ generateSchema('deployment.schema.json', `${prefix}Deployment`);
31
+ generateSchema('package.schema.json', `${prefix}Package`);
32
+ generateSchema('package-configuration.schema.json', `${prefix}PackageConfiguration`);
33
+ generateSchema('deployment-configuration.schema.json', `${prefix}DeploymentConfiguration`);
34
+ };
35
+ exports.run = run;
36
36
  //# sourceMappingURL=utilsPackageConfigGenerate.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goldstack/utils-package-config-generate",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Utilities for working with package schemas.",
5
5
  "keywords": [
6
6
  "goldstack",
@@ -39,7 +39,7 @@
39
39
  "yargs": "^17.5.1"
40
40
  },
41
41
  "devDependencies": {
42
- "@goldstack/utils-git": "0.2.0",
42
+ "@goldstack/utils-git": "0.2.1",
43
43
  "@types/jest": "^28.1.8",
44
44
  "@types/node": "^18.7.13",
45
45
  "@types/yargs": "^17.0.10",