@nx-extend/vercel 1.7.0 → 1.8.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 +15 -0
- package/package.json +2 -1
- package/src/executors/build/build.impl.js +15 -7
- package/src/executors/build/build.impl.js.map +1 -1
- package/src/executors/build/build.impl.ts +18 -7
- package/src/executors/deploy/deploy.impl.js +3 -2
- package/src/executors/deploy/deploy.impl.js.map +1 -1
- package/src/executors/deploy/deploy.impl.ts +3 -2
- package/src/utils/vercel-token.d.ts +1 -0
- package/src/utils/vercel-token.js +5 -0
- package/src/utils/vercel-token.js.map +1 -0
- package/src/utils/verce-token.d.ts +0 -1
- package/src/utils/verce-token.js +0 -5
- package/src/utils/verce-token.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
|
|
2
|
+
# [1.8.0](https://github.com/TriPSs/nx-extend/compare/vercel@1.7.0...vercel@1.8.0) (2022-12-28)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* **vercel:** Fixed correct output dir not being set for framework ([3a1a5fc](https://github.com/TriPSs/nx-extend/commit/3a1a5fc0ca5bd47fbab0a03af2da1f97a29dc633))
|
|
8
|
+
* **vercel:** Remove existing `.vercel` directory before build ([cee166c](https://github.com/TriPSs/nx-extend/commit/cee166cfcb5f9f626256ce35e9c5af2d6d27463c))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **vercel:** Throw error if pull failed ([bac8c04](https://github.com/TriPSs/nx-extend/commit/bac8c0486f7de1367deea6e0b69a59b808a7cdce))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
2
17
|
# [1.7.0](https://github.com/TriPSs/nx-extend/compare/vercel@1.6.0...vercel@1.7.0) (2022-12-19)
|
|
3
18
|
|
|
4
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx-extend/vercel",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"nx",
|
|
6
6
|
"vercel"
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"generators": "./generators.json",
|
|
20
20
|
"types": "./src/index.d.ts",
|
|
21
21
|
"dependencies": {
|
|
22
|
+
"@nrwl/devkit": "15.3.3",
|
|
22
23
|
"@nx-extend/core": "1.4.0",
|
|
23
24
|
"shelljs": "0.8.5",
|
|
24
25
|
"@actions/core": "1.10.0"
|
|
@@ -3,11 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.buildExecutor = void 0;
|
|
4
4
|
const devkit_1 = require("@nrwl/devkit");
|
|
5
5
|
const core_1 = require("@nx-extend/core");
|
|
6
|
+
const fs_1 = require("fs");
|
|
6
7
|
const path_1 = require("path");
|
|
7
8
|
const add_env_variables_to_file_1 = require("../../utils/add-env-variables-to-file");
|
|
8
9
|
const enrich_vercel_env_file_1 = require("../../utils/enrich-vercel-env-file");
|
|
9
10
|
const get_env_vars_1 = require("../../utils/get-env-vars");
|
|
10
|
-
const
|
|
11
|
+
const vercel_token_1 = require("../../utils/vercel-token");
|
|
11
12
|
const get_output_directory_1 = require("./utils/get-output-directory");
|
|
12
13
|
function buildExecutor(options, context) {
|
|
13
14
|
var _a, _b, _c, _d, _e;
|
|
@@ -29,8 +30,13 @@ function buildExecutor(options, context) {
|
|
|
29
30
|
if (options.buildConfig && !((_c = targets[buildTarget]) === null || _c === void 0 ? void 0 : _c.configurations[options.buildConfig])) {
|
|
30
31
|
throw new Error(`"${buildTarget}" target has no configuration "${options.buildConfig}"!`);
|
|
31
32
|
}
|
|
33
|
+
const vercelDirectory = '.vercel';
|
|
34
|
+
const vercelDirectoryLocation = (0, path_1.join)(context.root, vercelDirectory);
|
|
35
|
+
if ((0, fs_1.existsSync)(vercelDirectoryLocation)) {
|
|
36
|
+
(0, fs_1.rmSync)(vercelDirectoryLocation);
|
|
37
|
+
}
|
|
32
38
|
// First make sure the .vercel/project.json exists
|
|
33
|
-
(0, devkit_1.writeJsonFile)(
|
|
39
|
+
(0, devkit_1.writeJsonFile)(`./${vercelDirectory}/project.json`, {
|
|
34
40
|
projectId: options.projectId,
|
|
35
41
|
orgId: options.orgId,
|
|
36
42
|
settings: {}
|
|
@@ -39,13 +45,15 @@ function buildExecutor(options, context) {
|
|
|
39
45
|
? 'production'
|
|
40
46
|
: 'preview';
|
|
41
47
|
// Pull latest
|
|
42
|
-
(0, core_1.execCommand)((0, core_1.buildCommand)([
|
|
48
|
+
const { success: pullSuccess } = (0, core_1.execCommand)((0, core_1.buildCommand)([
|
|
43
49
|
'npx vercel pull --yes',
|
|
44
50
|
`--environment=${vercelEnironment}`,
|
|
45
|
-
|
|
51
|
+
vercel_token_1.vercelToken && `--token=${vercel_token_1.vercelToken}`,
|
|
46
52
|
options.debug && '--debug'
|
|
47
53
|
]));
|
|
48
|
-
|
|
54
|
+
if (!pullSuccess) {
|
|
55
|
+
throw new Error(`Was unable to pull!`);
|
|
56
|
+
}
|
|
49
57
|
const vercelProjectJson = `./${vercelDirectory}/project.json`;
|
|
50
58
|
const outputDirectory = (_e = (_d = targets[buildTarget]) === null || _d === void 0 ? void 0 : _d.options) === null || _e === void 0 ? void 0 : _e.outputPath;
|
|
51
59
|
const vercelEnvFile = `.env.${vercelEnironment}.local`;
|
|
@@ -65,7 +73,7 @@ function buildExecutor(options, context) {
|
|
|
65
73
|
devCommand: null,
|
|
66
74
|
installCommand: 'echo \'\'',
|
|
67
75
|
buildCommand: `nx run ${context.projectName}:${buildTarget}:${options.buildConfig || context.configurationName}`,
|
|
68
|
-
outputDirectory: (0, get_output_directory_1.getOutputDirectory)(
|
|
76
|
+
outputDirectory: (0, get_output_directory_1.getOutputDirectory)(framework, outputDirectory),
|
|
69
77
|
rootDirectory: null,
|
|
70
78
|
directoryListing: false,
|
|
71
79
|
nodeVersion: options.nodeVersion || '16.x'
|
|
@@ -75,7 +83,7 @@ function buildExecutor(options, context) {
|
|
|
75
83
|
'npx vercel build',
|
|
76
84
|
`--output ${targets[buildTarget].options.outputPath}/.vercel/output`,
|
|
77
85
|
context.configurationName === 'production' && '--prod',
|
|
78
|
-
|
|
86
|
+
vercel_token_1.vercelToken && `--token=${vercel_token_1.vercelToken}`,
|
|
79
87
|
options.debug && '--debug'
|
|
80
88
|
]));
|
|
81
89
|
if (success) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.impl.js","sourceRoot":"","sources":["../../../../../../packages/vercel/src/executors/build/build.impl.ts"],"names":[],"mappings":";;;AAAA,yCAA0D;AAC1D,0CAAqE;AACrE,+BAA2B;AAI3B,qFAA6E;AAC7E,+EAAwE;AACxE,2DAAqD;AACrD,
|
|
1
|
+
{"version":3,"file":"build.impl.js","sourceRoot":"","sources":["../../../../../../packages/vercel/src/executors/build/build.impl.ts"],"names":[],"mappings":";;;AAAA,yCAA0D;AAC1D,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,GAAG,OAAO,CAAC,WAAW,IAAI,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;IAE5F,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;QAClB,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAA;KAC/C;IAED,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IAAA,yCAAkB,EAAC,SAAS,EAAE,eAAe,CAAC;YAC/D,aAAa,EAAE,IAAI;YACnB,gBAAgB,EAAE,KAAK;YACvB,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,MAAM;SAC3C;KACF,CAAC,CAAA;IAEF,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,kBAAW,EAAC,IAAA,mBAAY,EAAC;QAC3C,kBAAkB;QAClB,YAAY,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,CAAC,CAAA;IAEH,IAAI,OAAO,EAAE;QACX,kDAAkD;QAClD,IAAA,sBAAa,EAAC,IAAA,WAAI,EAAC,eAAe,EAAE,eAAe,EAAE,cAAc,CAAC,EAAE,IAAA,qBAAY,EAAC,iBAAiB,CAAC,CAAC,CAAA;QACtG,+BAA+B;QAC/B,IAAA,eAAQ,EAAC,qBAAqB,EAAE,IAAA,WAAI,EAAC,eAAe,EAAE,eAAe,CAAC,EAAE,aAAa,CAAC,CAAA;QACtF,8BAA8B;QAC9B,IAAA,eAAQ,EAAC,OAAO,CAAC,IAAI,EAAE,IAAA,WAAI,EAAC,eAAe,EAAE,eAAe,CAAC,EAAE,eAAe,CAAC,CAAA;KAChF;IAED,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,CAAA;AACrC,CAAC;AA5GD,sCA4GC;AAED,kBAAe,aAAa,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { readJsonFile, writeJsonFile } from '@nrwl/devkit'
|
|
2
2
|
import { buildCommand, copyFile, execCommand } from '@nx-extend/core'
|
|
3
|
+
import { existsSync, rmSync } from 'fs'
|
|
3
4
|
import { join } from 'path'
|
|
4
5
|
|
|
5
6
|
import type { ExecutorContext } from '@nrwl/devkit'
|
|
@@ -7,7 +8,7 @@ import type { ExecutorContext } from '@nrwl/devkit'
|
|
|
7
8
|
import { addEnvVariablesToFile } from '../../utils/add-env-variables-to-file'
|
|
8
9
|
import { enrichVercelEnvFile } from '../../utils/enrich-vercel-env-file'
|
|
9
10
|
import { getEnvVars } from '../../utils/get-env-vars'
|
|
10
|
-
import {
|
|
11
|
+
import { vercelToken } from '../../utils/vercel-token'
|
|
11
12
|
import { getOutputDirectory } from './utils/get-output-directory'
|
|
12
13
|
|
|
13
14
|
export interface BuildOptions {
|
|
@@ -49,8 +50,15 @@ export function buildExecutor(
|
|
|
49
50
|
throw new Error(`"${buildTarget}" target has no configuration "${options.buildConfig}"!`)
|
|
50
51
|
}
|
|
51
52
|
|
|
53
|
+
const vercelDirectory = '.vercel'
|
|
54
|
+
const vercelDirectoryLocation = join(context.root, vercelDirectory)
|
|
55
|
+
|
|
56
|
+
if (existsSync(vercelDirectoryLocation)) {
|
|
57
|
+
rmSync(vercelDirectoryLocation)
|
|
58
|
+
}
|
|
59
|
+
|
|
52
60
|
// First make sure the .vercel/project.json exists
|
|
53
|
-
writeJsonFile(
|
|
61
|
+
writeJsonFile(`./${vercelDirectory}/project.json`, {
|
|
54
62
|
projectId: options.projectId,
|
|
55
63
|
orgId: options.orgId,
|
|
56
64
|
settings: {}
|
|
@@ -61,15 +69,18 @@ export function buildExecutor(
|
|
|
61
69
|
: 'preview'
|
|
62
70
|
|
|
63
71
|
// Pull latest
|
|
64
|
-
execCommand(buildCommand([
|
|
72
|
+
const { success: pullSuccess } = execCommand(buildCommand([
|
|
65
73
|
'npx vercel pull --yes',
|
|
66
74
|
`--environment=${vercelEnironment}`,
|
|
67
|
-
|
|
75
|
+
vercelToken && `--token=${vercelToken}`,
|
|
68
76
|
|
|
69
77
|
options.debug && '--debug'
|
|
70
78
|
]))
|
|
71
79
|
|
|
72
|
-
|
|
80
|
+
if (!pullSuccess) {
|
|
81
|
+
throw new Error(`Was unable to pull!`)
|
|
82
|
+
}
|
|
83
|
+
|
|
73
84
|
const vercelProjectJson = `./${vercelDirectory}/project.json`
|
|
74
85
|
const outputDirectory = targets[buildTarget]?.options?.outputPath
|
|
75
86
|
|
|
@@ -93,7 +104,7 @@ export function buildExecutor(
|
|
|
93
104
|
devCommand: null,
|
|
94
105
|
installCommand: 'echo \'\'',
|
|
95
106
|
buildCommand: `nx run ${context.projectName}:${buildTarget}:${options.buildConfig || context.configurationName}`,
|
|
96
|
-
outputDirectory: getOutputDirectory(
|
|
107
|
+
outputDirectory: getOutputDirectory(framework, outputDirectory),
|
|
97
108
|
rootDirectory: null,
|
|
98
109
|
directoryListing: false,
|
|
99
110
|
nodeVersion: options.nodeVersion || '16.x'
|
|
@@ -104,7 +115,7 @@ export function buildExecutor(
|
|
|
104
115
|
'npx vercel build',
|
|
105
116
|
`--output ${targets[buildTarget].options.outputPath}/.vercel/output`,
|
|
106
117
|
context.configurationName === 'production' && '--prod',
|
|
107
|
-
|
|
118
|
+
vercelToken && `--token=${vercelToken}`,
|
|
108
119
|
|
|
109
120
|
options.debug && '--debug'
|
|
110
121
|
]))
|
|
@@ -7,7 +7,7 @@ const core_1 = require("@nx-extend/core");
|
|
|
7
7
|
const fs_1 = require("fs");
|
|
8
8
|
const path_1 = require("path");
|
|
9
9
|
const is_github_ci_1 = require("../../utils/is-github-ci");
|
|
10
|
-
const
|
|
10
|
+
const vercel_token_1 = require("../../utils/vercel-token");
|
|
11
11
|
function deployExecutor(options, context) {
|
|
12
12
|
var _a, _b, _c, _d;
|
|
13
13
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -23,7 +23,7 @@ function deployExecutor(options, context) {
|
|
|
23
23
|
const { success, output } = (0, core_1.execCommand)((0, core_1.buildCommand)([
|
|
24
24
|
'npx vercel deploy --prebuilt',
|
|
25
25
|
context.configurationName === 'production' && '--prod',
|
|
26
|
-
|
|
26
|
+
vercel_token_1.vercelToken && `--token=${vercel_token_1.vercelToken}`,
|
|
27
27
|
options.regions && `--regions=${options.regions}`,
|
|
28
28
|
options.debug && '--debug'
|
|
29
29
|
]), {
|
|
@@ -31,6 +31,7 @@ function deployExecutor(options, context) {
|
|
|
31
31
|
});
|
|
32
32
|
// When running in GitHub CI add the URL of the deployment as summary
|
|
33
33
|
if (is_github_ci_1.isGithubCi) {
|
|
34
|
+
// Add comment instead of summary (Look at https://github.com/mshick/add-pr-comment)
|
|
34
35
|
const parts = output.split('\n');
|
|
35
36
|
const url = parts.find((part) => part.trim().startsWith('https://') && part.trim().endsWith('.vercel.app'));
|
|
36
37
|
if (url) {
|
|
@@ -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,
|
|
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,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,KAAK,yBAAyB,CAAC,CAAA;QACvH,MAAM,WAAW,GAAG,CAAA,MAAA,MAAA,OAAO,CAAC,iBAAiB,CAAC,0CAAE,OAAO,0CAAE,WAAW,KAAI,YAAY,CAAA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AE,CAAA;;CACnB;AA1CD,wCA0CC;AAED,kBAAe,cAAc,CAAA"}
|
|
@@ -6,7 +6,7 @@ import { join } from 'path'
|
|
|
6
6
|
import type { ExecutorContext } from '@nrwl/devkit'
|
|
7
7
|
|
|
8
8
|
import { isGithubCi } from '../../utils/is-github-ci'
|
|
9
|
-
import {
|
|
9
|
+
import { vercelToken } from '../../utils/vercel-token'
|
|
10
10
|
|
|
11
11
|
export interface DeployOptions {
|
|
12
12
|
debug?: boolean
|
|
@@ -33,7 +33,7 @@ export async function deployExecutor(
|
|
|
33
33
|
const { success, output } = execCommand(buildCommand([
|
|
34
34
|
'npx vercel deploy --prebuilt',
|
|
35
35
|
context.configurationName === 'production' && '--prod',
|
|
36
|
-
|
|
36
|
+
vercelToken && `--token=${vercelToken}`,
|
|
37
37
|
options.regions && `--regions=${options.regions}`,
|
|
38
38
|
|
|
39
39
|
options.debug && '--debug'
|
|
@@ -43,6 +43,7 @@ export async function deployExecutor(
|
|
|
43
43
|
|
|
44
44
|
// When running in GitHub CI add the URL of the deployment as summary
|
|
45
45
|
if (isGithubCi) {
|
|
46
|
+
// Add comment instead of summary (Look at https://github.com/mshick/add-pr-comment)
|
|
46
47
|
const parts = output.split('\n')
|
|
47
48
|
|
|
48
49
|
const url = parts.find((part) => part.trim().startsWith('https://') && part.trim().endsWith('.vercel.app'))
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const vercelToken: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vercel-token.js","sourceRoot":"","sources":["../../../../../packages/vercel/src/utils/vercel-token.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const verceToken: string;
|
package/src/utils/verce-token.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"verce-token.js","sourceRoot":"","sources":["../../../../../packages/vercel/src/utils/verce-token.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAA"}
|