Skip to content

Commit f162674

Browse files
committed
2 parents 942ba7c + 7ae7fd1 commit f162674

File tree

135 files changed

+56162
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+56162
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

.vscode/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Launch Program",
11+
"skipFiles": ["<node_internals>/**"],
12+
"program": "${workspaceFolder}/Chapter6/source-maps/dist/index.js",
13+
"outFiles": ["${workspaceFolder}/**/*.js"]
14+
}
15+
]
16+
}

Chapter6/source-maps/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.map
2+
dist/
3+
node_modules/
4+
package-lock.json

ch10/devjobs/.gitignore

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# See https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
2+
3+
# compiled output
4+
dist
5+
tmp
6+
out-tsc
7+
8+
# dependencies
9+
node_modules
10+
11+
# IDEs and editors
12+
/.idea
13+
.project
14+
.classpath
15+
.c9/
16+
*.launch
17+
.settings/
18+
*.sublime-workspace
19+
20+
# IDE - VSCode
21+
.vscode/*
22+
!.vscode/settings.json
23+
!.vscode/tasks.json
24+
!.vscode/launch.json
25+
!.vscode/extensions.json
26+
27+
# misc
28+
/.sass-cache
29+
/connect.lock
30+
/coverage
31+
/libpeerconnection.log
32+
npm-debug.log
33+
yarn-error.log
34+
testem.log
35+
/typings
36+
37+
# System Files
38+
.DS_Store
39+
Thumbs.db
40+
41+
.nx/cache
42+
.nx/workspace-data
43+
.cursor/rules/nx-rules.mdc
44+
.github/instructions/nx.instructions.md
45+
46+
# Next.js
47+
.next
48+
out
49+
50+
test-output
51+
52+
vite.config.*.timestamp*
53+
vitest.config.*.timestamp*
54+
55+
.nx/cache
56+
57+
.nx/workspace-data

ch10/devjobs/.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
strict-peer-dependencies=false
2+
auto-install-peers=true
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"recommendations": [
3+
"nrwl.angular-console",
4+
"dbaeumer.vscode-eslint",
5+
"firsttris.vscode-jest-runner",
6+
"ms-playwright.playwright"
7+
]
8+
}

ch10/devjobs/.vscode/launch.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"type": "node",
6+
"request": "launch",
7+
"name": "Debug @ch10/devjobs-backend with Nx",
8+
"runtimeExecutable": "pnpm exec",
9+
"runtimeArgs": [
10+
"nx",
11+
"serve",
12+
"@ch10/devjobs-backend"
13+
],
14+
"env": {
15+
"NODE_OPTIONS": "--inspect=9229"
16+
},
17+
"console": "integratedTerminal",
18+
"internalConsoleOptions": "neverOpen",
19+
"skipFiles": [
20+
"<node_internals>/**"
21+
],
22+
"sourceMaps": true,
23+
"outFiles": [
24+
"${workspaceFolder}/apps/devjobs-backend/dist/**/*.(m|c|)js",
25+
"!**/node_modules/**"
26+
]
27+
}
28+
]
29+
}

ch10/devjobs/README.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Ch10Devjobs
2+
3+
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
4+
5+
✨ Your new, shiny [Nx workspace](https://nx.dev) is ready ✨.
6+
7+
[Learn more about this workspace setup and its capabilities](https://nx.dev/nx-api/js?utm_source=nx_project&amp;utm_medium=readme&amp;utm_campaign=nx_projects) or run `npx nx graph` to visually explore what was created. Now, let's get you up to speed!
8+
9+
## Generate a library
10+
11+
```sh
12+
npx nx g @nx/js:lib packages/pkg1 --publishable --importPath=@my-org/pkg1
13+
```
14+
15+
## Run tasks
16+
17+
To build the library use:
18+
19+
```sh
20+
npx nx build pkg1
21+
```
22+
23+
To run any task with Nx use:
24+
25+
```sh
26+
npx nx <target> <project-name>
27+
```
28+
29+
These targets are either [inferred automatically](https://nx.dev/concepts/inferred-tasks?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) or defined in the `project.json` or `package.json` files.
30+
31+
[More about running tasks in the docs &raquo;](https://nx.dev/features/run-tasks?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
32+
33+
## Versioning and releasing
34+
35+
To version and release the library use
36+
37+
```
38+
npx nx release
39+
```
40+
41+
Pass `--dry-run` to see what would happen without actually releasing the library.
42+
43+
[Learn more about Nx release &raquo;](https://nx.dev/features/manage-releases?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
44+
45+
## Keep TypeScript project references up to date
46+
47+
Nx automatically updates TypeScript [project references](https://www.typescriptlang.org/docs/handbook/project-references.html) in `tsconfig.json` files to ensure they remain accurate based on your project dependencies (`import` or `require` statements). This sync is automatically done when running tasks such as `build` or `typecheck`, which require updated references to function correctly.
48+
49+
To manually trigger the process to sync the project graph dependencies information to the TypeScript project references, run the following command:
50+
51+
```sh
52+
npx nx sync
53+
```
54+
55+
You can enforce that the TypeScript project references are always in the correct state when running in CI by adding a step to your CI job configuration that runs the following command:
56+
57+
```sh
58+
npx nx sync:check
59+
```
60+
61+
[Learn more about nx sync](https://nx.dev/reference/nx-commands#sync)
62+
63+
## Set up CI!
64+
65+
### Step 1
66+
67+
To connect to Nx Cloud, run the following command:
68+
69+
```sh
70+
npx nx connect
71+
```
72+
73+
Connecting to Nx Cloud ensures a [fast and scalable CI](https://nx.dev/ci/intro/why-nx-cloud?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) pipeline. It includes features such as:
74+
75+
- [Remote caching](https://nx.dev/ci/features/remote-cache?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
76+
- [Task distribution across multiple machines](https://nx.dev/ci/features/distribute-task-execution?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
77+
- [Automated e2e test splitting](https://nx.dev/ci/features/split-e2e-tasks?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
78+
- [Task flakiness detection and rerunning](https://nx.dev/ci/features/flaky-tasks?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
79+
80+
### Step 2
81+
82+
Use the following command to configure a CI workflow for your workspace:
83+
84+
```sh
85+
npx nx g ci-workflow
86+
```
87+
88+
[Learn more about Nx on CI](https://nx.dev/ci/intro/ci-with-nx#ready-get-started-with-your-provider?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
89+
90+
## Install Nx Console
91+
92+
Nx Console is an editor extension that enriches your developer experience. It lets you run tasks, generate code, and improves code autocompletion in your IDE. It is available for VSCode and IntelliJ.
93+
94+
[Install Nx Console &raquo;](https://nx.dev/getting-started/editor-setup?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
95+
96+
## Useful links
97+
98+
Learn more:
99+
100+
- [Learn more about this workspace setup](https://nx.dev/nx-api/js?utm_source=nx_project&amp;utm_medium=readme&amp;utm_campaign=nx_projects)
101+
- [Learn about Nx on CI](https://nx.dev/ci/intro/ci-with-nx?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
102+
- [Releasing Packages with Nx release](https://nx.dev/features/manage-releases?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
103+
- [What are Nx plugins?](https://nx.dev/concepts/nx-plugins?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
104+
105+
And join the Nx community:
106+
- [Discord](https://go.nx.dev/community)
107+
- [Follow us on X](https://twitter.com/nxdevtools) or [LinkedIn](https://www.linkedin.com/company/nrwl)
108+
- [Our Youtube channel](https://www.youtube.com/@nxdevtools)
109+
- [Our blog](https://nx.dev/blog?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"jsc": {
3+
"target": "es2017",
4+
"parser": {
5+
"syntax": "typescript",
6+
"decorators": true,
7+
"dynamicImport": true
8+
},
9+
"transform": {
10+
"decoratorMetadata": true,
11+
"legacyDecorator": true
12+
},
13+
"keepClassNames": true,
14+
"externalHelpers": true,
15+
"loose": true
16+
},
17+
"module": {
18+
"type": "es6"
19+
},
20+
"sourceMaps": true,
21+
"exclude": []
22+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import baseConfig from "../../eslint.base.config.mjs";
2+
import baseConfig from "../../eslint.config.mjs";
3+
4+
export default [
5+
...baseConfig,
6+
...baseConfig
7+
];

0 commit comments

Comments
 (0)