@nx-extend/vercel 1.4.0 → 1.5.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
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
|
|
2
|
+
# [1.5.0](https://github.com/TriPSs/nx-extend/compare/vercel@1.4.0...vercel@1.5.0) (2022-12-08)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* **vercel:** Added support to define different build config for target ([8d4e5b6](https://github.com/TriPSs/nx-extend/commit/8d4e5b68457d60411b45bc58eb10fe97ff92a6ff))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
2
11
|
# [1.4.0](https://github.com/TriPSs/nx-extend/compare/vercel@1.3.4...vercel@1.4.0) (2022-12-08)
|
|
3
12
|
|
|
4
13
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx-extend/vercel",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"nx",
|
|
6
6
|
"vercel"
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@nx-extend/core": "1.4.0",
|
|
23
23
|
"shelljs": "0.8.5",
|
|
24
|
+
"@actions/core": "1.10.0",
|
|
24
25
|
"process": "0.11.10"
|
|
25
26
|
},
|
|
26
27
|
"peerDependencies": {}
|
|
@@ -8,7 +8,7 @@ const add_env_variables_to_file_1 = require("../../utils/add-env-variables-to-fi
|
|
|
8
8
|
const get_env_vars_1 = require("../../utils/get-env-vars");
|
|
9
9
|
const get_output_directory_1 = require("./utils/get-output-directory");
|
|
10
10
|
function buildExecutor(options, context) {
|
|
11
|
-
var _a, _b, _c, _d;
|
|
11
|
+
var _a, _b, _c, _d, _e;
|
|
12
12
|
const { targets } = context.workspace.projects[context.projectName];
|
|
13
13
|
const framework = options.framework || 'nextjs';
|
|
14
14
|
const buildTarget = options.buildTarget || (framework === 'nextjs' ? 'build-next' : 'build');
|
|
@@ -24,6 +24,9 @@ function buildExecutor(options, context) {
|
|
|
24
24
|
if (!((_b = (_a = targets[buildTarget]) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.outputPath)) {
|
|
25
25
|
throw new Error(`"${buildTarget}" target has no "outputPath" configured!`);
|
|
26
26
|
}
|
|
27
|
+
if (options.buildConfig && !((_c = targets[buildTarget]) === null || _c === void 0 ? void 0 : _c.configurations[options.buildConfig])) {
|
|
28
|
+
throw new Error(`"${buildTarget}" target has no configuration "${options.buildConfig}"!`);
|
|
29
|
+
}
|
|
27
30
|
// First make sure the .vercel/project.json exists
|
|
28
31
|
(0, devkit_1.writeJsonFile)('./.vercel/project.json', {
|
|
29
32
|
projectId: options.projectId,
|
|
@@ -41,7 +44,7 @@ function buildExecutor(options, context) {
|
|
|
41
44
|
]));
|
|
42
45
|
const vercelDirectory = '.vercel';
|
|
43
46
|
const vercelProjectJson = `./${vercelDirectory}/project.json`;
|
|
44
|
-
const outputDirectory = (
|
|
47
|
+
const outputDirectory = (_e = (_d = targets[buildTarget]) === null || _d === void 0 ? void 0 : _d.options) === null || _e === void 0 ? void 0 : _e.outputPath;
|
|
45
48
|
const vercelEnvFile = `.env.${vercelEnironment}.local`;
|
|
46
49
|
const vercelEnvFileLocation = (0, path_1.join)(context.root, vercelDirectory);
|
|
47
50
|
const envVars = (0, get_env_vars_1.getEnvVars)(options.envVars, true);
|
|
@@ -57,7 +60,7 @@ function buildExecutor(options, context) {
|
|
|
57
60
|
framework,
|
|
58
61
|
devCommand: null,
|
|
59
62
|
installCommand: 'echo \'\'',
|
|
60
|
-
buildCommand: `nx run ${context.projectName}:${buildTarget}:${context.configurationName}`,
|
|
63
|
+
buildCommand: `nx run ${context.projectName}:${buildTarget}:${options.buildConfig || context.configurationName}`,
|
|
61
64
|
outputDirectory: (0, get_output_directory_1.getOutputDirectory)(options.framework, outputDirectory),
|
|
62
65
|
rootDirectory: null,
|
|
63
66
|
directoryListing: false,
|
|
@@ -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,2DAAqD;AACrD,uEAAiE;
|
|
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,2DAAqD;AACrD,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,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,CAAC,IAAI,OAAO,CAAC,WAAW,qBAAqB,WAAW,WAAW,CAAC,CAAA;KACpF;IAED,IAAI,CAAC,CAAA,MAAA,MAAA,OAAO,CAAC,WAAW,CAAC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AAA;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;AA9FD,sCA8FC;AAED,kBAAe,aAAa,CAAA"}
|
|
@@ -14,6 +14,7 @@ export interface BuildOptions {
|
|
|
14
14
|
debug?: boolean
|
|
15
15
|
envVars?: Record<string, string>
|
|
16
16
|
buildTarget?: string
|
|
17
|
+
buildConfig?: string
|
|
17
18
|
framework?: string
|
|
18
19
|
nodeVersion?: '16.x'
|
|
19
20
|
}
|
|
@@ -42,6 +43,10 @@ export function buildExecutor(
|
|
|
42
43
|
throw new Error(`"${buildTarget}" target has no "outputPath" configured!`)
|
|
43
44
|
}
|
|
44
45
|
|
|
46
|
+
if (options.buildConfig && !targets[buildTarget]?.configurations[options.buildConfig]) {
|
|
47
|
+
throw new Error(`"${buildTarget}" target has no configuration "${options.buildConfig}"!`)
|
|
48
|
+
}
|
|
49
|
+
|
|
45
50
|
// First make sure the .vercel/project.json exists
|
|
46
51
|
writeJsonFile('./.vercel/project.json', {
|
|
47
52
|
projectId: options.projectId,
|
|
@@ -82,7 +87,7 @@ export function buildExecutor(
|
|
|
82
87
|
framework,
|
|
83
88
|
devCommand: null,
|
|
84
89
|
installCommand: 'echo \'\'',
|
|
85
|
-
buildCommand: `nx run ${context.projectName}:${buildTarget}:${context.configurationName}`,
|
|
90
|
+
buildCommand: `nx run ${context.projectName}:${buildTarget}:${options.buildConfig || context.configurationName}`,
|
|
86
91
|
outputDirectory: getOutputDirectory(options.framework, outputDirectory),
|
|
87
92
|
rootDirectory: null,
|
|
88
93
|
directoryListing: false,
|