@goldstack/utils-package-create 0.3.40 → 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,9 +1,9 @@
|
|
|
1
|
-
interface CreatePackageParams {
|
|
2
|
-
newPackageName: string;
|
|
3
|
-
templateName: string;
|
|
4
|
-
templateVersion: string;
|
|
5
|
-
installFolder?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const createPackage: (params: CreatePackageParams) => Promise<void>;
|
|
8
|
-
export {};
|
|
1
|
+
interface CreatePackageParams {
|
|
2
|
+
newPackageName: string;
|
|
3
|
+
templateName: string;
|
|
4
|
+
templateVersion: string;
|
|
5
|
+
installFolder?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const createPackage: (params: CreatePackageParams) => Promise<void>;
|
|
8
|
+
export {};
|
|
9
9
|
//# sourceMappingURL=utilsPackageCreate.d.ts.map
|
|
@@ -1,25 +1,25 @@
|
|
|
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.createPackage = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const utils_template_1 = require("@goldstack/utils-template");
|
|
9
|
-
const utils_sh_1 = require("@goldstack/utils-sh");
|
|
10
|
-
const copyFromLocal = async (params, path) => {
|
|
11
|
-
const templateConfig = (0, utils_template_1.readTemplateConfigFromFile)(path + '/template.json');
|
|
12
|
-
const installFolder = params.installFolder;
|
|
13
|
-
(0, utils_sh_1.cp)('-r', path + '/template', './' + installFolder + '/' + params.newPackageName);
|
|
14
|
-
};
|
|
15
|
-
const createPackage = async (params) => {
|
|
16
|
-
const localPath = `./templates/${params.templateName}/${params.templateVersion}`;
|
|
17
|
-
if (fs_1.default.existsSync(localPath)) {
|
|
18
|
-
await copyFromLocal(params, localPath);
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
throw new Error('Only local install supported.');
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
exports.createPackage = createPackage;
|
|
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.createPackage = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const utils_template_1 = require("@goldstack/utils-template");
|
|
9
|
+
const utils_sh_1 = require("@goldstack/utils-sh");
|
|
10
|
+
const copyFromLocal = async (params, path) => {
|
|
11
|
+
const templateConfig = (0, utils_template_1.readTemplateConfigFromFile)(path + '/template.json');
|
|
12
|
+
const installFolder = params.installFolder;
|
|
13
|
+
(0, utils_sh_1.cp)('-r', path + '/template', './' + installFolder + '/' + params.newPackageName);
|
|
14
|
+
};
|
|
15
|
+
const createPackage = async (params) => {
|
|
16
|
+
const localPath = `./templates/${params.templateName}/${params.templateVersion}`;
|
|
17
|
+
if (fs_1.default.existsSync(localPath)) {
|
|
18
|
+
await copyFromLocal(params, localPath);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
throw new Error('Only local install supported.');
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.createPackage = createPackage;
|
|
25
25
|
//# sourceMappingURL=utilsPackageCreate.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goldstack/utils-package-create",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Utilities for creating new Goldstack packages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"goldstack",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"version:apply:force": "yarn version $@ && yarn version apply"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@goldstack/utils-log": "0.
|
|
38
|
-
"@goldstack/utils-sh": "0.
|
|
39
|
-
"@goldstack/utils-template": "0.
|
|
37
|
+
"@goldstack/utils-log": "0.3.0",
|
|
38
|
+
"@goldstack/utils-sh": "0.5.0",
|
|
39
|
+
"@goldstack/utils-template": "0.4.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@goldstack/utils-git": "0.
|
|
42
|
+
"@goldstack/utils-git": "0.2.0",
|
|
43
43
|
"@types/jest": "^28.1.8",
|
|
44
44
|
"@types/node": "^18.7.13",
|
|
45
45
|
"jest": "^28.1.0",
|