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

Commit0cfd8af

Browse files
committed
feat(core): cache executor information resolution
1 parent721e4df commit0cfd8af

File tree

5 files changed

+194
-47
lines changed

5 files changed

+194
-47
lines changed

‎package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@
7676
"@nx/storybook":"16.7.0-beta.3",
7777
"@nx/web":"16.7.0-beta.3",
7878
"@nx/webpack":"16.7.0-beta.3",
79+
"@nx/esbuild":"16.7.0-beta.3",
80+
"@nx/angular":"16.7.0-beta.3",
7981
"@parcel/watcher":"2.0.4",
8082
"@phenomnomnominal/tsquery":"~5.0.1",
8183
"@playwright/test":"^1.36.1",

‎packages/angular/project.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@
6464
"dependsOn": ["build-ng","build-base","^build"],
6565
"options": {
6666
"commands": [
67-
{
68-
"command":"node ./scripts/copy-readme.js angular"
69-
},
67+
"node ./scripts/copy-readme.js angular",
7068
"node ./scripts/add-dependency-to-build.js angular @nrwl/angular"
7169
],
7270
"parallel":false

‎packages/nx/.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
"buildTargets": ["build-base"],
8282
"ignoredDependencies": [
8383
"typescript",
84+
"@nrwl/angular",
8485
"@angular-devkit/build-angular",
8586
"@angular-devkit/core",
8687
"@angular-devkit/architect",

‎packages/nx/src/command-line/run/executor-utils.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,22 @@ export function normalizeExecutorSchema(
3131
};
3232
}
3333

34+
functioncacheKey(nodeModule:string,executor:string,root:string){
35+
return`${root}:${nodeModule}:${executor}`;
36+
}
37+
38+
constcachedExecutorInformation={};
39+
3440
exportfunctiongetExecutorInformation(
3541
nodeModule:string,
3642
executor:string,
3743
root:string
3844
):ExecutorConfig&{isNgCompat:boolean;isNxExecutor:boolean}{
3945
try{
40-
const{ executorsFilePath, executorConfig, isNgCompat}=readExecutorsJson(
46+
constkey=cacheKey(nodeModule,executor,root);
47+
if(cachedExecutorInformation[key])returncachedExecutorInformation[key];
48+
49+
const{ executorsFilePath, executorConfig, isNgCompat}=readExecutorJson(
4150
nodeModule,
4251
executor,
4352
root
@@ -65,22 +74,25 @@ export function getExecutorInformation(
6574
)
6675
:null;
6776

68-
return{
77+
constres={
6978
schema,
7079
implementationFactory,
7180
batchImplementationFactory,
7281
hasherFactory,
7382
isNgCompat,
7483
isNxExecutor:!isNgCompat,
7584
};
85+
86+
cachedExecutorInformation[key]=res;
87+
returnres;
7688
}catch(e){
7789
thrownewError(
7890
`Unable to resolve${nodeModule}:${executor}.\n${e.message}`
7991
);
8092
}
8193
}
8294

83-
functionreadExecutorsJson(
95+
functionreadExecutorJson(
8496
nodeModule:string,
8597
executor:string,
8698
root:string

‎pnpm-lock.yaml

Lines changed: 175 additions & 41 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp