@goldstack/utils-project 0.3.38 → 0.4.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.
|
@@ -1,112 +1,112 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$ref": "#/definitions/ProjectConfiguration",
|
|
3
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
-
"definitions": {
|
|
5
|
-
"PackageName": {
|
|
6
|
-
"description": "Name of the package.",
|
|
7
|
-
"type": "string"
|
|
8
|
-
},
|
|
9
|
-
"PackageProjectConfiguration": {
|
|
10
|
-
"additionalProperties": false,
|
|
11
|
-
"description": "Configuration for a package to be included.",
|
|
12
|
-
"properties": {
|
|
13
|
-
"packageName": {
|
|
14
|
-
"$ref": "#/definitions/PackageName"
|
|
15
|
-
},
|
|
16
|
-
"templateReference": {
|
|
17
|
-
"additionalProperties": false,
|
|
18
|
-
"description": "Reference to the template to be used for the package.",
|
|
19
|
-
"properties": {
|
|
20
|
-
"templateName": {
|
|
21
|
-
"$ref": "#/definitions/TemplateName"
|
|
22
|
-
},
|
|
23
|
-
"templateVersion": {
|
|
24
|
-
"$ref": "#/definitions/TemplateVersion1"
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
"required": [
|
|
28
|
-
"templateName"
|
|
29
|
-
],
|
|
30
|
-
"type": "object"
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
"required": [
|
|
34
|
-
"packageName",
|
|
35
|
-
"templateReference"
|
|
36
|
-
],
|
|
37
|
-
"type": "object"
|
|
38
|
-
},
|
|
39
|
-
"Packages": {
|
|
40
|
-
"description": "Packages to be included in the project.",
|
|
41
|
-
"items": {
|
|
42
|
-
"$ref": "#/definitions/PackageProjectConfiguration"
|
|
43
|
-
},
|
|
44
|
-
"type": "array"
|
|
45
|
-
},
|
|
46
|
-
"ProjectConfiguration": {
|
|
47
|
-
"additionalProperties": false,
|
|
48
|
-
"description": "Configuration for a Goldstack project.",
|
|
49
|
-
"properties": {
|
|
50
|
-
"createdAt": {
|
|
51
|
-
"type": "string"
|
|
52
|
-
},
|
|
53
|
-
"owner": {
|
|
54
|
-
"type": "string"
|
|
55
|
-
},
|
|
56
|
-
"packages": {
|
|
57
|
-
"$ref": "#/definitions/Packages"
|
|
58
|
-
},
|
|
59
|
-
"projectName": {
|
|
60
|
-
"$ref": "#/definitions/ProjectName"
|
|
61
|
-
},
|
|
62
|
-
"rootTemplateReference": {
|
|
63
|
-
"$ref": "#/definitions/RootTemplateReference"
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
"required": [
|
|
67
|
-
"projectName",
|
|
68
|
-
"rootTemplateReference",
|
|
69
|
-
"packages"
|
|
70
|
-
],
|
|
71
|
-
"type": "object"
|
|
72
|
-
},
|
|
73
|
-
"ProjectName": {
|
|
74
|
-
"description": "Name of the project. No spaces or special characters allowed.",
|
|
75
|
-
"pattern": "^[A-Za-z0-9-_]*$",
|
|
76
|
-
"title": "Name",
|
|
77
|
-
"type": "string"
|
|
78
|
-
},
|
|
79
|
-
"RootTemplateReference": {
|
|
80
|
-
"additionalProperties": false,
|
|
81
|
-
"description": "Template to be used for the project root.",
|
|
82
|
-
"properties": {
|
|
83
|
-
"templateName": {
|
|
84
|
-
"$ref": "#/definitions/TempalteName"
|
|
85
|
-
},
|
|
86
|
-
"templateVersion": {
|
|
87
|
-
"$ref": "#/definitions/TemplateVersion"
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
"required": [
|
|
91
|
-
"templateName"
|
|
92
|
-
],
|
|
93
|
-
"type": "object"
|
|
94
|
-
},
|
|
95
|
-
"TempalteName": {
|
|
96
|
-
"description": "Name of the template.",
|
|
97
|
-
"type": "string"
|
|
98
|
-
},
|
|
99
|
-
"TemplateName": {
|
|
100
|
-
"description": "Name of the template.",
|
|
101
|
-
"type": "string"
|
|
102
|
-
},
|
|
103
|
-
"TemplateVersion": {
|
|
104
|
-
"description": "Version of the template.",
|
|
105
|
-
"type": "string"
|
|
106
|
-
},
|
|
107
|
-
"TemplateVersion1": {
|
|
108
|
-
"description": "Version of the template.",
|
|
109
|
-
"type": "string"
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/ProjectConfiguration",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"definitions": {
|
|
5
|
+
"PackageName": {
|
|
6
|
+
"description": "Name of the package.",
|
|
7
|
+
"type": "string"
|
|
8
|
+
},
|
|
9
|
+
"PackageProjectConfiguration": {
|
|
10
|
+
"additionalProperties": false,
|
|
11
|
+
"description": "Configuration for a package to be included.",
|
|
12
|
+
"properties": {
|
|
13
|
+
"packageName": {
|
|
14
|
+
"$ref": "#/definitions/PackageName"
|
|
15
|
+
},
|
|
16
|
+
"templateReference": {
|
|
17
|
+
"additionalProperties": false,
|
|
18
|
+
"description": "Reference to the template to be used for the package.",
|
|
19
|
+
"properties": {
|
|
20
|
+
"templateName": {
|
|
21
|
+
"$ref": "#/definitions/TemplateName"
|
|
22
|
+
},
|
|
23
|
+
"templateVersion": {
|
|
24
|
+
"$ref": "#/definitions/TemplateVersion1"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"required": [
|
|
28
|
+
"templateName"
|
|
29
|
+
],
|
|
30
|
+
"type": "object"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"required": [
|
|
34
|
+
"packageName",
|
|
35
|
+
"templateReference"
|
|
36
|
+
],
|
|
37
|
+
"type": "object"
|
|
38
|
+
},
|
|
39
|
+
"Packages": {
|
|
40
|
+
"description": "Packages to be included in the project.",
|
|
41
|
+
"items": {
|
|
42
|
+
"$ref": "#/definitions/PackageProjectConfiguration"
|
|
43
|
+
},
|
|
44
|
+
"type": "array"
|
|
45
|
+
},
|
|
46
|
+
"ProjectConfiguration": {
|
|
47
|
+
"additionalProperties": false,
|
|
48
|
+
"description": "Configuration for a Goldstack project.",
|
|
49
|
+
"properties": {
|
|
50
|
+
"createdAt": {
|
|
51
|
+
"type": "string"
|
|
52
|
+
},
|
|
53
|
+
"owner": {
|
|
54
|
+
"type": "string"
|
|
55
|
+
},
|
|
56
|
+
"packages": {
|
|
57
|
+
"$ref": "#/definitions/Packages"
|
|
58
|
+
},
|
|
59
|
+
"projectName": {
|
|
60
|
+
"$ref": "#/definitions/ProjectName"
|
|
61
|
+
},
|
|
62
|
+
"rootTemplateReference": {
|
|
63
|
+
"$ref": "#/definitions/RootTemplateReference"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"required": [
|
|
67
|
+
"projectName",
|
|
68
|
+
"rootTemplateReference",
|
|
69
|
+
"packages"
|
|
70
|
+
],
|
|
71
|
+
"type": "object"
|
|
72
|
+
},
|
|
73
|
+
"ProjectName": {
|
|
74
|
+
"description": "Name of the project. No spaces or special characters allowed.",
|
|
75
|
+
"pattern": "^[A-Za-z0-9-_]*$",
|
|
76
|
+
"title": "Name",
|
|
77
|
+
"type": "string"
|
|
78
|
+
},
|
|
79
|
+
"RootTemplateReference": {
|
|
80
|
+
"additionalProperties": false,
|
|
81
|
+
"description": "Template to be used for the project root.",
|
|
82
|
+
"properties": {
|
|
83
|
+
"templateName": {
|
|
84
|
+
"$ref": "#/definitions/TempalteName"
|
|
85
|
+
},
|
|
86
|
+
"templateVersion": {
|
|
87
|
+
"$ref": "#/definitions/TemplateVersion"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"required": [
|
|
91
|
+
"templateName"
|
|
92
|
+
],
|
|
93
|
+
"type": "object"
|
|
94
|
+
},
|
|
95
|
+
"TempalteName": {
|
|
96
|
+
"description": "Name of the template.",
|
|
97
|
+
"type": "string"
|
|
98
|
+
},
|
|
99
|
+
"TemplateName": {
|
|
100
|
+
"description": "Name of the template.",
|
|
101
|
+
"type": "string"
|
|
102
|
+
},
|
|
103
|
+
"TemplateVersion": {
|
|
104
|
+
"description": "Version of the template.",
|
|
105
|
+
"type": "string"
|
|
106
|
+
},
|
|
107
|
+
"TemplateVersion1": {
|
|
108
|
+
"description": "Version of the template.",
|
|
109
|
+
"type": "string"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Name of the project. No spaces or special characters allowed.
|
|
3
|
-
*
|
|
4
|
-
* @title Name
|
|
5
|
-
* @pattern ^[A-Za-z0-9-_]*$
|
|
6
|
-
*/
|
|
7
|
-
export declare type ProjectName = string;
|
|
8
|
-
/**
|
|
9
|
-
* Name of the template.
|
|
10
|
-
*/
|
|
11
|
-
export declare type TempalteName = string;
|
|
12
|
-
/**
|
|
13
|
-
* Version of the template.
|
|
14
|
-
*/
|
|
15
|
-
export declare type TemplateVersion = string;
|
|
16
|
-
/**
|
|
17
|
-
* Name of the package.
|
|
18
|
-
*/
|
|
19
|
-
export declare type PackageName = string;
|
|
20
|
-
/**
|
|
21
|
-
* Name of the template.
|
|
22
|
-
*/
|
|
23
|
-
export declare type TemplateName = string;
|
|
24
|
-
/**
|
|
25
|
-
* Version of the template.
|
|
26
|
-
*/
|
|
27
|
-
export declare type TemplateVersion1 = string;
|
|
28
|
-
/**
|
|
29
|
-
* Packages to be included in the project.
|
|
30
|
-
*/
|
|
31
|
-
export declare type Packages = PackageProjectConfiguration[];
|
|
32
|
-
/**
|
|
33
|
-
* Template to be used for the project root.
|
|
34
|
-
*/
|
|
35
|
-
export interface RootTemplateReference {
|
|
36
|
-
templateName: TempalteName;
|
|
37
|
-
templateVersion?: TemplateVersion;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Configuration for a package to be included.
|
|
41
|
-
*/
|
|
42
|
-
export interface PackageProjectConfiguration {
|
|
43
|
-
packageName: PackageName;
|
|
44
|
-
/**
|
|
45
|
-
* Reference to the template to be used for the package.
|
|
46
|
-
*/
|
|
47
|
-
templateReference: {
|
|
48
|
-
templateName: TemplateName;
|
|
49
|
-
templateVersion?: TemplateVersion1;
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Configuration for a Goldstack project.
|
|
54
|
-
*/
|
|
55
|
-
export interface ProjectConfiguration {
|
|
56
|
-
projectName: ProjectName;
|
|
57
|
-
rootTemplateReference: RootTemplateReference;
|
|
58
|
-
packages: Packages;
|
|
59
|
-
owner?: string;
|
|
60
|
-
createdAt?: string;
|
|
61
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Name of the project. No spaces or special characters allowed.
|
|
3
|
+
*
|
|
4
|
+
* @title Name
|
|
5
|
+
* @pattern ^[A-Za-z0-9-_]*$
|
|
6
|
+
*/
|
|
7
|
+
export declare type ProjectName = string;
|
|
8
|
+
/**
|
|
9
|
+
* Name of the template.
|
|
10
|
+
*/
|
|
11
|
+
export declare type TempalteName = string;
|
|
12
|
+
/**
|
|
13
|
+
* Version of the template.
|
|
14
|
+
*/
|
|
15
|
+
export declare type TemplateVersion = string;
|
|
16
|
+
/**
|
|
17
|
+
* Name of the package.
|
|
18
|
+
*/
|
|
19
|
+
export declare type PackageName = string;
|
|
20
|
+
/**
|
|
21
|
+
* Name of the template.
|
|
22
|
+
*/
|
|
23
|
+
export declare type TemplateName = string;
|
|
24
|
+
/**
|
|
25
|
+
* Version of the template.
|
|
26
|
+
*/
|
|
27
|
+
export declare type TemplateVersion1 = string;
|
|
28
|
+
/**
|
|
29
|
+
* Packages to be included in the project.
|
|
30
|
+
*/
|
|
31
|
+
export declare type Packages = PackageProjectConfiguration[];
|
|
32
|
+
/**
|
|
33
|
+
* Template to be used for the project root.
|
|
34
|
+
*/
|
|
35
|
+
export interface RootTemplateReference {
|
|
36
|
+
templateName: TempalteName;
|
|
37
|
+
templateVersion?: TemplateVersion;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Configuration for a package to be included.
|
|
41
|
+
*/
|
|
42
|
+
export interface PackageProjectConfiguration {
|
|
43
|
+
packageName: PackageName;
|
|
44
|
+
/**
|
|
45
|
+
* Reference to the template to be used for the package.
|
|
46
|
+
*/
|
|
47
|
+
templateReference: {
|
|
48
|
+
templateName: TemplateName;
|
|
49
|
+
templateVersion?: TemplateVersion1;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Configuration for a Goldstack project.
|
|
54
|
+
*/
|
|
55
|
+
export interface ProjectConfiguration {
|
|
56
|
+
projectName: ProjectName;
|
|
57
|
+
rootTemplateReference: RootTemplateReference;
|
|
58
|
+
packages: Packages;
|
|
59
|
+
owner?: string;
|
|
60
|
+
createdAt?: string;
|
|
61
|
+
}
|
|
62
62
|
//# sourceMappingURL=projectConfigurationSchema.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=projectConfigurationSchema.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ProjectConfiguration } from './types/projectConfigurationSchema';
|
|
2
|
-
export * from './types/projectConfigurationSchema';
|
|
3
|
-
export declare const readProjectConfigFromString: (data: string) => ProjectConfiguration;
|
|
4
|
-
export declare const readProjectConfigFromFile: (path?: string) => ProjectConfiguration;
|
|
1
|
+
import { ProjectConfiguration } from './types/projectConfigurationSchema';
|
|
2
|
+
export * from './types/projectConfigurationSchema';
|
|
3
|
+
export declare const readProjectConfigFromString: (data: string) => ProjectConfiguration;
|
|
4
|
+
export declare const readProjectConfigFromFile: (path?: string) => ProjectConfiguration;
|
|
5
5
|
//# sourceMappingURL=utilsProject.d.ts.map
|
package/dist/src/utilsProject.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.readProjectConfigFromFile = exports.readProjectConfigFromString = void 0;
|
|
21
|
-
const configSchema_json_1 = __importDefault(require("./schemas/configSchema.json"));
|
|
22
|
-
const utils_sh_1 = require("@goldstack/utils-sh");
|
|
23
|
-
const utils_config_1 = require("@goldstack/utils-config");
|
|
24
|
-
__exportStar(require("./types/projectConfigurationSchema"), exports);
|
|
25
|
-
const readProjectConfigFromString = (data) => {
|
|
26
|
-
const config = (0, utils_config_1.parseConfig)(data, configSchema_json_1.default, {
|
|
27
|
-
errorMessage: 'Cannot load template config.',
|
|
28
|
-
});
|
|
29
|
-
return config;
|
|
30
|
-
};
|
|
31
|
-
exports.readProjectConfigFromString = readProjectConfigFromString;
|
|
32
|
-
const readProjectConfigFromFile = (path = 'project.json') => {
|
|
33
|
-
const data = (0, utils_sh_1.read)(path);
|
|
34
|
-
return (0, exports.readProjectConfigFromString)(data);
|
|
35
|
-
};
|
|
36
|
-
exports.readProjectConfigFromFile = readProjectConfigFromFile;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.readProjectConfigFromFile = exports.readProjectConfigFromString = void 0;
|
|
21
|
+
const configSchema_json_1 = __importDefault(require("./schemas/configSchema.json"));
|
|
22
|
+
const utils_sh_1 = require("@goldstack/utils-sh");
|
|
23
|
+
const utils_config_1 = require("@goldstack/utils-config");
|
|
24
|
+
__exportStar(require("./types/projectConfigurationSchema"), exports);
|
|
25
|
+
const readProjectConfigFromString = (data) => {
|
|
26
|
+
const config = (0, utils_config_1.parseConfig)(data, configSchema_json_1.default, {
|
|
27
|
+
errorMessage: 'Cannot load template config.',
|
|
28
|
+
});
|
|
29
|
+
return config;
|
|
30
|
+
};
|
|
31
|
+
exports.readProjectConfigFromString = readProjectConfigFromString;
|
|
32
|
+
const readProjectConfigFromFile = (path = 'project.json') => {
|
|
33
|
+
const data = (0, utils_sh_1.read)(path);
|
|
34
|
+
return (0, exports.readProjectConfigFromString)(data);
|
|
35
|
+
};
|
|
36
|
+
exports.readProjectConfigFromFile = readProjectConfigFromFile;
|
|
37
37
|
//# sourceMappingURL=utilsProject.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goldstack/utils-project",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Utility for working with Goldstack project configurations.",
|
|
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.
|
|
39
|
-
"@goldstack/utils-sh": "0.
|
|
38
|
+
"@goldstack/utils-config": "0.4.0",
|
|
39
|
+
"@goldstack/utils-sh": "0.5.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@goldstack/utils-git": "0.
|
|
43
|
-
"@goldstack/utils-json-to-ts": "0.
|
|
42
|
+
"@goldstack/utils-git": "0.2.0",
|
|
43
|
+
"@goldstack/utils-json-to-ts": "0.4.0",
|
|
44
44
|
"@types/jest": "^28.1.8",
|
|
45
45
|
"@types/node": "^18.7.13",
|
|
46
46
|
"jest": "^28.1.0",
|