Skip to content

Commit

Permalink
fix(global): remove unbuild, update docs and lint-staged config
Browse files Browse the repository at this point in the history
  • Loading branch information
waldronmatt committed Nov 3, 2023
1 parent e9e96d4 commit d5cabbf
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 309 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no-install lint-staged
npx --no-install lint-staged --relative
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ Token setup and repository settings can be [found here](docs/repo/SETUP.md).

## Getting Started

**Note**: Append `--skip-nx-cache` at the end of cached commands to disable nx cloud caching
**Note**: Append `--no-cache` at the end of cached commands **directly** to disable nx cloud caching and append `--skip-nx-cache` to disable cache connection to `nx cloud`. Example: `npx nx run-many -t test --no-cache`

Commit changes using conventional changelog:

```bash
pnpm commit
```

Run local development servers:

Expand All @@ -44,6 +50,20 @@ Run tests with coverage:
pnpm test
```

Run tests in watch mode:

```bash
pnpm test:watch
```

Run tests against compiled files:

**Note**: Run `pnpm build` first.

```bash
pnpm test:prod
```

Compile files and build bundle:

**Note**: It is recommended to run `pnpm clean` before `pnpm build`
Expand All @@ -58,6 +78,14 @@ Clean up bundle artifacts:
pnpm clean
```

Starts local servers that serves the `build` outputs from their respective output folders:

**Note**: Run `pnpm build` first.

```bash
pnpm preview
```

## Additional Documentation

Additional monorepo documentation can be [found here](docs/repo/README.md).
Expand Down
3 changes: 0 additions & 3 deletions configs/eslint-config-custom/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
module.exports = {
root: true,
extends: ['./js.cjs'],
// rules: {
// 'linebreak-style': 0,
// },
};
3 changes: 0 additions & 3 deletions configs/jest-config/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
module.exports = {
root: true,
extends: ['custom/js.cjs'],
// rules: {
// 'linebreak-style': 0,
// },
};
34 changes: 1 addition & 33 deletions docs/repo/COMMANDS.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,5 @@
# Additional Commands

Run tests in watch mode:

```bash
pnpm test:watch
```

Starts local servers that serves the `build` outputs from their respective output folders:

**Note**: Run `pnpm build` first.

```bash
pnpm preview
```

Stub `dist` for project linking without needing to watch and rebuild:

```bash
pnpm stub
```

Commit changes using conventional changelog:

```bash
pnpm commit
```

Delete workspace root `node_modules` and `pnpm-lock.yaml` files:

**Note**: Install `rimraf` globally and make sure it is not installed in the workspace root so errors aren't thrown.
Expand All @@ -34,7 +8,7 @@ Delete workspace root `node_modules` and `pnpm-lock.yaml` files:
pnpm delete
```

Check for secrets, lint dependency versions, validate published packages, and verify monorepo best practices:
Format files, check for secrets, lint dependency versions, validate published packages, and verify monorepo best practices:

```bash
pnpm lint:mr
Expand All @@ -46,12 +20,6 @@ Visualize the project structure/dependencies:
pnpm nx:graph
```

Format all files in the monorepo:

```bash
pnpm format
```

Preview the output result of the `version` command without actually executing it:

**Note**: Set your personal access token as an environment variable in your operating system as `GH_TOKEN` with the token unique identifier as the value.
Expand Down
10 changes: 9 additions & 1 deletion lint-staged.config.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
module.exports = {
'**/*': ['secretlint', 'prettier --cache --write --ignore-unknown'],
'*': [
'secretlint',
'prettier --cache --write --ignore-unknown',
'npx syncpack lint-semver-ranges --config .syncpackrc',
'npx publint run ./',
'npx manypkg check',
],
'*.{cjs,js,jsx,ts,tsx}': ['nx affected:lint --fix --files'],
'*.{ts,tsx}': ['nx affected:test --fix --files'],
};
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,20 @@
"prepare": "husky install",
"commit": "git-cz",
"delete": "rimraf pnpm-lock.yaml node_modules",
"nx:graph": "npx nx graph",
"format": "prettier --write .",
"preview:version": "lerna version --dry-run --yes",
"preview:publish": "lerna publish from-package --dry-run --yes",
"lint:format": "prettier --write .",
"lint:secrets": "npx secretlint **/*",
"lint:deps": "npx syncpack lint-semver-ranges --config .syncpackrc",
"lint:publish": "npx publint",
"lint:package": "npx manypkg check",
"lint:mr": "run-p lint:secrets lint:deps lint:publish lint:package",
"lint:mr": "run-p lint:format lint:secrets lint:deps lint:publish lint:package",
"nx:graph": "npx nx graph",
"preview:version": "lerna version --dry-run --yes",
"preview:publish": "lerna publish from-package --dry-run --yes",
"dev": "npx nx run-many -t dev",
"lint": "npx nx run-many -t lint",
"test": "npx nx run-many -t test",
"test:watch": "npx nx run-many -t test:watch",
"test:prod": "npx nx run-many -t test:prod",
"clean": "npx nx run-many -t clean",
"build": "npx nx run-many -t build",
"preview": "npx nx run-many -t preview",
Expand Down
6 changes: 2 additions & 4 deletions packages/basic-math/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
"build:dtsmaps": "tsc --project tsconfig.build.json",
"build:src": "tsup src/*[!.spec].ts --format esm --sourcemap --onSuccess \"pnpm build:dtsmaps\"",
"build": "pnpm build:src",
"clean": "rimraf dist coverage tsconfig.build.tsbuildinfo",
"stub": "npx unbuild --stub"
"clean": "rimraf dist coverage tsconfig.build.tsbuildinfo"
},
"publishConfig": {
"access": "public"
Expand Down Expand Up @@ -56,7 +55,6 @@
"tslib": "2.6.2",
"tsup": "7.2.0",
"turbo": "1.10.16",
"typescript": "5.2.2",
"unbuild": "2.0.0"
"typescript": "5.2.2"
}
}
5 changes: 0 additions & 5 deletions packages/parity/build.config.ts

This file was deleted.

6 changes: 2 additions & 4 deletions packages/parity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
"build:dtsmaps": "tsc --project tsconfig.build.json",
"build:src": "tsup src/*[!.spec].ts --format esm --sourcemap --onSuccess \"pnpm build:dtsmaps\"",
"build": "pnpm build:src",
"clean": "rimraf dist coverage tsconfig.build.tsbuildinfo",
"stub": "npx unbuild --stub"
"clean": "rimraf dist coverage tsconfig.build.tsbuildinfo"
},
"publishConfig": {
"access": "public"
Expand Down Expand Up @@ -56,7 +55,6 @@
"tslib": "2.6.2",
"tsup": "7.2.0",
"turbo": "1.10.16",
"typescript": "5.2.2",
"unbuild": "2.0.0"
"typescript": "5.2.2"
}
}
Loading

0 comments on commit d5cabbf

Please sign in to comment.