@goldstack/utils-template 0.4.0 → 0.4.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,41 +1,41 @@
1
- /**
2
- * This file was automatically generated by json-schema-to-typescript.
3
- * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
- * and run json-schema-to-typescript to regenerate this file.
5
- */
6
- /**
7
- * Name of the template.
8
- */
9
- export declare type Template = string;
10
- /**
11
- * Version of this template.
12
- */
13
- export declare type TemplateVersion = string;
14
- /**
15
- * Previous version of this template.
16
- */
17
- export declare type PreviousTemplateVersion = string;
18
- /**
19
- * A description of this template.
20
- */
21
- export declare type Description = string;
22
- /**
23
- * Link to template documentation.
24
- */
25
- export declare type Documentation = string;
26
- /**
27
- * Path to the ZIP file for this template.
28
- */
29
- export declare type TemplateArchive = string;
30
- /**
31
- * Configures a Goldstack template.
32
- */
33
- export interface GoldstackTemplateConfiguration {
34
- templateName: Template;
35
- templateVersion: TemplateVersion;
36
- previousTemplateVersion: PreviousTemplateVersion;
37
- templateDescription: Description;
38
- templateDocumentation: Documentation;
39
- templateArchive: TemplateArchive;
40
- }
1
+ /**
2
+ * This file was automatically generated by json-schema-to-typescript.
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
+ * and run json-schema-to-typescript to regenerate this file.
5
+ */
6
+ /**
7
+ * Name of the template.
8
+ */
9
+ export declare type Template = string;
10
+ /**
11
+ * Version of this template.
12
+ */
13
+ export declare type TemplateVersion = string;
14
+ /**
15
+ * Previous version of this template.
16
+ */
17
+ export declare type PreviousTemplateVersion = string;
18
+ /**
19
+ * A description of this template.
20
+ */
21
+ export declare type Description = string;
22
+ /**
23
+ * Link to template documentation.
24
+ */
25
+ export declare type Documentation = string;
26
+ /**
27
+ * Path to the ZIP file for this template.
28
+ */
29
+ export declare type TemplateArchive = string;
30
+ /**
31
+ * Configures a Goldstack template.
32
+ */
33
+ export interface GoldstackTemplateConfiguration {
34
+ templateName: Template;
35
+ templateVersion: TemplateVersion;
36
+ previousTemplateVersion: PreviousTemplateVersion;
37
+ templateDescription: Description;
38
+ templateDocumentation: Documentation;
39
+ templateArchive: TemplateArchive;
40
+ }
41
41
  //# sourceMappingURL=goldstackTemplateConfigurationSchema.d.ts.map
@@ -1,9 +1,9 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /**
4
- * This file was automatically generated by json-schema-to-typescript.
5
- * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
6
- * and run json-schema-to-typescript to regenerate this file.
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /**
4
+ * This file was automatically generated by json-schema-to-typescript.
5
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
6
+ * and run json-schema-to-typescript to regenerate this file.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
9
  //# sourceMappingURL=goldstackTemplateConfigurationSchema.js.map
@@ -1,48 +1,48 @@
1
- {
2
- "type": "object",
3
- "title": "Goldstack Template Configuration",
4
- "properties": {
5
- "templateName": {
6
- "type": "string",
7
- "title": "Template",
8
- "description": "Name of the template.",
9
- "pattern": "^[^\\s]*$"
10
- },
11
- "templateVersion": {
12
- "type": "string",
13
- "title": "Template Version",
14
- "description": "Version of this template.",
15
- "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"
16
- },
17
- "previousTemplateVersion": {
18
- "type": "string",
19
- "title": "Previous Template Version",
20
- "description": "Previous version of this template."
21
- },
22
- "templateDescription": {
23
- "type": "string",
24
- "title": "Description",
25
- "description": "A description of this template."
26
- },
27
- "templateDocumentation": {
28
- "type": "string",
29
- "title": "Documentation",
30
- "description": "Link to template documentation."
31
- },
32
- "templateArchive": {
33
- "type": "string",
34
- "title": "Template Archive",
35
- "description": "S3 ARN to the ZIP file for this template."
36
- }
37
- },
38
- "description": "Configures a Goldstack template.",
39
- "additionalProperties": false,
40
- "required": [
41
- "templateName",
42
- "templateVersion",
43
- "templateDescription",
44
- "templateDocumentation",
45
- "previousTemplateVersion",
46
- "templateArchive"
47
- ]
48
- }
1
+ {
2
+ "type": "object",
3
+ "title": "Goldstack Template Configuration",
4
+ "properties": {
5
+ "templateName": {
6
+ "type": "string",
7
+ "title": "Template",
8
+ "description": "Name of the template.",
9
+ "pattern": "^[^\\s]*$"
10
+ },
11
+ "templateVersion": {
12
+ "type": "string",
13
+ "title": "Template Version",
14
+ "description": "Version of this template.",
15
+ "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"
16
+ },
17
+ "previousTemplateVersion": {
18
+ "type": "string",
19
+ "title": "Previous Template Version",
20
+ "description": "Previous version of this template."
21
+ },
22
+ "templateDescription": {
23
+ "type": "string",
24
+ "title": "Description",
25
+ "description": "A description of this template."
26
+ },
27
+ "templateDocumentation": {
28
+ "type": "string",
29
+ "title": "Documentation",
30
+ "description": "Link to template documentation."
31
+ },
32
+ "templateArchive": {
33
+ "type": "string",
34
+ "title": "Template Archive",
35
+ "description": "S3 ARN to the ZIP file for this template."
36
+ }
37
+ },
38
+ "description": "Configures a Goldstack template.",
39
+ "additionalProperties": false,
40
+ "required": [
41
+ "templateName",
42
+ "templateVersion",
43
+ "templateDescription",
44
+ "templateDocumentation",
45
+ "previousTemplateVersion",
46
+ "templateArchive"
47
+ ]
48
+ }
@@ -1,5 +1,5 @@
1
- import { GoldstackTemplateConfiguration } from './generated/goldstackTemplateConfigurationSchema';
2
- export type { GoldstackTemplateConfiguration } from './generated/goldstackTemplateConfigurationSchema';
3
- export declare const readTemplateConfigFromString: (data: string) => GoldstackTemplateConfiguration;
4
- export declare const readTemplateConfigFromFile: (path?: string) => GoldstackTemplateConfiguration;
1
+ import { GoldstackTemplateConfiguration } from './generated/goldstackTemplateConfigurationSchema';
2
+ export type { GoldstackTemplateConfiguration } from './generated/goldstackTemplateConfigurationSchema';
3
+ export declare const readTemplateConfigFromString: (data: string) => GoldstackTemplateConfiguration;
4
+ export declare const readTemplateConfigFromFile: (path?: string) => GoldstackTemplateConfiguration;
5
5
  //# sourceMappingURL=utilsTemplate.d.ts.map
@@ -1,27 +1,27 @@
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.readTemplateConfigFromFile = exports.readTemplateConfigFromString = void 0;
7
- const utils_config_1 = require("@goldstack/utils-config");
8
- const goldstackTemplateConfigurationSchema_json_1 = __importDefault(require("./schemas/goldstackTemplateConfigurationSchema.json"));
9
- const utils_sh_1 = require("@goldstack/utils-sh");
10
- const readTemplateConfigFromString = (data) => {
11
- const config = (0, utils_config_1.parseConfig)(data, goldstackTemplateConfigurationSchema_json_1.default, {
12
- errorMessage: 'Cannot load template config.',
13
- });
14
- return config;
15
- };
16
- exports.readTemplateConfigFromString = readTemplateConfigFromString;
17
- const readTemplateConfigFromFile = (path = 'template.json') => {
18
- try {
19
- const data = (0, utils_sh_1.read)(path);
20
- return (0, exports.readTemplateConfigFromString)(data);
21
- }
22
- catch (e) {
23
- throw new Error(`Cannot load template config from ${path}. Error: ${e.message}`);
24
- }
25
- };
26
- exports.readTemplateConfigFromFile = readTemplateConfigFromFile;
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.readTemplateConfigFromFile = exports.readTemplateConfigFromString = void 0;
7
+ const utils_config_1 = require("@goldstack/utils-config");
8
+ const goldstackTemplateConfigurationSchema_json_1 = __importDefault(require("./schemas/goldstackTemplateConfigurationSchema.json"));
9
+ const utils_sh_1 = require("@goldstack/utils-sh");
10
+ const readTemplateConfigFromString = (data) => {
11
+ const config = (0, utils_config_1.parseConfig)(data, goldstackTemplateConfigurationSchema_json_1.default, {
12
+ errorMessage: 'Cannot load template config.',
13
+ });
14
+ return config;
15
+ };
16
+ exports.readTemplateConfigFromString = readTemplateConfigFromString;
17
+ const readTemplateConfigFromFile = (path = 'template.json') => {
18
+ try {
19
+ const data = (0, utils_sh_1.read)(path);
20
+ return (0, exports.readTemplateConfigFromString)(data);
21
+ }
22
+ catch (e) {
23
+ throw new Error(`Cannot load template config from ${path}. Error: ${e.message}`);
24
+ }
25
+ };
26
+ exports.readTemplateConfigFromFile = readTemplateConfigFromFile;
27
27
  //# sourceMappingURL=utilsTemplate.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goldstack/utils-template",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Utilities to work with Goldstack templates",
5
5
  "keywords": [
6
6
  "goldstack",
@@ -35,12 +35,12 @@
35
35
  "version:apply:force": "yarn version $@ && yarn version apply"
36
36
  },
37
37
  "dependencies": {
38
- "@goldstack/utils-config": "0.4.0",
39
- "@goldstack/utils-sh": "0.5.0"
38
+ "@goldstack/utils-config": "0.4.1",
39
+ "@goldstack/utils-sh": "0.5.1"
40
40
  },
41
41
  "devDependencies": {
42
- "@goldstack/utils-git": "0.2.0",
43
- "@goldstack/utils-json-to-ts": "0.4.0",
42
+ "@goldstack/utils-git": "0.2.1",
43
+ "@goldstack/utils-json-to-ts": "0.4.1",
44
44
  "@types/jest": "^28.1.8",
45
45
  "@types/node": "^18.7.13",
46
46
  "jest": "^28.1.0",