Skip to content

Commit a5add80

Browse files
authored
Initial commit
0 parents  commit a5add80

File tree

12 files changed

+5029
-0
lines changed

12 files changed

+5029
-0
lines changed

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
actions: read
11+
contents: read
12+
13+
jobs:
14+
main:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
filter: tree:0
20+
fetch-depth: 0
21+
22+
# This enables task distribution via Nx Cloud
23+
# Run this command as early as possible, before dependencies are installed
24+
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
25+
# Uncomment this line to enable task distribution
26+
# - run: npx nx start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build"
27+
28+
# Cache node_modules
29+
- uses: actions/setup-node@v4
30+
with:
31+
node-version: 20
32+
cache: 'npm'
33+
34+
- run: npm ci --legacy-peer-deps
35+
36+
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
37+
# - run: npx nx-cloud record -- echo Hello World
38+
- run: npx nx run-many -t lint test build typecheck
39+
# Nx Cloud recommends fixes for failures to help you get CI green faster. Learn more: https://nx.dev/ci/features/self-healing-ci
40+
- run: npx nx fix-ci
41+
if: always()

.gitignore

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Add files here to ignore them from prettier formatting
2+
/dist
3+
/coverage
4+
/.nx/cache
5+
/.nx/workspace-data

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["nrwl.angular-console", "esbenp.prettier-vscode"]
3+
}

README.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# TsDemo
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 almost 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+
64+
[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)
65+
66+
## Install Nx Console
67+
68+
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.
69+
70+
[Install Nx Console &raquo;](https://nx.dev/getting-started/editor-setup?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
71+
72+
## Useful links
73+
74+
Learn more:
75+
76+
- [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)
77+
- [Learn about Nx on CI](https://nx.dev/ci/intro/ci-with-nx?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
78+
- [Releasing Packages with Nx release](https://nx.dev/features/manage-releases?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
79+
- [What are Nx plugins?](https://nx.dev/concepts/nx-plugins?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
80+
81+
And join the Nx community:
82+
- [Discord](https://go.nx.dev/community)
83+
- [Follow us on X](https://twitter.com/nxdevtools) or [LinkedIn](https://www.linkedin.com/company/nrwl)
84+
- [Our Youtube channel](https://www.youtube.com/@nxdevtools)
85+
- [Our blog](https://nx.dev/blog?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)

nx.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"$schema": "./node_modules/nx/schemas/nx-schema.json",
3+
"namedInputs": {
4+
"default": ["{projectRoot}/**/*", "sharedGlobals"],
5+
"production": ["default"],
6+
"sharedGlobals": ["{workspaceRoot}/.github/workflows/ci.yml"]
7+
},
8+
"plugins": [
9+
{
10+
"plugin": "@nx/js/typescript",
11+
"options": {
12+
"typecheck": {
13+
"targetName": "typecheck"
14+
},
15+
"build": {
16+
"targetName": "build",
17+
"configName": "tsconfig.lib.json",
18+
"buildDepsName": "build-deps",
19+
"watchDepsName": "watch-deps"
20+
}
21+
}
22+
}
23+
]
24+
}

0 commit comments

Comments
 (0)