@nx-extend/vercel 1.8.2 → 4.0.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/CHANGELOG.md +30 -1
- package/README.md +1 -0
- package/package.json +7 -7
- package/src/executors/build/build.impl.d.ts +1 -1
- package/src/executors/build/build.impl.js +6 -7
- package/src/executors/build/build.impl.js.map +1 -1
- package/src/executors/build/build.impl.ts +52 -28
- package/src/executors/build/compat.js +1 -1
- package/src/executors/build/compat.js.map +1 -1
- package/src/executors/build/schema.json +0 -1
- package/src/executors/deploy/compat.js +1 -1
- package/src/executors/deploy/compat.js.map +1 -1
- package/src/executors/deploy/deploy.impl.d.ts +1 -1
- package/src/executors/deploy/deploy.impl.js +3 -3
- package/src/executors/deploy/deploy.impl.js.map +1 -1
- package/src/executors/deploy/deploy.impl.ts +29 -16
- package/src/executors/deploy/schema.json +0 -1
- package/src/generators/add/add.impl.d.ts +1 -1
- package/src/generators/add/add.impl.js.map +1 -1
- package/src/generators/add/add.impl.ts +2 -5
- package/src/generators/add/schema.json +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
|
+
|
|
5
|
+
# [4.0.0](https://github.com/TriPSs/nx-extend/compare/vercel@3.0.0...vercel@4.0.0) (2023-06-22)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# [3.0.0](https://github.com/TriPSs/nx-extend/compare/vercel@2.0.0...vercel@3.0.0) (2023-06-22)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# [2.0.0](https://github.com/TriPSs/nx-extend/compare/vercel@1.8.3...vercel@2.0.0) (2023-06-22)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* Updated to NX 16 ([4896bf6](https://github.com/TriPSs/nx-extend/commit/4896bf66940e1b69e0f2e3971a7864a1da20b2ef))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### BREAKING CHANGES
|
|
22
|
+
|
|
23
|
+
* Updated to NX 16
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## [1.8.3](https://github.com/TriPSs/nx-extend/compare/vercel@1.8.2...vercel@1.8.3) (2023-03-30)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
2
31
|
## [1.8.2](https://github.com/TriPSs/nx-extend/compare/vercel@1.8.1...vercel@1.8.2) (2022-12-29)
|
|
3
32
|
|
|
4
33
|
|
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx-extend/vercel",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"nx",
|
|
6
6
|
"vercel"
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
"main": "src/index.js",
|
|
18
18
|
"builders": "./executors.json",
|
|
19
19
|
"generators": "./generators.json",
|
|
20
|
-
"types": "./src/index.d.ts",
|
|
21
20
|
"dependencies": {
|
|
22
|
-
"@
|
|
23
|
-
"@nx
|
|
24
|
-
"shelljs": "0.8.5",
|
|
25
|
-
"@
|
|
21
|
+
"@actions/core": "^1.10.0",
|
|
22
|
+
"@nx/devkit": "16.3.2",
|
|
23
|
+
"shelljs": "^0.8.5",
|
|
24
|
+
"@nx-extend/core": "4.0.0",
|
|
25
|
+
"tslib": "2.5.3"
|
|
26
26
|
},
|
|
27
|
-
"
|
|
27
|
+
"types": "./src/index.d.ts"
|
|
28
28
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildExecutor = void 0;
|
|
4
|
-
const devkit_1 = require("@
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const core_1 = require("@nx-extend/core");
|
|
6
6
|
const fs_1 = require("fs");
|
|
7
7
|
const path_1 = require("path");
|
|
@@ -27,7 +27,8 @@ function buildExecutor(options, context) {
|
|
|
27
27
|
if (!((_b = (_a = targets[buildTarget]) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.outputPath)) {
|
|
28
28
|
throw new Error(`"${buildTarget}" target has no "outputPath" configured!`);
|
|
29
29
|
}
|
|
30
|
-
if (options.buildConfig &&
|
|
30
|
+
if (options.buildConfig &&
|
|
31
|
+
!((_c = targets[buildTarget]) === null || _c === void 0 ? void 0 : _c.configurations[options.buildConfig])) {
|
|
31
32
|
throw new Error(`"${buildTarget}" target has no configuration "${options.buildConfig}"!`);
|
|
32
33
|
}
|
|
33
34
|
const vercelDirectory = '.vercel';
|
|
@@ -43,9 +44,7 @@ function buildExecutor(options, context) {
|
|
|
43
44
|
orgId: options.orgId,
|
|
44
45
|
settings: {}
|
|
45
46
|
});
|
|
46
|
-
const vercelEnironment = context.configurationName === 'production'
|
|
47
|
-
? 'production'
|
|
48
|
-
: 'preview';
|
|
47
|
+
const vercelEnironment = context.configurationName === 'production' ? 'production' : 'preview';
|
|
49
48
|
// Pull latest
|
|
50
49
|
const { success: pullSuccess } = (0, core_1.execCommand)((0, core_1.buildCommand)([
|
|
51
50
|
'npx vercel pull --yes',
|
|
@@ -73,12 +72,12 @@ function buildExecutor(options, context) {
|
|
|
73
72
|
createdAt: new Date().getTime(),
|
|
74
73
|
framework,
|
|
75
74
|
devCommand: null,
|
|
76
|
-
installCommand:
|
|
75
|
+
installCommand: "echo ''",
|
|
77
76
|
buildCommand: `nx run ${context.projectName}:${buildTarget}:${options.buildConfig || context.configurationName}`,
|
|
78
77
|
outputDirectory: (0, get_output_directory_1.getOutputDirectory)(framework, outputDirectory),
|
|
79
78
|
rootDirectory: null,
|
|
80
79
|
directoryListing: false,
|
|
81
|
-
nodeVersion: options.nodeVersion || '
|
|
80
|
+
nodeVersion: options.nodeVersion || '18.x'
|
|
82
81
|
}
|
|
83
82
|
});
|
|
84
83
|
const { success } = (0, core_1.execCommand)((0, core_1.buildCommand)([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.impl.js","sourceRoot":"","sources":["../../../../../../packages/vercel/src/executors/build/build.impl.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"build.impl.js","sourceRoot":"","sources":["../../../../../../packages/vercel/src/executors/build/build.impl.ts"],"names":[],"mappings":";;;AAAA,uCAAwD;AACxD,0CAAqE;AACrE,2BAAuC;AACvC,+BAA2B;AAI3B,qFAA6E;AAC7E,+EAAwE;AACxE,2DAAqD;AACrD,2DAAsD;AACtD,uEAAiE;AAajE,SAAgB,aAAa,CAC3B,OAAqB,EACrB,OAAwB;;IAExB,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;IACnE,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,QAAQ,CAAA;IAC/C,MAAM,WAAW,GACf,OAAO,CAAC,WAAW,IAAI,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;IAE1E,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;QAClB,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAA;KAC/C;IAED,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE;QACtB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;KACnD;IAED,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;QACzB,MAAM,IAAI,KAAK,CACb,IAAI,OAAO,CAAC,WAAW,qBAAqB,WAAW,WAAW,CACnE,CAAA;KACF;IAED,IAAI,CAAC,CAAA,MAAA,MAAA,OAAO,CAAC,WAAW,CAAC,0CA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Y,OAAO,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,UAAU,iBAAiB;QACpE,OAAO,CAAC,iBAAiB,KAAK,YAAY,IAAI,QAAQ;QACtD,0BAAW,IAAI,WAAW,0BAAW,EAAE;QAEvC,OAAO,CAAC,KAAK,IAAI,SAAS;KAC3B,CAAC,CACH,CAAA;IAED,IAAI,OAAO,EAAE;QACX,kDAAkD;QAClD,IAAA,sBAAa,EACX,IAAA,WAAI,EAAC,eAAe,EAAE,eAAe,EAAE,cAAc,CAAC,EACtD,IAAA,qBAAY,EAAC,iBAAiB,CAAC,CAChC,CAAA;QACD,+BAA+B;QAC/B,IAAA,eAAQ,EACN,qBAAqB,EACrB,IAAA,WAAI,EAAC,eAAe,EAAE,eAAe,CAAC,EACtC,aAAa,CACd,CAAA;QACD,8BAA8B;QAC9B,IAAA,eAAQ,EACN,OAAO,CAAC,IAAI,EACZ,IAAA,WAAI,EAAC,eAAe,EAAE,eAAe,CAAC,EACtC,eAAe,CAChB,CAAA;KACF;IAED,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,CAAA;AACrC,CAAC;AAtID,sCAsIC;AAED,kBAAe,aAAa,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { readJsonFile, writeJsonFile } from '@
|
|
1
|
+
import { readJsonFile, writeJsonFile } from '@nx/devkit'
|
|
2
2
|
import { buildCommand, copyFile, execCommand } from '@nx-extend/core'
|
|
3
3
|
import { existsSync, rmSync } from 'fs'
|
|
4
4
|
import { join } from 'path'
|
|
5
5
|
|
|
6
|
-
import type { ExecutorContext } from '@
|
|
6
|
+
import type { ExecutorContext } from '@nx/devkit'
|
|
7
7
|
|
|
8
8
|
import { addEnvVariablesToFile } from '../../utils/add-env-variables-to-file'
|
|
9
9
|
import { enrichVercelEnvFile } from '../../utils/enrich-vercel-env-file'
|
|
@@ -28,7 +28,8 @@ export function buildExecutor(
|
|
|
28
28
|
): Promise<{ success: boolean }> {
|
|
29
29
|
const { targets } = context.workspace.projects[context.projectName]
|
|
30
30
|
const framework = options.framework || 'nextjs'
|
|
31
|
-
const buildTarget =
|
|
31
|
+
const buildTarget =
|
|
32
|
+
options.buildTarget || (framework === 'nextjs' ? 'build-next' : 'build')
|
|
32
33
|
|
|
33
34
|
if (!options.orgId) {
|
|
34
35
|
throw new Error(`"orgId" option is required!`)
|
|
@@ -39,15 +40,22 @@ export function buildExecutor(
|
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
if (!targets[buildTarget]) {
|
|
42
|
-
throw new Error(
|
|
43
|
+
throw new Error(
|
|
44
|
+
`"${context.projectName}" is missing the "${buildTarget}" target!`
|
|
45
|
+
)
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
if (!targets[buildTarget]?.options?.outputPath) {
|
|
46
49
|
throw new Error(`"${buildTarget}" target has no "outputPath" configured!`)
|
|
47
50
|
}
|
|
48
51
|
|
|
49
|
-
if (
|
|
50
|
-
|
|
52
|
+
if (
|
|
53
|
+
options.buildConfig &&
|
|
54
|
+
!targets[buildTarget]?.configurations[options.buildConfig]
|
|
55
|
+
) {
|
|
56
|
+
throw new Error(
|
|
57
|
+
`"${buildTarget}" target has no configuration "${options.buildConfig}"!`
|
|
58
|
+
)
|
|
51
59
|
}
|
|
52
60
|
|
|
53
61
|
const vercelDirectory = '.vercel'
|
|
@@ -66,18 +74,19 @@ export function buildExecutor(
|
|
|
66
74
|
settings: {}
|
|
67
75
|
})
|
|
68
76
|
|
|
69
|
-
const vercelEnironment =
|
|
70
|
-
? 'production'
|
|
71
|
-
: 'preview'
|
|
77
|
+
const vercelEnironment =
|
|
78
|
+
context.configurationName === 'production' ? 'production' : 'preview'
|
|
72
79
|
|
|
73
80
|
// Pull latest
|
|
74
|
-
const { success: pullSuccess } = execCommand(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
81
|
+
const { success: pullSuccess } = execCommand(
|
|
82
|
+
buildCommand([
|
|
83
|
+
'npx vercel pull --yes',
|
|
84
|
+
`--environment=${vercelEnironment}`,
|
|
85
|
+
vercelToken && `--token=${vercelToken}`,
|
|
78
86
|
|
|
79
|
-
|
|
80
|
-
|
|
87
|
+
options.debug && '--debug'
|
|
88
|
+
])
|
|
89
|
+
)
|
|
81
90
|
|
|
82
91
|
if (!pullSuccess) {
|
|
83
92
|
throw new Error(`Was unable to pull!`)
|
|
@@ -104,31 +113,46 @@ export function buildExecutor(
|
|
|
104
113
|
createdAt: new Date().getTime(),
|
|
105
114
|
framework,
|
|
106
115
|
devCommand: null,
|
|
107
|
-
installCommand:
|
|
108
|
-
buildCommand: `nx run ${context.projectName}:${buildTarget}:${
|
|
116
|
+
installCommand: "echo ''",
|
|
117
|
+
buildCommand: `nx run ${context.projectName}:${buildTarget}:${
|
|
118
|
+
options.buildConfig || context.configurationName
|
|
119
|
+
}`,
|
|
109
120
|
outputDirectory: getOutputDirectory(framework, outputDirectory),
|
|
110
121
|
rootDirectory: null,
|
|
111
122
|
directoryListing: false,
|
|
112
|
-
nodeVersion: options.nodeVersion || '
|
|
123
|
+
nodeVersion: options.nodeVersion || '18.x'
|
|
113
124
|
}
|
|
114
125
|
})
|
|
115
126
|
|
|
116
|
-
const { success } = execCommand(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
127
|
+
const { success } = execCommand(
|
|
128
|
+
buildCommand([
|
|
129
|
+
'npx vercel build',
|
|
130
|
+
`--output ${targets[buildTarget].options.outputPath}/.vercel/output`,
|
|
131
|
+
context.configurationName === 'production' && '--prod',
|
|
132
|
+
vercelToken && `--token=${vercelToken}`,
|
|
121
133
|
|
|
122
|
-
|
|
123
|
-
|
|
134
|
+
options.debug && '--debug'
|
|
135
|
+
])
|
|
136
|
+
)
|
|
124
137
|
|
|
125
138
|
if (success) {
|
|
126
139
|
// Write the project.json to the .vercel directory
|
|
127
|
-
writeJsonFile(
|
|
140
|
+
writeJsonFile(
|
|
141
|
+
join(outputDirectory, vercelDirectory, 'project.json'),
|
|
142
|
+
readJsonFile(vercelProjectJson)
|
|
143
|
+
)
|
|
128
144
|
// Also copy over the env files
|
|
129
|
-
copyFile(
|
|
145
|
+
copyFile(
|
|
146
|
+
vercelEnvFileLocation,
|
|
147
|
+
join(outputDirectory, vercelDirectory),
|
|
148
|
+
vercelEnvFile
|
|
149
|
+
)
|
|
130
150
|
// Also copy the .vercelignore
|
|
131
|
-
copyFile(
|
|
151
|
+
copyFile(
|
|
152
|
+
context.root,
|
|
153
|
+
join(outputDirectory, vercelDirectory),
|
|
154
|
+
'.vercelignore'
|
|
155
|
+
)
|
|
132
156
|
}
|
|
133
157
|
|
|
134
158
|
return Promise.resolve({ success })
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const devkit_1 = require("@
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
4
|
const build_impl_1 = require("./build.impl");
|
|
5
5
|
exports.default = (0, devkit_1.convertNxExecutor)(build_impl_1.buildExecutor);
|
|
6
6
|
//# sourceMappingURL=compat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/vercel/src/executors/build/compat.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/vercel/src/executors/build/compat.ts"],"names":[],"mappings":";;AAAA,uCAA8C;AAE9C,6CAA4C;AAE5C,kBAAe,IAAA,0BAAiB,EAAC,0BAAa,CAAC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const devkit_1 = require("@
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
4
|
const deploy_impl_1 = require("./deploy.impl");
|
|
5
5
|
exports.default = (0, devkit_1.convertNxExecutor)(deploy_impl_1.deployExecutor);
|
|
6
6
|
//# sourceMappingURL=compat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/vercel/src/executors/deploy/compat.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/vercel/src/executors/deploy/compat.ts"],"names":[],"mappings":";;AAAA,uCAA8C;AAE9C,+CAA8C;AAE9C,kBAAe,IAAA,0BAAiB,EAAC,4BAAc,CAAC,CAAA"}
|
|
@@ -33,10 +33,10 @@ function deployExecutor(options, context) {
|
|
|
33
33
|
if (is_github_ci_1.isGithubCi) {
|
|
34
34
|
// Add comment instead of summary (Look at https://github.com/mshick/add-pr-comment)
|
|
35
35
|
const parts = output.split('\n');
|
|
36
|
-
const url = parts.find((part) => part.trim().startsWith('https://') &&
|
|
36
|
+
const url = parts.find((part) => part.trim().startsWith('https://') &&
|
|
37
|
+
part.trim().endsWith('.vercel.app'));
|
|
37
38
|
if (url) {
|
|
38
|
-
githubCore.summary
|
|
39
|
-
.addLink('Vercel URL', url.trim());
|
|
39
|
+
githubCore.summary.addLink('Vercel URL', url.trim());
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
return { success };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.impl.js","sourceRoot":"","sources":["../../../../../../packages/vercel/src/executors/deploy/deploy.impl.ts"],"names":[],"mappings":";;;;AAAA,4CAA2C;AAC3C,0CAA2D;AAC3D,2BAA+B;AAC/B,+BAA2B;AAI3B,2DAAqD;AACrD,2DAAsD;AAOtD,SAAsB,cAAc,CAClC,OAAsB,EACtB,OAAwB;;;QAExB,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;QAEnE,MAAM,iBAAiB,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"deploy.impl.js","sourceRoot":"","sources":["../../../../../../packages/vercel/src/executors/deploy/deploy.impl.ts"],"names":[],"mappings":";;;;AAAA,4CAA2C;AAC3C,0CAA2D;AAC3D,2BAA+B;AAC/B,+BAA2B;AAI3B,2DAAqD;AACrD,2DAAsD;AAOtD,SAAsB,cAAc,CAClC,OAAsB,EACtB,OAAwB;;;QAExB,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;QAEnE,MAAM,iBAAiB,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CACjD,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,KAAK,yBAAyB,CACnE,CAAA;QACD,MAAM,WAAW,GACf,CAAA,MAAA,MAAA,OAAO,CAAC,iBAAiB,CAAC,0CAAE,OAAO,0CAAE,WAAW,KAAI,YAAY,CAAA;QAElE,IAAI,CAAC,CAAA,MAAA,MAAA,OAAO,CAAC,WAAW,CAAC,0CAAE,OAAO,0CAAE,UAAU,CAAA,EAAE;YAC9C,MAAM,IAAI,KAAK,CAAC,IAAI,WAAW,0CAA0C,CAAC,CAAA;SAC3E;QAED,IACE,CAAC,IAAA,eAAU,EACT,IAAA,WAAI,EAAC,OAAO,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,sBAAsB,CAAC,CACtE,EACD;YACA,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAA;SACpE;QAED,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAA,kBAAW,EACrC,IAAA,mBAAY,EAAC;YACX,8BAA8B;YAC9B,OAAO,CAAC,iBAAiB,KAAK,YAAY,IAAI,QAAQ;YACtD,0BAAW,IAAI,WAAW,0BAAW,EAAE;YACvC,OAAO,CAAC,OAAO,IAAI,aAAa,OAAO,CAAC,OAAO,EAAE;YAEjD,OAAO,CAAC,KAAK,IAAI,SAAS;SAC3B,CAAC,EACF;YACE,GAAG,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,UAAU;SAC7C,CACF,CAAA;QAED,qEAAqE;QACrE,IAAI,yBAAU,EAAE;YACd,oFAAoF;YACpF,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YAEhC,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CACpB,CAAC,IAAI,EAAE,EAAE,CACP,IAAI,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;gBAClC,IAAI,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,CACtC,CAAA;YAED,IAAI,GAAG,EAAE;gBACP,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,CAAA;aACrD;SACF;QAED,OAAO,EAAE,OAAO,EAAE,CAAA;;CACnB;AAvDD,wCAuDC;AAED,kBAAe,cAAc,CAAA"}
|
|
@@ -3,7 +3,7 @@ import { buildCommand, execCommand } from '@nx-extend/core'
|
|
|
3
3
|
import { existsSync } from 'fs'
|
|
4
4
|
import { join } from 'path'
|
|
5
5
|
|
|
6
|
-
import type { ExecutorContext } from '@
|
|
6
|
+
import type { ExecutorContext } from '@nx/devkit'
|
|
7
7
|
|
|
8
8
|
import { isGithubCi } from '../../utils/is-github-ci'
|
|
9
9
|
import { vercelToken } from '../../utils/vercel-token'
|
|
@@ -19,38 +19,51 @@ export async function deployExecutor(
|
|
|
19
19
|
): Promise<{ success: boolean }> {
|
|
20
20
|
const { targets } = context.workspace.projects[context.projectName]
|
|
21
21
|
|
|
22
|
-
const vercelBuildTarget = Object.keys(targets).find(
|
|
23
|
-
|
|
22
|
+
const vercelBuildTarget = Object.keys(targets).find(
|
|
23
|
+
(target) => targets[target].executor === '@nx-extend/vercel:build'
|
|
24
|
+
)
|
|
25
|
+
const buildTarget =
|
|
26
|
+
targets[vercelBuildTarget]?.options?.buildTarget || 'build-next'
|
|
24
27
|
|
|
25
28
|
if (!targets[buildTarget]?.options?.outputPath) {
|
|
26
29
|
throw new Error(`"${buildTarget}" target has no "outputPath" configured!`)
|
|
27
30
|
}
|
|
28
31
|
|
|
29
|
-
if (
|
|
32
|
+
if (
|
|
33
|
+
!existsSync(
|
|
34
|
+
join(targets[buildTarget].options.outputPath, '.vercel/project.json')
|
|
35
|
+
)
|
|
36
|
+
) {
|
|
30
37
|
throw new Error('No ".vercel/project.json" found in dist folder! ')
|
|
31
38
|
}
|
|
32
39
|
|
|
33
|
-
const { success, output } = execCommand(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
const { success, output } = execCommand(
|
|
41
|
+
buildCommand([
|
|
42
|
+
'npx vercel deploy --prebuilt',
|
|
43
|
+
context.configurationName === 'production' && '--prod',
|
|
44
|
+
vercelToken && `--token=${vercelToken}`,
|
|
45
|
+
options.regions && `--regions=${options.regions}`,
|
|
38
46
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
47
|
+
options.debug && '--debug'
|
|
48
|
+
]),
|
|
49
|
+
{
|
|
50
|
+
cwd: targets[buildTarget].options.outputPath
|
|
51
|
+
}
|
|
52
|
+
)
|
|
43
53
|
|
|
44
54
|
// When running in GitHub CI add the URL of the deployment as summary
|
|
45
55
|
if (isGithubCi) {
|
|
46
56
|
// Add comment instead of summary (Look at https://github.com/mshick/add-pr-comment)
|
|
47
57
|
const parts = output.split('\n')
|
|
48
58
|
|
|
49
|
-
const url = parts.find(
|
|
59
|
+
const url = parts.find(
|
|
60
|
+
(part) =>
|
|
61
|
+
part.trim().startsWith('https://') &&
|
|
62
|
+
part.trim().endsWith('.vercel.app')
|
|
63
|
+
)
|
|
50
64
|
|
|
51
65
|
if (url) {
|
|
52
|
-
githubCore.summary
|
|
53
|
-
.addLink('Vercel URL', url.trim())
|
|
66
|
+
githubCore.summary.addLink('Vercel URL', url.trim())
|
|
54
67
|
}
|
|
55
68
|
}
|
|
56
69
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add.impl.js","sourceRoot":"","sources":["../../../../../../packages/vercel/src/generators/add/add.impl.ts"],"names":[],"mappings":";;;AACA,0CAA2D;AAQ3D,SAA8B,SAAS,
|
|
1
|
+
{"version":3,"file":"add.impl.js","sourceRoot":"","sources":["../../../../../../packages/vercel/src/generators/add/add.impl.ts"],"names":[],"mappings":";;;AACA,0CAA2D;AAQ3D,SAA8B,SAAS,CAAC,IAAU,EAAE,OAAmB;;QACrE,IAAA,kBAAW,EAAC,aAAa,CAAC,CAAA;QAC1B,6BAA6B;QAC7B,8CAA8C;QAC9C,MAAM;IACR,CAAC;CAAA;AALD,4BAKC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Tree } from '@
|
|
1
|
+
import { Tree } from '@nx/devkit'
|
|
2
2
|
import { buildCommand, execCommand } from '@nx-extend/core'
|
|
3
3
|
|
|
4
4
|
export interface AddOptions {
|
|
@@ -7,10 +7,7 @@ export interface AddOptions {
|
|
|
7
7
|
createProject?: boolean
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export default async function AddVercel(
|
|
11
|
-
host: Tree,
|
|
12
|
-
options: AddOptions
|
|
13
|
-
) {
|
|
10
|
+
export default async function AddVercel(host: Tree, options: AddOptions) {
|
|
14
11
|
execCommand('echo "TODO"')
|
|
15
12
|
// execCommand(buildCommand([
|
|
16
13
|
// 'npx vercel projects add <project name>',
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"cli": "nx",
|
|
4
3
|
"id": "Vercel",
|
|
5
4
|
"title": "",
|
|
6
5
|
"type": "object",
|
|
@@ -15,5 +14,8 @@
|
|
|
15
14
|
"x-prompt": "To what target would you like to add Vercel?"
|
|
16
15
|
}
|
|
17
16
|
},
|
|
18
|
-
"required": [
|
|
17
|
+
"required": [
|
|
18
|
+
"target",
|
|
19
|
+
"site"
|
|
20
|
+
]
|
|
19
21
|
}
|