@onivoro/onix 20.5.13 → 20.5.15
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.
- package/executors.json +5 -0
- package/package.json +11 -11
- package/src/executors/deploy-s3-react/executor.js +12 -15
- package/src/executors/deploy-s3-react/executor.js.map +1 -1
- package/src/executors/deploy-s3-vite/executor.d.ts +3 -0
- package/src/executors/deploy-s3-vite/executor.js +60 -0
- package/src/executors/deploy-s3-vite/executor.js.map +1 -0
- package/src/executors/deploy-s3-vite/schema.d.ts +7 -0
- package/src/executors/deploy-s3-vite/schema.json +34 -0
- package/src/functions/as-s3-app-key.function.d.ts +6 -0
- package/src/functions/as-s3-app-key.function.js +8 -0
- package/src/functions/as-s3-app-key.function.js.map +1 -0
- package/src/functions/get-asset-list-from-directory.function.d.ts +1 -0
- package/src/functions/get-asset-list-from-directory.function.js +14 -0
- package/src/functions/get-asset-list-from-directory.function.js.map +1 -0
- package/src/functions/get-index-html-content.function.d.ts +1 -0
- package/src/functions/get-index-html-content.function.js +12 -0
- package/src/functions/get-index-html-content.function.js.map +1 -0
- package/src/index.d.ts +3 -0
- package/src/index.js +3 -0
- package/src/index.js.map +1 -1
package/executors.json
CHANGED
|
@@ -30,6 +30,11 @@
|
|
|
30
30
|
"schema": "./src/executors/deploy-s3-react/schema.json",
|
|
31
31
|
"description": "deploy-s3-react"
|
|
32
32
|
},
|
|
33
|
+
"deploy-s3-vite": {
|
|
34
|
+
"implementation": "./src/executors/deploy-s3-vite/executor",
|
|
35
|
+
"schema": "./src/executors/deploy-s3-vite/schema.json",
|
|
36
|
+
"description": "deploy-s3-vite"
|
|
37
|
+
},
|
|
33
38
|
"openapi-gen": {
|
|
34
39
|
"implementation": "./src/executors/openapi-gen/executor",
|
|
35
40
|
"schema": "./src/executors/openapi-gen/schema.json",
|
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onivoro/onix",
|
|
3
|
-
"version": "20.5.
|
|
3
|
+
"version": "20.5.15",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./src/index.d.ts",
|
|
7
7
|
"executors": "./executors.json",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@aws-sdk/client-ecr": "^3.
|
|
10
|
-
"@aws-sdk/client-ecs": "^3.
|
|
11
|
-
"@aws-sdk/client-lambda": "^3.
|
|
12
|
-
"@aws-sdk/client-s3": "^3.
|
|
13
|
-
"@aws-sdk/credential-providers": "^3.
|
|
14
|
-
"@nx/devkit": "
|
|
15
|
-
"@nx/js": "20.
|
|
16
|
-
"@playwright/test": "^1.
|
|
9
|
+
"@aws-sdk/client-ecr": "^3.782.0",
|
|
10
|
+
"@aws-sdk/client-ecs": "^3.782.0",
|
|
11
|
+
"@aws-sdk/client-lambda": "^3.782.0",
|
|
12
|
+
"@aws-sdk/client-s3": "^3.782.0",
|
|
13
|
+
"@aws-sdk/credential-providers": "^3.782.0",
|
|
14
|
+
"@nx/devkit": "20.5.0",
|
|
15
|
+
"@nx/js": "20.5.0",
|
|
16
|
+
"@playwright/test": "^1.51.1",
|
|
17
17
|
"adm-zip": "^0.5.16",
|
|
18
|
-
"esbuild": "^0.
|
|
19
|
-
"esbuild-node-externals": "^1.
|
|
18
|
+
"esbuild": "^0.25.2",
|
|
19
|
+
"esbuild-node-externals": "^1.18.0"
|
|
20
20
|
},
|
|
21
21
|
"types": "./src/index.d.ts"
|
|
22
22
|
}
|
|
@@ -6,11 +6,13 @@ const extract_project_build_outputs_function_1 = require("../../functions/extrac
|
|
|
6
6
|
const pmx_function_1 = require("../../functions/pmx.function");
|
|
7
7
|
const executor_factory_function_1 = require("../../functions/executor-factory.function");
|
|
8
8
|
const path_1 = require("path");
|
|
9
|
-
const promises_1 = require("fs/promises");
|
|
10
9
|
const to_cdn_path_function_1 = require("../../functions/to-cdn-path.function");
|
|
11
10
|
const fs_1 = require("fs");
|
|
12
11
|
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
13
12
|
const resolve_aws_credentials_function_1 = require("../../functions/resolve-aws-credentials.function");
|
|
13
|
+
const as_s3_app_key_function_1 = require("../../functions/as-s3-app-key.function");
|
|
14
|
+
const get_asset_list_from_directory_function_1 = require("../../functions/get-asset-list-from-directory.function");
|
|
15
|
+
const get_index_html_content_function_1 = require("../../functions/get-index-html-content.function");
|
|
14
16
|
const hashDelimiter = '-';
|
|
15
17
|
const assetsFolder = 'assets';
|
|
16
18
|
exports.default = (0, executor_factory_function_1.executorFactory)((options, context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -19,8 +21,8 @@ exports.default = (0, executor_factory_function_1.executorFactory)((options, con
|
|
|
19
21
|
const app = context.projectName;
|
|
20
22
|
(0, pmx_function_1.pmxSpawn)(context, `nx build ${context.projectName}`);
|
|
21
23
|
const assetRoot = (0, path_1.resolve)(projectOutput, assetsFolder);
|
|
22
|
-
const jsAndCssAssets = yield getAssetListFromDirectory(assetRoot);
|
|
23
|
-
const indexHtml = yield getIndexHtmlContent(projectOutput);
|
|
24
|
+
const jsAndCssAssets = yield (0, get_asset_list_from_directory_function_1.getAssetListFromDirectory)(assetRoot);
|
|
25
|
+
const indexHtml = yield (0, get_index_html_content_function_1.getIndexHtmlContent)(projectOutput);
|
|
24
26
|
const fileMappings = jsAndCssAssets.map(original => {
|
|
25
27
|
const { name: nameWithHash, ext } = (0, path_1.parse)(original);
|
|
26
28
|
const [name, hash] = nameWithHash.split(hashDelimiter);
|
|
@@ -47,17 +49,12 @@ exports.default = (0, executor_factory_function_1.executorFactory)((options, con
|
|
|
47
49
|
}));
|
|
48
50
|
})));
|
|
49
51
|
devkit_1.logger.log(html);
|
|
52
|
+
yield s3Client.send(new client_s3_1.PutObjectCommand({
|
|
53
|
+
Bucket: bucket,
|
|
54
|
+
ContentType: 'text/html',
|
|
55
|
+
Body: indexHtml,
|
|
56
|
+
Key: (0, as_s3_app_key_function_1.asS3AppKey)({ app, version, name: 'index', ext: '.html' }),
|
|
57
|
+
ACL
|
|
58
|
+
}));
|
|
50
59
|
}));
|
|
51
|
-
function getAssetListFromDirectory(assetDirectory) {
|
|
52
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
const allAssets = yield (0, promises_1.readdir)(assetDirectory);
|
|
54
|
-
const assets = allAssets.filter(a => ['.js', '.css'].includes((0, path_1.parse)(a).ext));
|
|
55
|
-
return assets;
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
function getIndexHtmlContent(projectOutput) {
|
|
59
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
60
|
-
return yield (0, promises_1.readFile)((0, path_1.resolve)(projectOutput, 'index.html'), { encoding: 'utf-8' });
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
60
|
//# sourceMappingURL=executor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/deploy-s3-react/executor.ts"],"names":[],"mappings":";;;AAAA,uCAAqD;AAErD,mHAAoG;AACpG,+DAAwD;AACxD,yFAA4E;AAC5E,+BAAsC;AACtC
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/deploy-s3-react/executor.ts"],"names":[],"mappings":";;;AAAA,uCAAqD;AAErD,mHAAoG;AACpG,+DAAwD;AACxD,yFAA4E;AAC5E,+BAAsC;AACtC,+EAAiE;AACjE,2BAAsC;AACtC,kDAAgE;AAChE,uGAAyF;AACzF,mFAAoE;AACpE,mHAAmG;AACnG,qGAAsF;AAEtF,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,YAAY,GAAG,QAAQ,CAAA;AAE7B,kBAAe,IAAA,2CAAe,EAAC,CAC7B,OAAuB,EACvB,OAAwB,EACxB,EAAE;IACF,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAA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AAY,IAAI,QAAQ,EAAE,EAAE,QAAQ,CAAC,EAAE,SAAS,CAAC,CAAC;IAElI,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC;IAEhD,MAAM,QAAQ,GAAG,IAAI,oBAAQ,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,IAAA,wDAAqB,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAE7F,MAAM,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,KAAuC,EAAE,oDAAlC,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,EAAE;QACtE,OAAA,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,4BAAgB,CAAC;YACvC,MAAM,EAAE,MAAM;YACd,WAAW,EAAE,WAAW;YACxB,IAAI,EAAE,IAAA,qBAAgB,EAAC,GAAG,SAAS,IAAI,QAAQ,EAAE,EAAE,OAAO,CAAC;YAC3D,GAAG,EAAE,GAAG;YACR,GAAG;SACJ,CAAC,CAAC,CAAA;MAAA,CACJ,CAAC,CAAC;IAEH,eAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAEjB,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,4BAAgB,CAAC;QACvC,MAAM,EAAE,MAAM;QACd,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,SAAS;QACf,GAAG,EAAE,IAAA,mCAAU,EAAC,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;QAC9D,GAAG;KACJ,CAAC,CAAC,CAAC;AACN,CAAC,CAAA,CAAC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const extract_project_build_outputs_function_1 = require("../../functions/extract-project-build-outputs.function");
|
|
6
|
+
const pmx_function_1 = require("../../functions/pmx.function");
|
|
7
|
+
const executor_factory_function_1 = require("../../functions/executor-factory.function");
|
|
8
|
+
const path_1 = require("path");
|
|
9
|
+
const to_cdn_path_function_1 = require("../../functions/to-cdn-path.function");
|
|
10
|
+
const fs_1 = require("fs");
|
|
11
|
+
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
12
|
+
const resolve_aws_credentials_function_1 = require("../../functions/resolve-aws-credentials.function");
|
|
13
|
+
const as_s3_app_key_function_1 = require("../../functions/as-s3-app-key.function");
|
|
14
|
+
const get_asset_list_from_directory_function_1 = require("../../functions/get-asset-list-from-directory.function");
|
|
15
|
+
const get_index_html_content_function_1 = require("../../functions/get-index-html-content.function");
|
|
16
|
+
const hashDelimiter = '-';
|
|
17
|
+
const assetsFolder = 'assets';
|
|
18
|
+
exports.default = (0, executor_factory_function_1.executorFactory)((options, context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
+
const { region, bucket, omitAcl, version, profile } = options;
|
|
20
|
+
const [projectOutput] = (0, extract_project_build_outputs_function_1.extractProjectBuildOutputs)(context, context.projectName);
|
|
21
|
+
const app = context.projectName;
|
|
22
|
+
(0, pmx_function_1.pmxSpawn)(context, `nx build ${context.projectName}`);
|
|
23
|
+
const assetRoot = (0, path_1.resolve)(projectOutput, assetsFolder);
|
|
24
|
+
const jsAndCssAssets = yield (0, get_asset_list_from_directory_function_1.getAssetListFromDirectory)(assetRoot);
|
|
25
|
+
const indexHtml = yield (0, get_index_html_content_function_1.getIndexHtmlContent)(projectOutput);
|
|
26
|
+
const fileMappings = jsAndCssAssets.map(original => {
|
|
27
|
+
const { name: nameWithHash, ext } = (0, path_1.parse)(original);
|
|
28
|
+
const [name, hash] = nameWithHash.split(hashDelimiter);
|
|
29
|
+
const key = (0, as_s3_app_key_function_1.asS3AppKey)({ app, version, name, ext });
|
|
30
|
+
const modified = (0, to_cdn_path_function_1.toCdnPath)(bucket, region, key);
|
|
31
|
+
return {
|
|
32
|
+
original,
|
|
33
|
+
modified,
|
|
34
|
+
key,
|
|
35
|
+
ext,
|
|
36
|
+
contentType: (ext === '.js' ? 'text/javascript' : 'text/css')
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
let html = fileMappings.reduce((acc, { modified, original }) => acc.replace(`/${assetsFolder}/${original}`, modified), indexHtml);
|
|
40
|
+
const ACL = omitAcl ? undefined : 'public-read';
|
|
41
|
+
const s3Client = new client_s3_1.S3Client({ region, credentials: yield (0, resolve_aws_credentials_function_1.resolveAwsCredentials)(profile) });
|
|
42
|
+
yield Promise.all(fileMappings.map((_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ contentType, original, key }) {
|
|
43
|
+
return yield s3Client.send(new client_s3_1.PutObjectCommand({
|
|
44
|
+
Bucket: bucket,
|
|
45
|
+
ContentType: contentType,
|
|
46
|
+
Body: (0, fs_1.createReadStream)(`${assetRoot}/${original}`, 'utf-8'),
|
|
47
|
+
Key: key,
|
|
48
|
+
ACL
|
|
49
|
+
}));
|
|
50
|
+
})));
|
|
51
|
+
devkit_1.logger.log(html);
|
|
52
|
+
yield s3Client.send(new client_s3_1.PutObjectCommand({
|
|
53
|
+
Bucket: bucket,
|
|
54
|
+
ContentType: 'text/html',
|
|
55
|
+
Body: indexHtml,
|
|
56
|
+
Key: (0, as_s3_app_key_function_1.asS3AppKey)({ app, version, name: 'index', ext: '.html' }),
|
|
57
|
+
ACL
|
|
58
|
+
}));
|
|
59
|
+
}));
|
|
60
|
+
//# sourceMappingURL=executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/deploy-s3-vite/executor.ts"],"names":[],"mappings":";;;AAAA,uCAAqD;AAErD,mHAAoG;AACpG,+DAAwD;AACxD,yFAA4E;AAC5E,+BAAsC;AACtC,+EAAiE;AACjE,2BAAsC;AACtC,kDA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AAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;QAC9D,GAAG;KACJ,CAAC,CAAC,CAAC;AACN,CAAC,CAAA,CAAC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"version": 2,
|
|
4
|
+
"title": "Deploy S3 executor",
|
|
5
|
+
"description": "",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"bucket": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Name of the S3 bucket to use for uploading artifacts"
|
|
11
|
+
},
|
|
12
|
+
"profile": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "AWS profile name (which must be defined in the ~/.aws/credentials file) if AWS keys aren't defined as env vars"
|
|
15
|
+
},
|
|
16
|
+
"region": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "AWS region"
|
|
19
|
+
},
|
|
20
|
+
"version": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "AWS region"
|
|
23
|
+
},
|
|
24
|
+
"omitAcl": {
|
|
25
|
+
"type": "boolean",
|
|
26
|
+
"description": "Whether to use acl public-read for S3 push"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"required": [
|
|
30
|
+
"bucket",
|
|
31
|
+
"region",
|
|
32
|
+
"version"
|
|
33
|
+
]
|
|
34
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.asS3AppKey = asS3AppKey;
|
|
4
|
+
function asS3AppKey(_) {
|
|
5
|
+
const { app, version, name, ext, } = _;
|
|
6
|
+
return `${app}/${version}/${name}${ext}`;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=as-s3-app-key.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"as-s3-app-key.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/as-s3-app-key.function.ts"],"names":[],"mappings":";;AAAA,gCAcG;AAdH,SAAgB,UAAU,CAAE,CAKzB;IACC,MAAM,EACJ,GAAG,EACH,OAAO,EACP,IAAI,EACJ,GAAG,GACJ,GAAG,CAAC,CAAC;IAEN,OAAO,GAAG,GAAG,IAAI,OAAO,IAAI,IAAI,GAAG,GAAG,EAAE,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getAssetListFromDirectory(assetDirectory: string): Promise<string[]>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAssetListFromDirectory = getAssetListFromDirectory;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const promises_1 = require("fs/promises");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
function getAssetListFromDirectory(assetDirectory) {
|
|
8
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
9
|
+
const allAssets = yield (0, promises_1.readdir)(assetDirectory);
|
|
10
|
+
const assets = allAssets.filter(a => ['.js', '.css'].includes((0, path_1.parse)(a).ext));
|
|
11
|
+
return assets;
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=get-asset-list-from-directory.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-asset-list-from-directory.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/get-asset-list-from-directory.function.ts"],"names":[],"mappings":";;AAGA,8DAKC;;AARD,0CAAsC;AACtC,+BAA6B;AAE7B,SAAsB,yBAAyB,CAAC,cAAsB;;QAClE,MAAM,SAAS,GAAG,MAAM,IAAA,kBAAO,EAAC,cAAc,CAAC,CAAC;QAChD,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,IAAA,YAAK,EAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAE7E,OAAO,MAAM,CAAC;IAClB,CAAC;CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getIndexHtmlContent(projectOutput: string): Promise<string>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getIndexHtmlContent = getIndexHtmlContent;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const promises_1 = require("fs/promises");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
function getIndexHtmlContent(projectOutput) {
|
|
8
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
9
|
+
return yield (0, promises_1.readFile)((0, path_1.resolve)(projectOutput, 'index.html'), { encoding: 'utf-8' });
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=get-index-html-content.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-index-html-content.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/get-index-html-content.function.ts"],"names":[],"mappings":";;AAGA,kDAEC;;AALD,0CAAuC;AACvC,+BAA+B;AAE/B,SAAsB,mBAAmB,CAAC,aAAqB;;QAC3D,OAAO,MAAM,IAAA,mBAAQ,EAAC,IAAA,cAAO,EAAC,aAAa,EAAE,YAAY,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;IACvF,CAAC;CAAA"}
|
package/src/index.d.ts
CHANGED
|
@@ -3,9 +3,12 @@ export * from './utils/rspack-config-factory';
|
|
|
3
3
|
export * from './utils/vite-config-factory';
|
|
4
4
|
export * from './types/onix-config.type';
|
|
5
5
|
export * from './plugins/plugin';
|
|
6
|
+
export * from './functions/as-s3-app-key.function';
|
|
6
7
|
export * from './functions/executor-factory.function';
|
|
7
8
|
export * from './functions/extract-project-build-outputs.function';
|
|
8
9
|
export * from './functions/extract-project-configuration.function';
|
|
10
|
+
export * from './functions/get-asset-list-from-directory.function';
|
|
11
|
+
export * from './functions/get-index-html-content.function';
|
|
9
12
|
export * from './functions/load-env-file.function';
|
|
10
13
|
export * from './functions/normalize-output-path.function';
|
|
11
14
|
export * from './functions/pm.function';
|
package/src/index.js
CHANGED
|
@@ -6,9 +6,12 @@ tslib_1.__exportStar(require("./utils/rspack-config-factory"), exports);
|
|
|
6
6
|
tslib_1.__exportStar(require("./utils/vite-config-factory"), exports);
|
|
7
7
|
tslib_1.__exportStar(require("./types/onix-config.type"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./plugins/plugin"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./functions/as-s3-app-key.function"), exports);
|
|
9
10
|
tslib_1.__exportStar(require("./functions/executor-factory.function"), exports);
|
|
10
11
|
tslib_1.__exportStar(require("./functions/extract-project-build-outputs.function"), exports);
|
|
11
12
|
tslib_1.__exportStar(require("./functions/extract-project-configuration.function"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./functions/get-asset-list-from-directory.function"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./functions/get-index-html-content.function"), exports);
|
|
12
15
|
tslib_1.__exportStar(require("./functions/load-env-file.function"), exports);
|
|
13
16
|
tslib_1.__exportStar(require("./functions/normalize-output-path.function"), exports);
|
|
14
17
|
tslib_1.__exportStar(require("./functions/pm.function"), exports);
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../onix/src/index.ts"],"names":[],"mappings":";;;AAAA,oEAA0C;AAC1C,wEAA8C;AAC9C,sEAA4C;AAE5C,mEAAyC;AAEzC,2DAAiC;AAEjC,gFAAsD;AACtD,6FAAmE;AACnE,6FAAmE;AACnE,6EAAmD;AACnD,qFAA2D;AAC3D,kEAAwC;AACxC,mEAAyC;AAEzC,iFAAuD;AACvD,kFAAwD;AACxD,gFAAsD;AACtD,iFAAuD;AACvD,kFAAwD;AACxD,kFAAwD;AACxD,sFAA4D;AAE5D,uFAA6D;AAC7D,gFAAsD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../onix/src/index.ts"],"names":[],"mappings":";;;AAAA,oEAA0C;AAC1C,wEAA8C;AAC9C,sEAA4C;AAE5C,mEAAyC;AAEzC,2DAAiC;AAEjC,6EAAmD;AACnD,gFAAsD;AACtD,6FAAmE;AACnE,6FAAmE;AACnE,6FAAmE;AACnE,sFAA4D;AAC5D,6EAAmD;AACnD,qFAA2D;AAC3D,kEAAwC;AACxC,mEAAyC;AAEzC,iFAAuD;AACvD,kFAAwD;AACxD,gFAAsD;AACtD,iFAAuD;AACvD,kFAAwD;AACxD,kFAAwD;AACxD,sFAA4D;AAE5D,uFAA6D;AAC7D,gFAAsD"}
|