Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/nxPublic

Commit9d5a383

Browse files
authored
feat(misc): remove dotenv from executors (#18719)
1 parent8f6f71e commit9d5a383

File tree

25 files changed

+37
-25
lines changed

25 files changed

+37
-25
lines changed

‎e2e/node/src/node.test.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,43 @@ describe('Node Applications', () => {
144144
expect(additionalResult).toContain('Hello Additional World!');
145145
},60000);
146146

147+
it('should be able to generate an empty application with variable in .env file',async()=>{
148+
constoriginalEnvPort=process.env.PORT;
149+
constport=3457;
150+
process.env.PORT=`${port}`;
151+
constnodeapp=uniq('nodeapp');
152+
153+
runCLI(
154+
`generate @nx/node:app${nodeapp} --linter=eslint --bundler=webpack --framework=none`
155+
);
156+
awaitsetMaxWorkers();
157+
158+
updateFile('.env',`NX_FOOBAR="test foo bar"`);
159+
160+
updateFile(
161+
`apps/${nodeapp}/src/main.ts`,
162+
`console.log('foobar: ' + process.env['NX_FOOBAR']);`
163+
);
164+
165+
awaitrunCLIAsync(`build${nodeapp}`);
166+
checkFilesExist(`dist/apps/${nodeapp}/main.js`);
167+
168+
// check serving
169+
constp=awaitrunCommandUntil(
170+
`serve${nodeapp} --port=${port} --watch=false`,
171+
(output)=>{
172+
process.stdout.write(output);
173+
returnoutput.includes(`foobar: test foo bar`);
174+
}
175+
);
176+
try{
177+
awaitpromisifiedTreeKill(p.pid,'SIGKILL');
178+
awaitkillPorts(port);
179+
}finally{
180+
process.env.port=originalEnvPort;
181+
}
182+
},60000);
183+
147184
it('should be able to generate an express application',async()=>{
148185
constnodeapp=uniq('nodeapp');
149186
constoriginalEnvPort=process.env.PORT;

‎packages/cypress/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
"dependencies": {
3737
"@phenomnomnominal/tsquery":"~5.0.1",
3838
"detect-port":"^1.5.1",
39-
"dotenv":"~16.3.1",
4039
"semver":"7.5.3",
4140
"tslib":"^2.3.0",
4241
"@nx/devkit":"file:../devkit",

‎packages/cypress/src/executors/cypress/cypress.impl.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
output,
1111
}from'@nx/devkit';
1212
import{getExecutorInformation}from'nx/src/command-line/run/executor-utils';
13-
import'dotenv/config';
1413
import{existsSync,readdirSync,unlinkSync,writeFileSync}from'fs';
1514
import{basename,dirname,join}from'path';
1615
import{getTempTailwindPath}from'../../utils/ct-helpers';

‎packages/esbuild/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
},
3131
"dependencies": {
3232
"chalk":"^4.1.0",
33-
"dotenv":"~16.3.1",
3433
"fast-glob":"3.2.7",
3534
"fs-extra":"^11.1.0",
3635
"tslib":"^2.3.0",

‎packages/esbuild/src/executors/esbuild/esbuild.impl.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import'dotenv/config';
21
import*aschalkfrom'chalk';
32
importtype{ExecutorContext}from'@nx/devkit';
43
import{cacheDir,joinPathFragments,logger,stripIndents}from'@nx/devkit';

‎packages/jest/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
"@jest/test-result":"^29.4.1",
3939
"@phenomnomnominal/tsquery":"~5.0.1",
4040
"chalk":"^4.1.0",
41-
"dotenv":"~16.3.1",
4241
"identity-obj-proxy":"3.0.0",
4342
"jest-config":"^29.4.1",
4443
"jest-resolve":"^29.4.1",

‎packages/jest/src/executors/jest/jest.impl.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import'dotenv/config';
21
import{runCLI}from'jest';
32
import{readConfig,readConfigs}from'jest-config';
43
import{utilsasjestReporterUtils}from'@jest/reporters';

‎packages/next/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
"@svgr/webpack":"^8.0.1",
3939
"chalk":"^4.1.0",
4040
"copy-webpack-plugin":"^10.2.4",
41-
"dotenv":"~16.3.1",
4241
"fs-extra":"^11.1.0",
4342
"ignore":"^5.0.4",
4443
"semver":"7.5.3",

‎packages/next/src/executors/build/build.impl.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import'dotenv/config';
21
import{
32
ExecutorContext,
43
logger,

‎packages/next/src/executors/export/export.impl.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import'dotenv/config';
21
import{
32
ExecutorContext,
43
parseTargetString,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp