@driveflux/vercel 2.0.2 → 2.0.3-next.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.
- package/dist/deployment/build-vercel-url.js +24 -27
- package/dist/index.js +0 -1
- package/package.json +8 -8
|
@@ -1,36 +1,33 @@
|
|
|
1
1
|
import crypto from 'node:crypto';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
var slugify = function(str) {
|
|
3
|
+
var slug = str.toLowerCase() // Convert to lowercase
|
|
4
|
+
.replace(/\//, '-') // replace one forward slash with hyphen
|
|
5
|
+
.replace(/[^a-z0-9-]/g, '') // Replace any non-alphanumeric characters with hyphens
|
|
6
|
+
.replace(/-+/g, '-') // Replace any consecutive hyphens with a single hyphen
|
|
7
|
+
.replace(/^-|-$/g, '') // Remove any leading or trailing hyphens
|
|
8
|
+
;
|
|
9
9
|
return slug;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
export var truncate = function(prefix, branch, projectName, org) {
|
|
12
|
+
var branchSlug = slugify(branch);
|
|
13
|
+
var deploymentName = "".concat(projectName, "-").concat(prefix, "-").concat(branchSlug, "-").concat(org);
|
|
14
14
|
if (deploymentName.length < 64) {
|
|
15
|
-
return
|
|
15
|
+
return "https://".concat(deploymentName, ".vercel.app");
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
.slice(0, 6);
|
|
22
|
-
const suffix = `${hash.slice(0, 6)}-${org}`;
|
|
23
|
-
const truncatedName = deploymentName.slice(0, 61 - suffix.length);
|
|
24
|
-
return `https://${truncatedName}-${suffix}.vercel.app`;
|
|
17
|
+
var hash = crypto.createHash('sha256').update("git-".concat(branch).concat(projectName)).digest('hex').slice(0, 6);
|
|
18
|
+
var suffix = "".concat(hash.slice(0, 6), "-").concat(org);
|
|
19
|
+
var truncatedName = deploymentName.slice(0, 61 - suffix.length);
|
|
20
|
+
return "https://".concat(truncatedName, "-").concat(suffix, ".vercel.app");
|
|
25
21
|
};
|
|
26
|
-
export
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
export var buildVercelUrl = function(projectName, branchName) {
|
|
23
|
+
var scopeSlug = 'driveflux';
|
|
24
|
+
var prefix = 'git';
|
|
29
25
|
return truncate(prefix, branchName, projectName, scopeSlug);
|
|
30
26
|
};
|
|
31
|
-
export
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
export var isPreviewButNotStaging = function() {
|
|
28
|
+
var KNOWN_BRANCHES = [
|
|
29
|
+
'develop',
|
|
30
|
+
'master'
|
|
31
|
+
];
|
|
32
|
+
return !!process.env.VERCEL_GIT_COMMIT_REF && !KNOWN_BRANCHES.includes(process.env.VERCEL_GIT_COMMIT_REF);
|
|
35
33
|
};
|
|
36
|
-
//# sourceMappingURL=build-vercel-url.js.map
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@driveflux/vercel",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3-next.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@driveflux/fab": "3.0.
|
|
20
|
-
"@driveflux/tsconfig": "2.0.
|
|
21
|
-
"@swc/cli": "0.7.
|
|
22
|
-
"@swc/core": "1.
|
|
23
|
-
"@types/lodash": "^4.17.
|
|
24
|
-
"@types/node": "^
|
|
19
|
+
"@driveflux/fab": "3.0.3-next.0",
|
|
20
|
+
"@driveflux/tsconfig": "2.0.3-next.0",
|
|
21
|
+
"@swc/cli": "^0.7.8",
|
|
22
|
+
"@swc/core": "^1.13.5",
|
|
23
|
+
"@types/lodash": "^4.17.20",
|
|
24
|
+
"@types/node": "^24.3.0",
|
|
25
25
|
"del-cli": "^6.0.0",
|
|
26
|
-
"typescript": "^5.
|
|
26
|
+
"typescript": "^5.9.2"
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"build": "fab",
|