Skip to content

Commit

Permalink
Update Nx to v14.5.10 (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
domjtalbot committed Oct 2, 2022
1 parent 369473a commit d23008b
Show file tree
Hide file tree
Showing 72 changed files with 4,216 additions and 3,573 deletions.
7 changes: 7 additions & 0 deletions .changeset/clever-shrimps-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'nx-mesh': minor
---

Rebuild `base` generator used by `application` & `sdk` generators.

All shared files have been moved from `application` & `sdk` generators to the base. This creates a consistent foundation for other generators.
5 changes: 5 additions & 0 deletions .changeset/happy-oranges-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'nx-mesh': minor
---

Update Nx to `v14.5.10`
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ yarn-error.log*
node_modules/


# =========================================================
# Nx
# =========================================================

migrations.json


# =========================================================
# Runtime data
# =========================================================
Expand Down
5 changes: 0 additions & 5 deletions .lintstagedrc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,5 @@ export default {
'nx affected --target=build --parallel=2',
'nx affected --target=build --configuration=production --parallel=2',
'nx affected --target=test --parallel=2',
'nx affected --target=validate --parallel=1',
'nx affected --target=e2e --parallel=1',
'nx affected --target=e2e --configuration=start --parallel=1',
'nx affected --target=e2e --configuration=serve --parallel=1',
'nx affected --target=e2e --configuration=serve-dev --parallel=1',
],
};
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
strict-peer-dependencies=false
1 change: 0 additions & 1 deletion apps/api-gateway/stackexchange/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"passWithNoTests": true
}
},

"validate": {
"executor": "nx-mesh:validate",
"options": {
Expand Down
4 changes: 3 additions & 1 deletion apps/nextjs/javascript-wiki-swc/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"outputPath": "dist/apps/nextjs/javascript-wiki-swc"
},
"configurations": {
"development": {},
"development": {
"outputPath": "apps/nextjs/javascript-wiki-swc"
},
"production": {}
}
},
Expand Down
4 changes: 3 additions & 1 deletion apps/nextjs/javascript-wiki/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"outputPath": "dist/apps/nextjs/javascript-wiki"
},
"configurations": {
"development": {},
"development": {
"outputPath": "apps/nextjs/javascript-wiki"
},
"production": {}
}
},
Expand Down
4 changes: 3 additions & 1 deletion apps/nextjs/stackexchange/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"outputPath": "dist/apps/nextjs/stackexchange"
},
"configurations": {
"development": {},
"development": {
"outputPath": "apps/nextjs/stackexchange"
},
"production": {}
}
},
Expand Down
4 changes: 3 additions & 1 deletion apps/nextjs/trippin-swc/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"outputPath": "dist/apps/nextjs/trippin-swc"
},
"configurations": {
"development": {},
"development": {
"outputPath": "apps/nextjs/trippin-swc"
},
"production": {}
}
},
Expand Down
4 changes: 3 additions & 1 deletion apps/nextjs/trippin/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"outputPath": "dist/apps/nextjs/trippin"
},
"configurations": {
"development": {},
"development": {
"outputPath": "apps/nextjs/trippin"
},
"production": {}
}
},
Expand Down
4 changes: 3 additions & 1 deletion apps/nextjs/weatherbit/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"outputPath": "dist/apps/nextjs/weatherbit"
},
"configurations": {
"development": {},
"development": {
"outputPath": "apps/nextjs/weatherbit"
},
"production": {}
}
},
Expand Down
16 changes: 8 additions & 8 deletions libs/nx-mesh/generators.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"$schema": "http://json-schema.org/schema",
"name": "nx-mesh",
"generators": {
"init": {
"factory": "./src/generators/init/init",
"schema": "./src/generators/init/schema.json",
"description": "Initialize the `nx-mesh` plugin.",
"base": {
"factory": "./src/generators/base/base",
"schema": "./src/generators/base/schema.json",
"description": "Generate the foundation for a GraphQL Mesh project",
"hidden": true
},
"application": {
Expand All @@ -24,10 +24,10 @@
}
},
"schematics": {
"init": {
"factory": "./src/generators/init/init#meshInitGenerator",
"schema": "./src/generators/init/schema.json",
"description": "Initialize the `nx-mesh` plugin.",
"base": {
"factory": "./src/generators/base/base#baseGenerator",
"schema": "./src/generators/base/schema.json",
"description": "Create a GraphQL Mesh API Gateway application for Nx",
"hidden": true
},
"application": {
Expand Down
10 changes: 6 additions & 4 deletions libs/nx-mesh/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
"nx": ">=14"
},
"dependencies": {
"@nrwl/devkit": "14.4.3",
"@nrwl/js": "14.4.3",
"@nrwl/node": "14.4.3",
"@nrwl/workspace": "14.4.3",
"@nrwl/cypress": "14.5.10",
"@nrwl/devkit": "14.5.10",
"@nrwl/js": "14.5.10",
"@nrwl/linter": "14.5.10",
"@nrwl/node": "14.5.10",
"@nrwl/workspace": "14.5.10",
"fs-extra": "10.1.0",
"get-port": "5.1.1"
},
Expand Down
14 changes: 13 additions & 1 deletion libs/nx-mesh/src/executors/build-swc/swc-executor/compile-swc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
runTypeCheck,
TypeCheckOptions,
} from '@nrwl/js/src/utils/typescript/run-type-check';
import { removeSync } from 'fs-extra';

function getSwcCmd(
{ swcrcPath, srcPath, destPath }: SwcCliOptions,
Expand Down Expand Up @@ -55,6 +56,10 @@ export async function compileSwc(
) {
logger.log(`Compiling with SWC for ${context.projectName}...`);

if (normalizedOptions.clean) {
removeSync(normalizedOptions.outputPath);
}

const swcCmdLog = execSync(getSwcCmd(normalizedOptions.swcCliOptions), {
cwd: normalizedOptions.swcCliOptions.swcCwd,
}).toString();
Expand Down Expand Up @@ -93,6 +98,10 @@ export async function* compileSwcWatch(
let typeCheckOptions: TypeCheckOptions;
let initialPostCompile = true;

if (normalizedOptions.clean) {
removeSync(normalizedOptions.outputPath);
}

return yield* createAsyncIterable<{ success: boolean; outfile: string }>(
async ({ next, done }) => {
const swcWatcher = exec(
Expand Down Expand Up @@ -157,8 +166,11 @@ export async function* compileSwcWatch(
}
};

const stderrOnData = (err?: any) => {
const stderrOnData = (err?: unknown) => {
process.stderr.write(err);
if (err.includes('Debugger attached.')) {
return;
}
next(getResult(false));
};

Expand Down
13 changes: 6 additions & 7 deletions libs/nx-mesh/src/executors/build-swc/swc-executor/swc.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export async function* swcExecutor(
const swcHelperDependency = getHelperDependency(
HelperDependency.swc,
options.swcCliOptions.swcrcPath,
dependencies
dependencies,
context.projectGraph
);

if (swcHelperDependency) {
Expand Down Expand Up @@ -147,14 +148,12 @@ export async function* swcExecutor(
!options.skipTypeCheck
)
);
process.on('exit', async () => {
const handleTermination = async () => {
await disposeWatchAssetChanges();
await disposePackageJsonChanges();
});
process.on('SIGTERM', async () => {
await disposeWatchAssetChanges();
await disposePackageJsonChanges();
});
};
process.on('SIGINT', () => handleTermination());
process.on('SIGTERM', () => handleTermination());

return yield* compileSwcWatch(
context,
Expand Down
Loading

0 comments on commit d23008b

Please sign in to comment.