@nx-extend/vercel 1.1.0 → 1.3.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 +27 -0
- package/README.md +15 -5
- package/package.json +2 -2
- package/src/executors/build/build.impl.d.ts +1 -0
- package/src/executors/build/build.impl.js +45 -15
- package/src/executors/build/build.impl.js.map +1 -1
- package/src/executors/build/build.impl.ts +54 -15
- package/src/executors/build/schema.json +3 -3
- package/src/executors/deploy/deploy.impl.js +1 -0
- package/src/executors/deploy/deploy.impl.js.map +1 -1
- package/src/executors/deploy/deploy.impl.ts +2 -0
- package/src/executors/deploy/schema.json +1 -1
- package/src/utils/add-env-variables-to-file.d.ts +1 -0
- package/src/utils/add-env-variables-to-file.js +11 -0
- package/src/utils/add-env-variables-to-file.js.map +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,31 @@
|
|
|
1
1
|
|
|
2
|
+
# [1.3.0](https://github.com/TriPSs/nx-extend/compare/vercel@1.2.0...vercel@1.3.0) (2022-09-13)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* **vercel:** Added support for `envVars` option ([55e8e14](https://github.com/TriPSs/nx-extend/commit/55e8e14d2f7304a6833bc49881cfd3554a051192))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
# [1.2.0](https://github.com/TriPSs/nx-extend/compare/vercel@1.1.1...vercel@1.2.0) (2022-09-06)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **vercel:** When deploying with `production` configuration also use that environment on Vercel ([e601cc3](https://github.com/TriPSs/nx-extend/commit/e601cc3fe136cfd9d1e82804569f43aa203cf8d1))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## [1.1.1](https://github.com/TriPSs/nx-extend/compare/vercel@1.1.0...vercel@1.1.1) (2022-09-05)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* **vercel:** Fixed pull command overwriting the project settings ([4bdfa01](https://github.com/TriPSs/nx-extend/commit/4bdfa0147a8c95afdb2f1c89bc89445ef616c73b))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
2
29
|
# [1.1.0](https://github.com/TriPSs/nx-extend/compare/vercel@1.0.0...vercel@1.1.0) (2022-09-05)
|
|
3
30
|
|
|
4
31
|
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<img src="https://badgen.net/npm/v/@nx-extend/vercel" alt="@nx-extend/vercel NPM package">
|
|
5
5
|
</a>
|
|
6
6
|
|
|
7
|
-
**Nx plugin for deploy your app to [
|
|
7
|
+
**Nx plugin for deploy your app to [Vercel](https://vercel.com)**.
|
|
8
8
|
|
|
9
9
|
## Setup
|
|
10
10
|
|
|
@@ -16,10 +16,20 @@ npm install -D @nx-extend/vercel
|
|
|
16
16
|
|
|
17
17
|
## Usage
|
|
18
18
|
|
|
19
|
-
###
|
|
19
|
+
### Build
|
|
20
20
|
|
|
21
21
|
#### Available options:
|
|
22
22
|
|
|
23
|
-
| name
|
|
24
|
-
|
|
25
|
-
|
|
|
23
|
+
| name | type | default | description |
|
|
24
|
+
|-------------------|-----------|---------|---------------------------|
|
|
25
|
+
| **`--projectId`** | `string` | `` | Project ID of Vercel |
|
|
26
|
+
| **`--orgId`** | `string` | `` | Organisation ID of Vercel |
|
|
27
|
+
| **`--debug`** | `boolean` | `false` | Run Vercel in debug mode |
|
|
28
|
+
|
|
29
|
+
### Deploy
|
|
30
|
+
|
|
31
|
+
#### Available options:
|
|
32
|
+
|
|
33
|
+
| name | type | default | description |
|
|
34
|
+
|---------------|-----------|---------|--------------------------|
|
|
35
|
+
| **`--debug`** | `boolean` | `false` | Run Vercel in debug mode |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx-extend/vercel",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"nx",
|
|
6
6
|
"vercel"
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"generators": "./generators.json",
|
|
20
20
|
"typings": "./src/index.d.ts",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@nx-extend/core": "1.
|
|
22
|
+
"@nx-extend/core": "1.3.0",
|
|
23
23
|
"shelljs": "^0.8.5"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {}
|
|
@@ -3,9 +3,17 @@ 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 path_1 = require("path");
|
|
7
|
+
const add_env_variables_to_file_1 = require("../../utils/add-env-variables-to-file");
|
|
6
8
|
function buildExecutor(options, context) {
|
|
7
9
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
8
10
|
const { targets } = context.workspace.projects[context.projectName];
|
|
11
|
+
if (!options.orgId) {
|
|
12
|
+
throw new Error(`"orgId" option is required!`);
|
|
13
|
+
}
|
|
14
|
+
if (!options.projectId) {
|
|
15
|
+
throw new Error(`"projectId" option is required!`);
|
|
16
|
+
}
|
|
9
17
|
if (!targets['build-next']) {
|
|
10
18
|
throw new Error(`"${context.projectName}" is missing the original "build-next" target!`);
|
|
11
19
|
}
|
|
@@ -14,33 +22,55 @@ function buildExecutor(options, context) {
|
|
|
14
22
|
}
|
|
15
23
|
// First make sure the .vercel/project.json exists
|
|
16
24
|
(0, devkit_1.writeJsonFile)('./.vercel/project.json', {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
'createdAt': new Date().getTime(),
|
|
21
|
-
'framework': 'nextjs',
|
|
22
|
-
'devCommand': null,
|
|
23
|
-
'installCommand': 'echo \'\'',
|
|
24
|
-
'buildCommand': `nx build-next ${context.projectName} --prod`,
|
|
25
|
-
'outputDirectory': `${(_d = (_c = targets['build-next']) === null || _c === void 0 ? void 0 : _c.options) === null || _d === void 0 ? void 0 : _d.outputPath}/.next`,
|
|
26
|
-
'rootDirectory': null,
|
|
27
|
-
'directoryListing': false,
|
|
28
|
-
'nodeVersion': '16.x'
|
|
29
|
-
}
|
|
25
|
+
projectId: options.projectId,
|
|
26
|
+
orgId: options.orgId,
|
|
27
|
+
settings: {}
|
|
30
28
|
});
|
|
31
29
|
// Pull latest
|
|
32
30
|
(0, core_1.execCommand)((0, core_1.buildCommand)([
|
|
33
31
|
'npx vercel pull --yes',
|
|
34
32
|
context.configurationName === 'production' && '--environment=production',
|
|
33
|
+
context.configurationName !== 'production' && '--environment=preview',
|
|
35
34
|
options.debug && '--debug'
|
|
36
35
|
]));
|
|
36
|
+
const vercelDirectory = '.vercel';
|
|
37
|
+
const vercelProjectJson = `./${vercelDirectory}/project.json`;
|
|
38
|
+
const outputDirectory = (_d = (_c = targets['build-next']) === null || _c === void 0 ? void 0 : _c.options) === null || _d === void 0 ? void 0 : _d.outputPath;
|
|
39
|
+
const vercelEnironment = context.configurationName === 'production'
|
|
40
|
+
? 'production'
|
|
41
|
+
: 'preview';
|
|
42
|
+
const vercelEnvFile = `.env.${vercelEnironment}.local`;
|
|
43
|
+
const vercelEnvFileLocation = (0, path_1.join)(context.root, vercelDirectory);
|
|
44
|
+
const envVars = (0, core_1.getEnvVars)(options.envVars, true);
|
|
45
|
+
if (envVars.length > 0) {
|
|
46
|
+
(0, add_env_variables_to_file_1.addEnvVariablesToFile)((0, path_1.join)(vercelEnvFileLocation, vercelEnvFile), envVars);
|
|
47
|
+
}
|
|
48
|
+
// Update the project json with the correct settings
|
|
49
|
+
(0, devkit_1.writeJsonFile)(vercelProjectJson, {
|
|
50
|
+
projectId: options.projectId,
|
|
51
|
+
orgId: options.orgId,
|
|
52
|
+
settings: {
|
|
53
|
+
createdAt: new Date().getTime(),
|
|
54
|
+
framework: 'nextjs',
|
|
55
|
+
devCommand: null,
|
|
56
|
+
installCommand: 'echo \'\'',
|
|
57
|
+
buildCommand: `nx build-next ${context.projectName}${context.configurationName === 'production' ? ' --prod' : ''}`,
|
|
58
|
+
outputDirectory: `${(_f = (_e = targets['build-next']) === null || _e === void 0 ? void 0 : _e.options) === null || _f === void 0 ? void 0 : _f.outputPath}/.next`,
|
|
59
|
+
rootDirectory: null,
|
|
60
|
+
directoryListing: false,
|
|
61
|
+
nodeVersion: '16.x'
|
|
62
|
+
}
|
|
63
|
+
});
|
|
37
64
|
const { success } = (0, core_1.execCommand)((0, core_1.buildCommand)([
|
|
38
65
|
'npx vercel build',
|
|
39
|
-
`--output ${(
|
|
66
|
+
`--output ${(_h = (_g = targets['build-next']) === null || _g === void 0 ? void 0 : _g.options) === null || _h === void 0 ? void 0 : _h.outputPath}/.vercel/output`,
|
|
40
67
|
options.debug && '--debug'
|
|
41
68
|
]));
|
|
42
69
|
if (success) {
|
|
43
|
-
|
|
70
|
+
// Write the project.json to the .vercel directory
|
|
71
|
+
(0, devkit_1.writeJsonFile)((0, path_1.join)(outputDirectory, vercelDirectory, 'project.json'), (0, devkit_1.readJsonFile)(vercelProjectJson));
|
|
72
|
+
// Also copy over the env files
|
|
73
|
+
(0, core_1.copyFile)(vercelEnvFileLocation, (0, path_1.join)(outputDirectory, vercelDirectory), vercelEnvFile);
|
|
44
74
|
}
|
|
45
75
|
return Promise.resolve({ success });
|
|
46
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.impl.js","sourceRoot":"","sources":["../../../../../../packages/vercel/src/executors/build/build.impl.ts"],"names":[],"mappings":";;;AAAA,yCAA0D;AAC1D,
|
|
1
|
+
{"version":3,"file":"build.impl.js","sourceRoot":"","sources":["../../../../../../packages/vercel/src/executors/build/build.impl.ts"],"names":[],"mappings":";;;AAAA,yCAA0D;AAC1D,0CAAiF;AACjF,+BAA2B;AAI3B,qFAA6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AO,0CAAE,UAAU,iBAAiB;QAEvE,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;KACvF;IAED,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,CAAA;AACrC,CAAC;AAtFD,sCAsFC;AAED,kBAAe,aAAa,CAAA"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { readJsonFile, writeJsonFile } from '@nrwl/devkit'
|
|
2
|
-
import { buildCommand, execCommand } from '@nx-extend/core'
|
|
2
|
+
import { buildCommand, copyFile, execCommand, getEnvVars } from '@nx-extend/core'
|
|
3
|
+
import { join } from 'path'
|
|
3
4
|
|
|
4
5
|
import type { ExecutorContext } from '@nrwl/devkit'
|
|
5
6
|
|
|
7
|
+
import { addEnvVariablesToFile } from '../../utils/add-env-variables-to-file'
|
|
8
|
+
|
|
6
9
|
export interface ExecutorSchema {
|
|
7
10
|
projectId: string
|
|
8
11
|
orgId: string
|
|
9
12
|
debug?: boolean
|
|
13
|
+
envVars?: Record<string, string>
|
|
10
14
|
}
|
|
11
15
|
|
|
12
16
|
export function buildExecutor(
|
|
@@ -15,6 +19,14 @@ export function buildExecutor(
|
|
|
15
19
|
): Promise<{ success: boolean }> {
|
|
16
20
|
const { targets } = context.workspace.projects[context.projectName]
|
|
17
21
|
|
|
22
|
+
if (!options.orgId) {
|
|
23
|
+
throw new Error(`"orgId" option is required!`)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (!options.projectId) {
|
|
27
|
+
throw new Error(`"projectId" option is required!`)
|
|
28
|
+
}
|
|
29
|
+
|
|
18
30
|
if (!targets['build-next']) {
|
|
19
31
|
throw new Error(`"${context.projectName}" is missing the original "build-next" target!`)
|
|
20
32
|
}
|
|
@@ -25,29 +37,53 @@ export function buildExecutor(
|
|
|
25
37
|
|
|
26
38
|
// First make sure the .vercel/project.json exists
|
|
27
39
|
writeJsonFile('./.vercel/project.json', {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
'createdAt': new Date().getTime(),
|
|
32
|
-
'framework': 'nextjs',
|
|
33
|
-
'devCommand': null,
|
|
34
|
-
'installCommand': 'echo \'\'',
|
|
35
|
-
'buildCommand': `nx build-next ${context.projectName} --prod`,
|
|
36
|
-
'outputDirectory': `${targets['build-next']?.options?.outputPath}/.next`,
|
|
37
|
-
'rootDirectory': null,
|
|
38
|
-
'directoryListing': false,
|
|
39
|
-
'nodeVersion': '16.x'
|
|
40
|
-
}
|
|
40
|
+
projectId: options.projectId,
|
|
41
|
+
orgId: options.orgId,
|
|
42
|
+
settings: {}
|
|
41
43
|
})
|
|
42
44
|
|
|
43
45
|
// Pull latest
|
|
44
46
|
execCommand(buildCommand([
|
|
45
47
|
'npx vercel pull --yes',
|
|
46
48
|
context.configurationName === 'production' && '--environment=production',
|
|
49
|
+
context.configurationName !== 'production' && '--environment=preview',
|
|
47
50
|
|
|
48
51
|
options.debug && '--debug'
|
|
49
52
|
]))
|
|
50
53
|
|
|
54
|
+
const vercelDirectory = '.vercel'
|
|
55
|
+
const vercelProjectJson = `./${vercelDirectory}/project.json`
|
|
56
|
+
const outputDirectory = targets['build-next']?.options?.outputPath
|
|
57
|
+
|
|
58
|
+
const vercelEnironment = context.configurationName === 'production'
|
|
59
|
+
? 'production'
|
|
60
|
+
: 'preview'
|
|
61
|
+
|
|
62
|
+
const vercelEnvFile = `.env.${vercelEnironment}.local`
|
|
63
|
+
const vercelEnvFileLocation = join(context.root, vercelDirectory)
|
|
64
|
+
|
|
65
|
+
const envVars = getEnvVars(options.envVars, true)
|
|
66
|
+
if (envVars.length > 0) {
|
|
67
|
+
addEnvVariablesToFile(join(vercelEnvFileLocation, vercelEnvFile), envVars)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Update the project json with the correct settings
|
|
71
|
+
writeJsonFile(vercelProjectJson, {
|
|
72
|
+
projectId: options.projectId,
|
|
73
|
+
orgId: options.orgId,
|
|
74
|
+
settings: {
|
|
75
|
+
createdAt: new Date().getTime(),
|
|
76
|
+
framework: 'nextjs',
|
|
77
|
+
devCommand: null,
|
|
78
|
+
installCommand: 'echo \'\'',
|
|
79
|
+
buildCommand: `nx build-next ${context.projectName}${context.configurationName === 'production' ? ' --prod' : ''}`,
|
|
80
|
+
outputDirectory: `${targets['build-next']?.options?.outputPath}/.next`,
|
|
81
|
+
rootDirectory: null,
|
|
82
|
+
directoryListing: false,
|
|
83
|
+
nodeVersion: '16.x'
|
|
84
|
+
}
|
|
85
|
+
})
|
|
86
|
+
|
|
51
87
|
const { success } = execCommand(buildCommand([
|
|
52
88
|
'npx vercel build',
|
|
53
89
|
`--output ${targets['build-next']?.options?.outputPath}/.vercel/output`,
|
|
@@ -56,7 +92,10 @@ export function buildExecutor(
|
|
|
56
92
|
]))
|
|
57
93
|
|
|
58
94
|
if (success) {
|
|
59
|
-
|
|
95
|
+
// Write the project.json to the .vercel directory
|
|
96
|
+
writeJsonFile(join(outputDirectory, vercelDirectory, 'project.json'), readJsonFile(vercelProjectJson))
|
|
97
|
+
// Also copy over the env files
|
|
98
|
+
copyFile(vercelEnvFileLocation, join(outputDirectory, vercelDirectory), vercelEnvFile)
|
|
60
99
|
}
|
|
61
100
|
|
|
62
101
|
return Promise.resolve({ success })
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
"type": "object",
|
|
4
4
|
"cli": "nx",
|
|
5
5
|
"title": "Deploy executor",
|
|
6
|
-
"description": "Deploy to
|
|
6
|
+
"description": "Deploy to Vercel",
|
|
7
7
|
"properties": {
|
|
8
8
|
"projectId": {
|
|
9
9
|
"type": "string",
|
|
10
|
-
"description": "
|
|
10
|
+
"description": "Project ID in Vercel"
|
|
11
11
|
},
|
|
12
12
|
"orgId": {
|
|
13
13
|
"type": "string",
|
|
14
|
-
"description": "
|
|
14
|
+
"description": "Origination ID in Vercel"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -15,6 +15,7 @@ function deployExecutor(options, context) {
|
|
|
15
15
|
}
|
|
16
16
|
return Promise.resolve((0, core_1.execCommand)((0, core_1.buildCommand)([
|
|
17
17
|
'npx vercel deploy ---prebuilt',
|
|
18
|
+
context.configurationName === 'production' && '--prod',
|
|
18
19
|
options.debug && '--debug'
|
|
19
20
|
]), {
|
|
20
21
|
cwd: targets['build-next'].options.outputPath
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.impl.js","sourceRoot":"","sources":["../../../../../../packages/vercel/src/executors/deploy/deploy.impl.ts"],"names":[],"mappings":";;;AAAA,0CAA2D;AAC3D,2BAA+B;AAC/B,+BAA2B;AAQ3B,SAAgB,cAAc,CAC5B,OAAuB,EACvB,OAAwB;;IAExB,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;IAEnE,IAAI,CAAC,CAAA,MAAA,MAAA,OAAO,CAAC,YAAY,CAAC,0CAAE,OAAO,0CAAE,UAAU,CAAA,EAAE;QAC/C,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAA;KACvE;IAED,IAAI,CAAC,IAAA,eAAU,EAAC,IAAA,WAAI,EAAC,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,sBAAsB,CAAC,CAAC,EAAE;QACvF,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAA;KACpE;IAED,OAAO,OAAO,CAAC,OAAO,CAAC,IAAA,kBAAW,EAAC,IAAA,mBAAY,EAAC;QAC9C,+BAA+B;QAC/B,OAAO,CAAC,KAAK,IAAI,SAAS;KAC3B,CAAC,EAAE;QACF,GAAG,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,UAAU;KAC9C,CAAC,CAAC,CAAA;AACL,CAAC;
|
|
1
|
+
{"version":3,"file":"deploy.impl.js","sourceRoot":"","sources":["../../../../../../packages/vercel/src/executors/deploy/deploy.impl.ts"],"names":[],"mappings":";;;AAAA,0CAA2D;AAC3D,2BAA+B;AAC/B,+BAA2B;AAQ3B,SAAgB,cAAc,CAC5B,OAAuB,EACvB,OAAwB;;IAExB,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;IAEnE,IAAI,CAAC,CAAA,MAAA,MAAA,OAAO,CAAC,YAAY,CAAC,0CAAE,OAAO,0CAAE,UAAU,CAAA,EAAE;QAC/C,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAA;KACvE;IAED,IAAI,CAAC,IAAA,eAAU,EAAC,IAAA,WAAI,EAAC,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,sBAAsB,CAAC,CAAC,EAAE;QACvF,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAA;KACpE;IAED,OAAO,OAAO,CAAC,OAAO,CAAC,IAAA,kBAAW,EAAC,IAAA,mBAAY,EAAC;QAC9C,+BAA+B;QAC/B,OAAO,CAAC,iBAAiB,KAAK,YAAY,IAAI,QAAQ;QAEtD,OAAO,CAAC,KAAK,IAAI,SAAS;KAC3B,CAAC,EAAE;QACF,GAAG,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,UAAU;KAC9C,CAAC,CAAC,CAAA;AACL,CAAC;AAtBD,wCAsBC;AAED,kBAAe,cAAc,CAAA"}
|
|
@@ -24,6 +24,8 @@ export function deployExecutor(
|
|
|
24
24
|
|
|
25
25
|
return Promise.resolve(execCommand(buildCommand([
|
|
26
26
|
'npx vercel deploy ---prebuilt',
|
|
27
|
+
context.configurationName === 'production' && '--prod',
|
|
28
|
+
|
|
27
29
|
options.debug && '--debug'
|
|
28
30
|
]), {
|
|
29
31
|
cwd: targets['build-next'].options.outputPath
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const addEnvVariablesToFile: (envFile: string, envVars: string[]) => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addEnvVariablesToFile = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const addEnvVariablesToFile = (envFile, envVars) => {
|
|
6
|
+
if ((0, fs_1.existsSync)(envFile)) {
|
|
7
|
+
(0, fs_1.appendFileSync)(envFile, envVars.join('\r\n'));
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
exports.addEnvVariablesToFile = addEnvVariablesToFile;
|
|
11
|
+
//# sourceMappingURL=add-env-variables-to-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-env-variables-to-file.js","sourceRoot":"","sources":["../../../../../packages/vercel/src/utils/add-env-variables-to-file.ts"],"names":[],"mappings":";;;AAAA,2BAA+C;AAExC,MAAM,qBAAqB,GAAG,CAAC,OAAe,EAAE,OAAiB,EAAE,EAAE;IAC1E,IAAI,IAAA,eAAU,EAAC,OAAO,CAAC,EAAE;QACvB,IAAA,mBAAc,EAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;KAC9C;AACH,CAAC,CAAA;AAJY,QAAA,qBAAqB,yBAIjC"}
|