zephyr-agent 0.0.42 → 0.0.44
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/dist/lib/auth/login.js +1 -0
- package/dist/lib/auth/login.js.map +1 -1
- package/dist/lib/build-context/find-nearest-package-json.js +7 -8
- package/dist/lib/build-context/find-nearest-package-json.js.map +1 -1
- package/dist/lib/build-context/fs-cache-for-package-json.d.ts +1 -1
- package/dist/lib/build-context/git-provider-utils.d.ts +11 -0
- package/dist/lib/build-context/git-provider-utils.js +66 -0
- package/dist/lib/build-context/git-provider-utils.js.map +1 -0
- package/dist/lib/build-context/ze-package-json.type.d.ts +6 -0
- package/dist/lib/build-context/ze-util-get-git-info.d.ts +1 -1
- package/dist/lib/build-context/ze-util-get-git-info.js +14 -14
- package/dist/lib/build-context/ze-util-get-git-info.js.map +1 -1
- package/dist/lib/build-context/ze-util-parse-ze-dependencies.d.ts +22 -0
- package/dist/lib/build-context/ze-util-parse-ze-dependencies.js +44 -0
- package/dist/lib/build-context/ze-util-parse-ze-dependencies.js.map +1 -0
- package/dist/lib/build-context/ze-util-read-package-json.d.ts +13 -1
- package/dist/lib/build-context/ze-util-read-package-json.js +94 -26
- package/dist/lib/build-context/ze-util-read-package-json.js.map +1 -1
- package/dist/lib/deployment/cloudflare.strategy.d.ts +1 -1
- package/dist/lib/deployment/fastly.strategy.d.ts +1 -1
- package/dist/lib/deployment/get-upload-strategy.d.ts +1 -1
- package/dist/lib/deployment/get-upload-strategy.js +8 -2
- package/dist/lib/deployment/get-upload-strategy.js.map +1 -1
- package/dist/lib/deployment/netlify.strategy.d.ts +1 -1
- package/dist/lib/deployment/upload-base/upload-assets.d.ts +2 -2
- package/dist/lib/deployment/upload-base/upload-build-stats-and-enable-envs.d.ts +2 -2
- package/dist/lib/edge-actions/ze-enable-snapshot-on-pages.js +4 -1
- package/dist/lib/edge-actions/ze-enable-snapshot-on-pages.js.map +1 -1
- package/dist/lib/edge-actions/ze-upload-assets.d.ts +1 -1
- package/dist/lib/edge-actions/ze-upload-snapshot.d.ts +1 -1
- package/dist/lib/edge-hash-list/distributed-hash-control.d.ts +1 -1
- package/dist/lib/edge-hash-list/get-missing-assets.d.ts +1 -1
- package/dist/lib/edge-requests/get-application-configuration.d.ts +1 -1
- package/dist/lib/errors/codes.d.ts +1 -1
- package/dist/lib/errors/codes.js +5 -1
- package/dist/lib/errors/codes.js.map +1 -1
- package/dist/lib/errors/zephyr-error.d.ts +2 -2
- package/dist/lib/errors/zephyr-error.js +1 -1
- package/dist/lib/errors/zephyr-error.js.map +1 -1
- package/dist/lib/http/fetch-with-retries.d.ts +1 -1
- package/dist/lib/http/fetch-with-retries.js +30 -20
- package/dist/lib/http/fetch-with-retries.js.map +1 -1
- package/dist/lib/http/upload-envs.d.ts +2 -2
- package/dist/lib/http/upload-file.d.ts +1 -1
- package/dist/lib/http/upload-snapshot.d.ts +1 -1
- package/dist/lib/http/ze-http-request.js +5 -13
- package/dist/lib/http/ze-http-request.js.map +1 -1
- package/dist/lib/logging/debug.d.ts +0 -17
- package/dist/lib/logging/debug.js +1 -26
- package/dist/lib/logging/debug.js.map +1 -1
- package/dist/lib/logging/ze-log-event.d.ts +1 -1
- package/dist/lib/logging/ze-log-event.js +7 -4
- package/dist/lib/logging/ze-log-event.js.map +1 -1
- package/dist/lib/node-persist/partial-assets-map.d.ts +1 -1
- package/dist/lib/transformers/ze-build-assets-map.d.ts +1 -1
- package/dist/lib/transformers/ze-build-assets.d.ts +1 -1
- package/dist/lib/transformers/ze-build-dash-data.d.ts +2 -2
- package/dist/lib/transformers/ze-build-snapshot.d.ts +2 -2
- package/dist/lib/transformers/ze-build-snapshot.js +4 -1
- package/dist/lib/transformers/ze-build-snapshot.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/zephyr-engine/index.d.ts +12 -11
- package/dist/zephyr-engine/index.js +42 -28
- package/dist/zephyr-engine/index.js.map +1 -1
- package/dist/zephyr-engine/resolve_remote_dependency.js +1 -1
- package/dist/zephyr-engine/resolve_remote_dependency.js.map +1 -1
- package/package.json +2 -2
- package/dist/lib/errors/configuration-error.d.ts +0 -3
- package/dist/lib/errors/configuration-error.js +0 -18
- package/dist/lib/errors/configuration-error.js.map +0 -1
- package/dist/lib/errors/package-json-not-found-error.d.ts +0 -4
- package/dist/lib/errors/package-json-not-found-error.js +0 -11
- package/dist/lib/errors/package-json-not-found-error.js.map +0 -1
- package/dist/lib/errors/package-json-not-valid-error.d.ts +0 -4
- package/dist/lib/errors/package-json-not-valid-error.js +0 -11
- package/dist/lib/errors/package-json-not-valid-error.js.map +0 -1
- package/dist/lib/errors/package-not-a-json-error.d.ts +0 -4
- package/dist/lib/errors/package-not-a-json-error.js +0 -11
- package/dist/lib/errors/package-not-a-json-error.js.map +0 -1
- package/dist/lib/logging/error-codes-messages.d.ts +0 -206
- package/dist/lib/logging/error-codes-messages.js +0 -203
- package/dist/lib/logging/error-codes-messages.js.map +0 -1
- package/dist/lib/logging/error-formatted-message.d.ts +0 -5
- package/dist/lib/logging/error-formatted-message.js +0 -36
- package/dist/lib/logging/error-formatted-message.js.map +0 -1
package/dist/lib/auth/login.js
CHANGED
|
@@ -106,6 +106,7 @@ function fallbackManualLogin(url) {
|
|
|
106
106
|
/** Opens the given URL in the default browser. */
|
|
107
107
|
async function openUrl(url) {
|
|
108
108
|
// Lazy loads `open` module
|
|
109
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
109
110
|
const openModule = (await eval(`import('open')`));
|
|
110
111
|
await openModule.default(url);
|
|
111
112
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../../src/lib/auth/login.ts"],"names":[],"mappings":";;AAyBA,8BAiDC;AASD,8CAeC;
|
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../../src/lib/auth/login.ts"],"names":[],"mappings":";;AAyBA,8BAiDC;AASD,8CAeC;AA2ED,4CAEC;;AA/KD,mD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;QAEH,8EAA8E;QAC9E,8EAA8E;QAC9E,MAAM,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC,KAAK,EAAE,EAAE;YAC1C,aAAa,EAAE,CAAC;YAChB,MAAM,CACJ,IAAI,oBAAW,CAAC,iBAAQ,CAAC,cAAc,EAAE;gBACvC,KAAK;gBACL,OAAO,EAAE,4BAA4B;aACtC,CAAC,CACH,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,KAAK,EAAE,EAAE;YACrC,aAAa,EAAE,CAAC;YAChB,MAAM,CACJ,IAAI,oBAAW,CAAC,iBAAQ,CAAC,cAAc,EAAE;gBACvC,OAAO,EAAE,8BAA8B;gBACvC,KAAK;aACN,CAAC,CACH,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;QAE1D,yEAAyE;QACzE,aAAa,GAAG,UAAU,CAAC,GAAG,EAAE;YAC9B,aAAa,EAAE,CAAC;YAChB,MAAM,CACJ,IAAI,oBAAW,CAAC,iBAAQ,CAAC,cAAc,EAAE;gBACvC,OAAO,EAAE,8DAA8D,+CAAkC,GAAG,IAAI,6BAA6B;aAC9I,CAAC,CACH,CAAC;QACJ,CAAC,EAAE,+CAAkC,CAAC,CAAC;QAEvC,OAAO,MAAM,OAAO,CAAC;IACvB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,aAAa,EAAE,CAAC;QAChB,MAAM,KAAK,CAAC;IACd,CAAC;YAAS,CAAC;QACT,aAAa,EAAE,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.find_nearest_package_json = find_nearest_package_json;
|
|
4
|
-
const promises_1 = require("node:fs/promises");
|
|
5
4
|
const node_fs_1 = require("node:fs");
|
|
5
|
+
const promises_1 = require("node:fs/promises");
|
|
6
6
|
const node_path_1 = require("node:path");
|
|
7
|
-
const
|
|
8
|
-
const package_json_not_found_error_1 = require("../errors/package-json-not-found-error");
|
|
7
|
+
const errors_1 = require("../errors");
|
|
9
8
|
const debug_1 = require("../logging/debug");
|
|
10
9
|
const max_retry = 30;
|
|
11
10
|
async function find_nearest_package_json(startPath) {
|
|
12
11
|
if (!startPath) {
|
|
13
|
-
throw new
|
|
12
|
+
throw new errors_1.ZephyrError(errors_1.ZeErrors.ERR_PACKAGE_JSON_NOT_FOUND);
|
|
14
13
|
}
|
|
15
14
|
let retry = 0;
|
|
16
15
|
let dir = startPath;
|
|
17
16
|
do {
|
|
18
17
|
retry++;
|
|
19
18
|
if (retry > max_retry) {
|
|
20
|
-
throw new
|
|
19
|
+
throw new errors_1.ZephyrError(errors_1.ZeErrors.ERR_PACKAGE_JSON_NOT_FOUND);
|
|
21
20
|
}
|
|
22
21
|
const packageJsonPath = (0, node_path_1.join)(dir, 'package.json');
|
|
23
22
|
try {
|
|
24
|
-
(0, node_fs_1.accessSync)(packageJsonPath,
|
|
23
|
+
(0, node_fs_1.accessSync)(packageJsonPath, promises_1.constants.F_OK);
|
|
25
24
|
return {
|
|
26
25
|
path: packageJsonPath,
|
|
27
26
|
json: await (0, promises_1.readFile)(packageJsonPath, 'utf8'),
|
|
@@ -32,10 +31,10 @@ async function find_nearest_package_json(startPath) {
|
|
|
32
31
|
}
|
|
33
32
|
const parentDir = (0, node_path_1.resolve)(dir, '..');
|
|
34
33
|
if (parentDir === dir) {
|
|
35
|
-
throw new
|
|
34
|
+
throw new errors_1.ZephyrError(errors_1.ZeErrors.ERR_PACKAGE_JSON_NOT_FOUND);
|
|
36
35
|
}
|
|
37
36
|
dir = parentDir;
|
|
38
37
|
} while (startPath !== dir);
|
|
39
|
-
throw new
|
|
38
|
+
throw new errors_1.ZephyrError(errors_1.ZeErrors.ERR_PACKAGE_JSON_NOT_FOUND);
|
|
40
39
|
}
|
|
41
40
|
//# sourceMappingURL=find-nearest-package-json.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-nearest-package-json.js","sourceRoot":"","sources":["../../../src/lib/build-context/find-nearest-package-json.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"find-nearest-package-json.js","sourceRoot":"","sources":["../../../src/lib/build-context/find-nearest-package-json.ts"],"names":[],"mappings":";;AAQA,8DAmCC;AA3CD,qCAAqC;AACrC,+CAAuD;AACvD,yCAA0C;AAC1C,sCAAkD;AAClD,4CAA0C;AAE1C,MAAM,SAAS,GAAG,EAAE,CAAC;AAEd,KAAK,UAAU,yBAAyB,CAAC,SAAiB;IAI/D,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,oBAAW,CAAC,iBAAQ,CAAC,0BAA0B,CAAC,CAAC;IAC7D,CAAC;IAED,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,GAAG,GAAG,SAAS,CAAC;IACpB,GAAG,CAAC;QACF,KAAK,EAAE,CAAC;QACR,IAAI,KAAK,GAAG,SAAS,EAAE,CAAC;YACtB,MAAM,IAAI,oBAAW,CAAC,iBAAQ,CAAC,0BAA0B,CAAC,CAAC;QAC7D,CAAC;QAED,MAAM,eAAe,GAAG,IAAA,gBAAI,EAAC,GAAG,EAAE,cAAc,CAAC,CAAC;QAClD,IAAI,CAAC;YACH,IAAA,oBAAU,EAAC,eAAe,EAAE,oBAAS,CAAC,IAAI,CAAC,CAAC;YAC5C,OAAO;gBACL,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE,MAAM,IAAA,mBAAQ,EAAC,eAAe,EAAE,MAAM,CAAC;aAC9C,CAAC;QACJ,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAA,cAAM,EAAC,CAAC,CAAC,CAAC;QACZ,CAAC;QAED,MAAM,SAAS,GAAG,IAAA,mBAAO,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACrC,IAAI,SAAS,KAAK,GAAG,EAAE,CAAC;YACtB,MAAM,IAAI,oBAAW,CAAC,iBAAQ,CAAC,0BAA0B,CAAC,CAAC;QAC7D,CAAC;QACD,GAAG,GAAG,SAAS,CAAC;IAClB,CAAC,QAAQ,SAAS,KAAK,GAAG,EAAE;IAE5B,MAAM,IAAI,oBAAW,CAAC,iBAAQ,CAAC,0BAA0B,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ZePackageJson } from './ze-package-json.type';
|
|
2
2
|
export declare function getPackageJsonCache(startingPath: string): Promise<ZePackageJson | undefined>;
|
|
3
3
|
export declare function setPackageJsonCache(startingPath: string, parsed_package_json: ZePackageJson): Promise<void>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git provider detection and information extraction. In Zephyr, application_uid is
|
|
3
|
+
* created as: [app_name, git_repo, git_org].join('.') where app_name comes from
|
|
4
|
+
* package.json name field, not from the git URL.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getGitProviderInfo(gitUrl: string): {
|
|
7
|
+
provider: string;
|
|
8
|
+
owner: string;
|
|
9
|
+
project: string;
|
|
10
|
+
isEnterprise: boolean;
|
|
11
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getGitProviderInfo = getGitProviderInfo;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const git_url_parse_1 = tslib_1.__importDefault(require("git-url-parse"));
|
|
6
|
+
const errors_1 = require("../errors");
|
|
7
|
+
// Standard Git provider domains mapping
|
|
8
|
+
const STANDARD_DOMAINS = {
|
|
9
|
+
'github.com': 'github',
|
|
10
|
+
'gitlab.com': 'gitlab',
|
|
11
|
+
'bitbucket.org': 'bitbucket',
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Git provider detection and information extraction. In Zephyr, application_uid is
|
|
15
|
+
* created as: [app_name, git_repo, git_org].join('.') where app_name comes from
|
|
16
|
+
* package.json name field, not from the git URL.
|
|
17
|
+
*/
|
|
18
|
+
function getGitProviderInfo(gitUrl) {
|
|
19
|
+
var _a;
|
|
20
|
+
if (!gitUrl) {
|
|
21
|
+
throw new errors_1.ZephyrError(errors_1.ZeErrors.ERR_GIT_REMOTE_ORIGIN);
|
|
22
|
+
}
|
|
23
|
+
const parsed = (0, git_url_parse_1.default)(gitUrl);
|
|
24
|
+
const resource = parsed.resource.toLowerCase();
|
|
25
|
+
// Determine provider type and enterprise status from resource domain
|
|
26
|
+
const provider = (_a = STANDARD_DOMAINS[resource]) !== null && _a !== void 0 ? _a : 'custom';
|
|
27
|
+
const isEnterprise = provider === 'custom';
|
|
28
|
+
// Extract owner based on provider and enterprise status
|
|
29
|
+
const owner = isEnterprise
|
|
30
|
+
? extractEnterpriseOwner(parsed)
|
|
31
|
+
: extractStandardOwner(parsed, provider);
|
|
32
|
+
// Extract project name
|
|
33
|
+
const project = extractProjectName(parsed, provider, isEnterprise);
|
|
34
|
+
return { provider, owner, project, isEnterprise };
|
|
35
|
+
}
|
|
36
|
+
/** Extracts organization name from enterprise domain */
|
|
37
|
+
function extractEnterpriseOwner(parsed) {
|
|
38
|
+
const domainParts = parsed.resource.split('.');
|
|
39
|
+
// For domains like gitlab.company.com, use company.com as the base
|
|
40
|
+
const baseDomain = domainParts.length > 2 ? domainParts.slice(1).join('.') : parsed.resource;
|
|
41
|
+
// Replace dots with hyphens
|
|
42
|
+
return baseDomain.replace(/\./g, '-').toLowerCase();
|
|
43
|
+
}
|
|
44
|
+
/** Extracts owner from standard domain providers with special handling */
|
|
45
|
+
function extractStandardOwner(parsed, provider) {
|
|
46
|
+
const rawOwner = parsed.owner.toLowerCase();
|
|
47
|
+
// For GitLab and Bitbucket with subgroups, extract just the first part as the owner
|
|
48
|
+
if ((provider === 'gitlab' || provider === 'bitbucket') && rawOwner.includes('/')) {
|
|
49
|
+
return rawOwner.split('/')[0];
|
|
50
|
+
}
|
|
51
|
+
return rawOwner;
|
|
52
|
+
}
|
|
53
|
+
/** Extracts project name based on provider and URL structure */
|
|
54
|
+
function extractProjectName(parsed, provider, isEnterprise) {
|
|
55
|
+
// Special handling for self-hosted GitLab with deep subgroups
|
|
56
|
+
if (isEnterprise && provider === 'gitlab' && parsed.pathname) {
|
|
57
|
+
const pathParts = parsed.pathname.split('/').filter(Boolean);
|
|
58
|
+
// For deep subgroup paths in self-hosted GitLab, use the last part
|
|
59
|
+
if (pathParts.length > 2) {
|
|
60
|
+
return pathParts[pathParts.length - 1].replace('.git', '').toLowerCase();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// For all other cases, use the name property directly
|
|
64
|
+
return parsed.name.toLowerCase();
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=git-provider-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-provider-utils.js","sourceRoot":"","sources":["../../../src/lib/build-context/git-provider-utils.ts"],"names":[],"mappings":";;AAeA,gDA0BC;;AAzCD,0EAAwC;AACxC,sCAAkD;AAElD,wCAAwC;AACxC,MAAM,gBAAgB,GAA2B;IAC/C,YAAY,EAAE,QAAQ;IACtB,YAAY,EAAE,QAAQ;IACtB,eAAe,EAAE,WAAW;CAC7B,CAAC;AAEF;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC,MAAc;;IAM/C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,oBAAW,CAAC,iBAAQ,CAAC,qBAAqB,CAAC,CAAC;IACxD,CAAC;IAED,MAAM,MAAM,GAAG,IAAA,uBAAW,EAAC,MAAM,CAAC,CAAC;IACnC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;IAE/C,qEAAqE;IACrE,MAAM,QAAQ,GAAG,MAAA,gBAAgB,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AAQ,CAAC;AAClB,CAAC;AAED,gEAAgE;AAChE,SAAS,kBAAkB,CACzB,MAA0B,EAC1B,QAAgB,EAChB,YAAqB;IAErB,8DAA8D;IAC9D,IAAI,YAAY,IAAI,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC7D,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAE7D,mEAAmE;QACnE,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACzB,OAAO,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QAC3E,CAAC;IACH,CAAC;IAED,sDAAsD;IACtD,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;AACnC,CAAC"}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
export interface ZeDependency {
|
|
2
|
+
version: string;
|
|
3
|
+
registry?: string;
|
|
4
|
+
app_uid?: string;
|
|
5
|
+
}
|
|
1
6
|
export interface ZePackageJson {
|
|
2
7
|
name: string;
|
|
3
8
|
version: string;
|
|
4
9
|
dependencies?: Record<string, string>;
|
|
10
|
+
zephyrDependencies?: Record<string, ZeDependency>;
|
|
5
11
|
/** OptionalDependencies in package.json */
|
|
6
12
|
optionalDependencies?: Record<string, string>;
|
|
7
13
|
/** PeerDependencies in package.json */
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getGitInfo = getGitInfo;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const git_url_parse_1 = tslib_1.__importDefault(require("git-url-parse"));
|
|
6
5
|
const is_ci_1 = tslib_1.__importDefault(require("is-ci"));
|
|
7
6
|
const node_child_process_1 = tslib_1.__importDefault(require("node:child_process"));
|
|
8
7
|
const node_crypto_1 = require("node:crypto");
|
|
@@ -10,6 +9,7 @@ const node_util_1 = require("node:util");
|
|
|
10
9
|
const errors_1 = require("../errors");
|
|
11
10
|
const logging_1 = require("../logging");
|
|
12
11
|
const secret_token_1 = require("../node-persist/secret-token");
|
|
12
|
+
const git_provider_utils_1 = require("./git-provider-utils");
|
|
13
13
|
const exec = (0, node_util_1.promisify)(node_child_process_1.default.exec);
|
|
14
14
|
/** Loads the git information from the current repository. */
|
|
15
15
|
async function getGitInfo() {
|
|
@@ -74,8 +74,8 @@ async function loadGitInfo(hasSecretToken) {
|
|
|
74
74
|
/**
|
|
75
75
|
* Parses the git url using the `git-url-parse` package.
|
|
76
76
|
*
|
|
77
|
-
* This package
|
|
78
|
-
*
|
|
77
|
+
* This package differentiates CI providers and handles git info from various platforms
|
|
78
|
+
* like GitHub, GitLab, Bitbucket, and custom git deployments.
|
|
79
79
|
*/
|
|
80
80
|
function parseGitUrl(remoteOrigin, stdout) {
|
|
81
81
|
if (!remoteOrigin) {
|
|
@@ -83,9 +83,18 @@ function parseGitUrl(remoteOrigin, stdout) {
|
|
|
83
83
|
data: { stdout },
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
-
let parsed;
|
|
87
86
|
try {
|
|
88
|
-
|
|
87
|
+
const gitInfo = (0, git_provider_utils_1.getGitProviderInfo)(remoteOrigin);
|
|
88
|
+
(0, logging_1.ze_log)(`Git provider detected: ${gitInfo.provider}`, {
|
|
89
|
+
provider: gitInfo.provider,
|
|
90
|
+
owner: gitInfo.owner,
|
|
91
|
+
project: gitInfo.project,
|
|
92
|
+
isEnterprise: gitInfo.isEnterprise,
|
|
93
|
+
});
|
|
94
|
+
return {
|
|
95
|
+
org: gitInfo.owner,
|
|
96
|
+
project: gitInfo.project,
|
|
97
|
+
};
|
|
89
98
|
}
|
|
90
99
|
catch (cause) {
|
|
91
100
|
throw new errors_1.ZephyrError(errors_1.ZeErrors.ERR_NO_GIT_INFO, {
|
|
@@ -94,14 +103,5 @@ function parseGitUrl(remoteOrigin, stdout) {
|
|
|
94
103
|
data: { stdout },
|
|
95
104
|
});
|
|
96
105
|
}
|
|
97
|
-
if (!parsed.owner || !parsed.name) {
|
|
98
|
-
throw new errors_1.ZephyrError(errors_1.ZeErrors.ERR_GIT_REMOTE_ORIGIN, {
|
|
99
|
-
data: { stdout },
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
return {
|
|
103
|
-
org: parsed.owner.toLocaleLowerCase(),
|
|
104
|
-
project: parsed.name.toLocaleLowerCase(),
|
|
105
|
-
};
|
|
106
106
|
}
|
|
107
107
|
//# sourceMappingURL=ze-util-get-git-info.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ze-util-get-git-info.js","sourceRoot":"","sources":["../../../src/lib/build-context/ze-util-get-git-info.ts"],"names":[],"mappings":";;AAkBA,gCAsBC;;AAxCD,
|
|
1
|
+
{"version":3,"file":"ze-util-get-git-info.js","sourceRoot":"","sources":["../../../src/lib/build-context/ze-util-get-git-info.ts"],"names":[],"mappings":";;AAkBA,gCAsBC;;AAxCD,0DAAyB;AACzB,oFAAoC;AACpC,6CAAyC;AACzC,yCAAsC;AAEtC,sCAAkD;AAClD,wCAAoC;AACpC,+DAA8D;AAC9D,6DAA0D;AAE1D,MAAM,IAAI,GAAG,IAAA,qBAAS,EAAC,4BAAE,CAAC,IAAI,CAAC,CAAC;AAOhC,6DAA6D;AACtD,KAAK,UAAU,UAAU;IAC9B,MAAM,QAAQ,GAAG,IAAA,6BAAc,GAAE,CAAC;IAElC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAC/D,MAAM,WAAW,CAAC,QAAQ,CAAC,CAAC;IAE9B,IAAI,CAAC,QAAQ,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACnC,MAAM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C;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,oBAAW,CAAC,iBAAQ,CAAC,eAAe,EAAE;YAC9C,OAAO,EAAE,MAAM;YACf,KAAK;YACL,IAAI,EAAE,EAAE,MAAM,EAAE;SACjB,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses Zephyr dependency entries from package.json and transforms them into structured
|
|
3
|
+
* format. Dependencies can be specified in various formats:
|
|
4
|
+
*
|
|
5
|
+
* - Standard semver: "^1.0.0"
|
|
6
|
+
* - Zephyr remote with tag: "zephyr:remote_app_uid@latest"
|
|
7
|
+
* - Zephyr with semver: "zephyr:^1.0.0"
|
|
8
|
+
*
|
|
9
|
+
* @param ze_dependencies - Object with dependency name as key and version/reference as
|
|
10
|
+
* value
|
|
11
|
+
* @returns Parsed zephyr dependencies with structured information
|
|
12
|
+
*/
|
|
13
|
+
import type { ZeDependency } from './ze-package-json.type';
|
|
14
|
+
export declare function parseZeDependencies(ze_dependencies: Record<string, string>): Record<string, ZeDependency>;
|
|
15
|
+
/**
|
|
16
|
+
* Parses a single dependency value into a structured ZeDependency object.
|
|
17
|
+
*
|
|
18
|
+
* @param key - The dependency name
|
|
19
|
+
* @param value - The dependency version or reference string
|
|
20
|
+
* @returns Structured dependency information
|
|
21
|
+
*/
|
|
22
|
+
export declare function parseZeDependency(key: string, value: string): ZeDependency;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseZeDependencies = parseZeDependencies;
|
|
4
|
+
exports.parseZeDependency = parseZeDependency;
|
|
5
|
+
function parseZeDependencies(ze_dependencies) {
|
|
6
|
+
return Object.fromEntries(Object.entries(ze_dependencies).map(([key, value]) => [
|
|
7
|
+
key,
|
|
8
|
+
parseZeDependency(key, value),
|
|
9
|
+
]));
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Parses a single dependency value into a structured ZeDependency object.
|
|
13
|
+
*
|
|
14
|
+
* @param key - The dependency name
|
|
15
|
+
* @param value - The dependency version or reference string
|
|
16
|
+
* @returns Structured dependency information
|
|
17
|
+
*/
|
|
18
|
+
function parseZeDependency(key, value) {
|
|
19
|
+
// Default dependency structure
|
|
20
|
+
const dependency = {
|
|
21
|
+
version: value,
|
|
22
|
+
registry: 'zephyr',
|
|
23
|
+
app_uid: key,
|
|
24
|
+
};
|
|
25
|
+
let reference = value;
|
|
26
|
+
// if reference variable has ':' then cut it off and store dependency.registry
|
|
27
|
+
if (reference.includes(':')) {
|
|
28
|
+
const refference_parts = reference.split(':');
|
|
29
|
+
dependency.registry = refference_parts[0];
|
|
30
|
+
reference = refference_parts[1];
|
|
31
|
+
}
|
|
32
|
+
// Check if it contains a remote app_uid with a tag (e.g., "remote_app_uid@latest")
|
|
33
|
+
if (reference.includes('@')) {
|
|
34
|
+
const [remoteAppUid, tag] = reference.split('@');
|
|
35
|
+
dependency.app_uid = remoteAppUid;
|
|
36
|
+
dependency.version = tag;
|
|
37
|
+
}
|
|
38
|
+
// If it's a semver specification (contains ^, ~, >, <, or =)
|
|
39
|
+
else {
|
|
40
|
+
dependency.version = reference;
|
|
41
|
+
}
|
|
42
|
+
return dependency;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=ze-util-parse-ze-dependencies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ze-util-parse-ze-dependencies.js","sourceRoot":"","sources":["../../../src/lib/build-context/ze-util-parse-ze-dependencies.ts"],"names":[],"mappings":";;AAcA,kDASC;AASD,8CA4BC;AA9CD,SAAgB,mBAAmB,CACjC,eAAuC;IAEvC,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;QACpD,GAAG;QACH,iBAAiB,CAAC,GAAG,EAAE,KAAK,CAAC;KAC9B,CAAC,CACH,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,iBAAiB,CAAC,GAAW,EAAE,KAAa;IAC1D,+BAA+B;IAC/B,MAAM,UAAU,GAAiB;QAC/B,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,QAAQ;QAClB,OAAO,EAAE,GAAG;KACb,CAAC;IAEF,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,8EAA8E;IAC9E,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC5B,MAAM,gBAAgB,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9C,UAAU,CAAC,QAAQ,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;QAC1C,SAAS,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IAED,mFAAmF;IACnF,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC5B,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjD,UAAU,CAAC,OAAO,GAAG,YAAY,CAAC;QAClC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC;IAC3B,CAAC;IACD,6DAA6D;SACxD,CAAC;QACJ,UAAU,CAAC,OAAO,GAAG,SAAS,CAAC;IACjC,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -1,2 +1,14 @@
|
|
|
1
|
-
import { ZePackageJson } from './ze-package-json.type';
|
|
1
|
+
import type { ZePackageJson } from './ze-package-json.type';
|
|
2
|
+
/**
|
|
3
|
+
* Retrieves and parses the package.json file from the given context path or current
|
|
4
|
+
* working directory. The function will search for the nearest package.json file in the
|
|
5
|
+
* directory tree, validate its contents, and cache the result to improve performance.
|
|
6
|
+
*
|
|
7
|
+
* @param context - The starting path to search for package.json. If undefined, uses
|
|
8
|
+
* current working directory.
|
|
9
|
+
* @returns {Promise<ZePackageJson>} A Promise that resolves to the parsed package.json
|
|
10
|
+
* content.
|
|
11
|
+
* @throws {ZephyrError} If the package.json cannot be found, parsed, or has missing
|
|
12
|
+
* required fields.
|
|
13
|
+
*/
|
|
2
14
|
export declare function getPackageJson(context: string | undefined): Promise<ZePackageJson>;
|
|
@@ -5,34 +5,102 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
|
|
6
6
|
const node_path_1 = require("node:path");
|
|
7
7
|
const zephyr_edge_contract_1 = require("zephyr-edge-contract");
|
|
8
|
+
const errors_1 = require("../errors");
|
|
9
|
+
const logging_1 = require("../logging");
|
|
8
10
|
const find_nearest_package_json_1 = require("./find-nearest-package-json");
|
|
9
11
|
const fs_cache_for_package_json_1 = require("./fs-cache-for-package-json");
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
const ze_util_parse_ze_dependencies_1 = require("./ze-util-parse-ze-dependencies");
|
|
13
|
+
/**
|
|
14
|
+
* Retrieves and parses the package.json file from the given context path or current
|
|
15
|
+
* working directory. The function will search for the nearest package.json file in the
|
|
16
|
+
* directory tree, validate its contents, and cache the result to improve performance.
|
|
17
|
+
*
|
|
18
|
+
* @param context - The starting path to search for package.json. If undefined, uses
|
|
19
|
+
* current working directory.
|
|
20
|
+
* @returns {Promise<ZePackageJson>} A Promise that resolves to the parsed package.json
|
|
21
|
+
* content.
|
|
22
|
+
* @throws {ZephyrError} If the package.json cannot be found, parsed, or has missing
|
|
23
|
+
* required fields.
|
|
24
|
+
*/
|
|
14
25
|
async function getPackageJson(context) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
26
|
+
// Determine the starting path
|
|
27
|
+
let startingPath;
|
|
28
|
+
try {
|
|
29
|
+
startingPath = context || process.cwd();
|
|
30
|
+
// If the path is a file, move up one directory level
|
|
31
|
+
if (startingPath && node_fs_1.default.statSync(startingPath).isFile()) {
|
|
32
|
+
startingPath = (0, node_path_1.resolve)(startingPath, '..');
|
|
33
|
+
}
|
|
34
|
+
(0, logging_1.ze_log)('getPackageJson searching from path', startingPath);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
throw new errors_1.ZephyrError(errors_1.ZeErrors.ERR_PACKAGE_JSON_NOT_FOUND, `Invalid starting path: ${context}. Error: ${error}`);
|
|
38
|
+
}
|
|
39
|
+
// Check the cache first
|
|
40
|
+
try {
|
|
41
|
+
const cached = await (0, fs_cache_for_package_json_1.getPackageJsonCache)(startingPath);
|
|
42
|
+
if (cached) {
|
|
43
|
+
(0, logging_1.ze_log)('Using cached package.json for path', startingPath);
|
|
44
|
+
return cached;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
// Cache errors are not fatal, just log and continue
|
|
49
|
+
(0, logging_1.ze_log)('Cache retrieval error', error);
|
|
50
|
+
}
|
|
51
|
+
// Find nearest package.json
|
|
52
|
+
let nearest_package_json;
|
|
53
|
+
try {
|
|
54
|
+
nearest_package_json = await (0, find_nearest_package_json_1.find_nearest_package_json)(startingPath);
|
|
55
|
+
if (!nearest_package_json) {
|
|
56
|
+
throw new errors_1.ZephyrError(errors_1.ZeErrors.ERR_PACKAGE_JSON_NOT_FOUND, `No package.json found starting from: ${startingPath}`);
|
|
57
|
+
}
|
|
58
|
+
(0, logging_1.ze_log)('Found package.json at', nearest_package_json.path);
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
if (error instanceof errors_1.ZephyrError) {
|
|
62
|
+
throw error; // Re-throw existing ZephyrError
|
|
63
|
+
}
|
|
64
|
+
throw new errors_1.ZephyrError(errors_1.ZeErrors.ERR_PACKAGE_JSON_NOT_FOUND, `Error finding package.json from path: ${startingPath}. Error: ${error}`);
|
|
65
|
+
}
|
|
66
|
+
// Parse and validate package.json
|
|
67
|
+
try {
|
|
68
|
+
const { json, path: packageJsonPath } = nearest_package_json;
|
|
69
|
+
// todo: split parsed package json into parsed and resulting, where resulting is of type ZePackageJson
|
|
70
|
+
const parsed_package_json = (0, zephyr_edge_contract_1.safe_json_parse)(json);
|
|
71
|
+
if (!parsed_package_json) {
|
|
72
|
+
throw new errors_1.ZephyrError(errors_1.ZeErrors.ERR_PACKAGE_JSON_NOT_VALID, `Invalid JSON in package.json at: ${packageJsonPath}`);
|
|
73
|
+
}
|
|
74
|
+
// Validate required fields
|
|
75
|
+
if (!parsed_package_json.name) {
|
|
76
|
+
throw new errors_1.ZephyrError(errors_1.ZeErrors.ERR_PACKAGE_JSON_MUST_HAVE_NAME_VERSION, `Missing 'name' field in package.json at: ${packageJsonPath}`);
|
|
77
|
+
}
|
|
78
|
+
if (!parsed_package_json.version) {
|
|
79
|
+
throw new errors_1.ZephyrError(errors_1.ZeErrors.ERR_PACKAGE_JSON_MUST_HAVE_NAME_VERSION, `Missing 'version' field in package.json at: ${packageJsonPath}`);
|
|
80
|
+
}
|
|
81
|
+
if (parsed_package_json.zephyrDependencies) {
|
|
82
|
+
parsed_package_json.zephyrDependencies = (0, ze_util_parse_ze_dependencies_1.parseZeDependencies)(parsed_package_json.zephyrDependencies);
|
|
83
|
+
}
|
|
84
|
+
// Cache the result
|
|
85
|
+
try {
|
|
86
|
+
await (0, fs_cache_for_package_json_1.setPackageJsonCache)(startingPath, parsed_package_json);
|
|
87
|
+
}
|
|
88
|
+
catch (cacheError) {
|
|
89
|
+
// Cache errors are not fatal, just log and continue
|
|
90
|
+
(0, logging_1.ze_log)('Cache storage error', cacheError);
|
|
91
|
+
}
|
|
92
|
+
(0, logging_1.ze_log)('Successfully parsed package.json', {
|
|
93
|
+
name: parsed_package_json.name,
|
|
94
|
+
version: parsed_package_json.version,
|
|
95
|
+
path: packageJsonPath,
|
|
96
|
+
});
|
|
97
|
+
return parsed_package_json;
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
if (error instanceof errors_1.ZephyrError) {
|
|
101
|
+
throw error; // Re-throw existing ZephyrError
|
|
102
|
+
}
|
|
103
|
+
throw new errors_1.ZephyrError(errors_1.ZeErrors.ERR_PACKAGE_JSON_NOT_VALID, `Error processing package.json: ${error}`);
|
|
104
|
+
}
|
|
37
105
|
}
|
|
38
106
|
//# sourceMappingURL=ze-util-read-package-json.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ze-util-read-package-json.js","sourceRoot":"","sources":["../../../src/lib/build-context/ze-util-read-package-json.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"ze-util-read-package-json.js","sourceRoot":"","sources":["../../../src/lib/build-context/ze-util-read-package-json.ts"],"names":[],"mappings":";;AAqBA,wCAkHC;;AAvID,8DAAyB;AACzB,yCAAoC;AACpC,+DAAuD;AACvD,sCAAkD;AAClD,wCAAoC;AACpC,2EAAwE;AACxE,2EAAuF;AAEvF,mFAAsE;AACtE;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,cAAc,CAClC,OAA2B;IAE3B,8BAA8B;IAC9B,IAAI,YAAoB,CAAC;IACzB,IAAI,CAAC;QACH,YAAY,GAAG,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAExC,qDAAqD;QACrD,IAAI,YAAY,IAAI,iBAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;YACvD,YAAY,GAAG,IAAA,mBAAO,EAAC,YAAY,EAAE,IAAI,CAAC,CAAC;QAC7C,CAAC;QAED,IAAA,gBAAM,EAAC,oCAAoC,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/C,CAAC;QACD,MAAM,IAAI,oBAAW,CACnB,iBAAQ,CAAC,0BAA0B,EACnC,kCAAkC,KAAK,EAAE,CAC1C,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { UploadOptions, ZephyrEngine } from '../../zephyr-engine';
|
|
1
|
+
import type { UploadOptions, ZephyrEngine } from '../../zephyr-engine';
|
|
2
2
|
export declare function cloudflareStrategy(zephyr_engine: ZephyrEngine, { snapshot, getDashData, assets: { assetsMap, missingAssets } }: UploadOptions): Promise<string>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { UploadOptions, ZephyrEngine } from '../../zephyr-engine';
|
|
1
|
+
import type { UploadOptions, ZephyrEngine } from '../../zephyr-engine';
|
|
2
2
|
export declare function fastlyStrategy(zephyr_engine: ZephyrEngine, upload_options: UploadOptions): Promise<string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UploadOptions, ZephyrEngine } from '../../zephyr-engine';
|
|
1
|
+
import type { UploadOptions, ZephyrEngine } from '../../zephyr-engine';
|
|
2
2
|
import { UploadProviderType } from '../node-persist/upload-provider-options';
|
|
3
3
|
type UploadStrategy = (zephyr_engine: ZephyrEngine, upload_options: UploadOptions) => Promise<string>;
|
|
4
4
|
export declare function getUploadStrategy(platform: UploadProviderType): UploadStrategy;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getUploadStrategy = getUploadStrategy;
|
|
4
|
-
const
|
|
4
|
+
const errors_1 = require("../errors");
|
|
5
5
|
const upload_provider_options_1 = require("../node-persist/upload-provider-options");
|
|
6
|
+
const index_1 = require("./index");
|
|
6
7
|
function getUploadStrategy(platform) {
|
|
7
8
|
switch (platform) {
|
|
8
9
|
case upload_provider_options_1.UploadProviderType.CLOUDFLARE:
|
|
@@ -12,7 +13,12 @@ function getUploadStrategy(platform) {
|
|
|
12
13
|
case upload_provider_options_1.UploadProviderType.FASTLY:
|
|
13
14
|
return index_1.fastlyStrategy;
|
|
14
15
|
default:
|
|
15
|
-
throw new
|
|
16
|
+
throw new errors_1.ZephyrError(errors_1.ZeErrors.ERR_UNKNOWN, {
|
|
17
|
+
message: 'Unsupported upload provider.',
|
|
18
|
+
data: {
|
|
19
|
+
platform,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
16
22
|
}
|
|
17
23
|
}
|
|
18
24
|
//# sourceMappingURL=get-upload-strategy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-upload-strategy.js","sourceRoot":"","sources":["../../../src/lib/deployment/get-upload-strategy.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"get-upload-strategy.js","sourceRoot":"","sources":["../../../src/lib/deployment/get-upload-strategy.ts"],"names":[],"mappings":";;AAUA,8CAgBC;AAzBD,sCAAkD;AAClD,qFAA6E;AAC7E,mCAA8E;AAO9E,SAAgB,iBAAiB,CAAC,QAA4B;IAC5D,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,4CAAkB,CAAC,UAAU;YAChC,OAAO,0BAAkB,CAAC;QAC5B,KAAK,4CAAkB,CAAC,OAAO;YAC7B,OAAO,uBAAe,CAAC;QACzB,KAAK,4CAAkB,CAAC,MAAM;YAC5B,OAAO,sBAAc,CAAC;QACxB;YACE,MAAM,IAAI,oBAAW,CAAC,iBAAQ,CAAC,WAAW,EAAE;gBAC1C,OAAO,EAAE,8BAA8B;gBACvC,IAAI,EAAE;oBACJ,QAAQ;iBACT;aACF,CAAC,CAAC;IACP,CAAC;AACH,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { UploadOptions, ZephyrEngine } from '../../zephyr-engine';
|
|
1
|
+
import type { UploadOptions, ZephyrEngine } from '../../zephyr-engine';
|
|
2
2
|
export declare function netlifyStrategy(zephyr_engine: ZephyrEngine, { snapshot, getDashData, assets: { assetsMap, missingAssets } }: UploadOptions): Promise<string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ZeBuildAsset, ZeBuildAssetsMap } from 'zephyr-edge-contract';
|
|
2
|
-
import { ZephyrEngine } from '../../../zephyr-engine';
|
|
1
|
+
import type { ZeBuildAsset, ZeBuildAssetsMap } from 'zephyr-edge-contract';
|
|
2
|
+
import type { ZephyrEngine } from '../../../zephyr-engine';
|
|
3
3
|
export interface UploadAssetsOptions {
|
|
4
4
|
assetsMap: ZeBuildAssetsMap;
|
|
5
5
|
missingAssets: ZeBuildAsset[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ZephyrBuildStats } from 'zephyr-edge-contract';
|
|
2
|
-
import { ZephyrEngine } from '../../../zephyr-engine';
|
|
1
|
+
import type { ZephyrBuildStats } from 'zephyr-edge-contract';
|
|
2
|
+
import type { ZephyrEngine } from '../../../zephyr-engine';
|
|
3
3
|
interface UploadBuildStatsAndEnableEnvsOptions {
|
|
4
4
|
getDashData: (zephyr_engine: ZephyrEngine) => ZephyrBuildStats;
|
|
5
5
|
versionUrl: string;
|
|
@@ -26,7 +26,10 @@ async function zeEnableSnapshotOnPages({ pluginOptions: { application_uid }, env
|
|
|
26
26
|
},
|
|
27
27
|
}, json);
|
|
28
28
|
if (!ok) {
|
|
29
|
-
throw new errors_1.ZephyrError(errors_1.ZeErrors.ERR_DEPLOY_LOCAL_BUILD, {
|
|
29
|
+
throw new errors_1.ZephyrError(errors_1.ZeErrors.ERR_DEPLOY_LOCAL_BUILD, {
|
|
30
|
+
cause,
|
|
31
|
+
message: 'Failed to upload envs to Zephyr',
|
|
32
|
+
});
|
|
30
33
|
}
|
|
31
34
|
(0, logging_1.ze_log)('Build successfully deployed.');
|
|
32
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ze-enable-snapshot-on-pages.js","sourceRoot":"","sources":["../../../src/lib/edge-actions/ze-enable-snapshot-on-pages.ts"],"names":[],"mappings":";;AAYA,
|
|
1
|
+
{"version":3,"file":"ze-enable-snapshot-on-pages.js","sourceRoot":"","sources":["../../../src/lib/edge-actions/ze-enable-snapshot-on-pages.ts"],"names":[],"mappings":";;AAYA,0DA2CC;AAtDD,kGAA6F;AAC7F,wCAAoC;AACpC,6DAAwD;AACxD,sCAAkD;AAQ3C,KAAK,UAAU,uBAAuB,CAAC,EAC5C,aAAa,EAAE,EAAE,eAAe,EAAE,EAClC,QAAQ,EACR,SAAS,GACmB;IAC5B,IAAA,gBAAM,EAAC,uCAAuC,CAAC,CAAC;IAChD,IAAA,gBAAM,EAAC,iCAAiC,eAAe,EAAE,CAAC,CAAC;IAE3D,MAAM,IAAI,GAAG,OAAO,CAAC;IACrB,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,iCACtB,QAAQ,KACX,SAAS,IACT,CAAC;IAEH,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,MAAM,IAAA,2DAA2B,EAAC;QAC1D,eAAe;KAChB,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,GAAG,MAAM,+BAAa,CAAC,IAAI,CAC1C;QACE,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,EAAE,IAAI,EAAE;KAChB,EACD;QACE,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,gBAAgB,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;YACpD,cAAc,EAAE,iCAAiC;YACjD,aAAa,EAAE,GAAG;SACnB;KACF,EACD,IAAI,CACL,CAAC;IAEF,IAAI,CAAC,EAAE,EAAE,CAAC;QACR,MAAM,IAAI,oBAAW,CAAC,iBAAQ,CAAC,sBAAsB,EAAE;YACrD,KAAK;YACL,OAAO,EAAE,iCAAiC;SAC3C,CAAC,CAAC;IACL,CAAC;IAED,IAAA,gBAAM,EAAC,8BAA8B,CAAC,CAAC;AACzC,CAAC"}
|