Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node-version: [16.x, 18.x, 20.x, 22.x]
node-version: [18.x, 20.x, 22.x]
operating-system: [windows-latest, macOS-latest, ubuntu-latest]

steps:
Expand All @@ -22,6 +22,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix['node-version'] }}
cache: 'npm'

- name: Install dependencies
run: npm install
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/commitlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm install

- name: Validate all commits from PR
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
run: npx commitlint --config config/commitlint.config.mjs --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
6 changes: 4 additions & 2 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: Test Build
run: |
npm install
npm run api
npm run api:all
npm run docs
cd website
npm install
Expand All @@ -32,6 +33,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: Add key to allow access to repository
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
Expand All @@ -53,7 +55,7 @@ jobs:
git config --global user.email "actions@gihub.com"
git config --global user.name "gh-actions"
npm install
npm run api
npm run api:all
npm run docs
cd website
npm install
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ dist
node_modules
reports
lerna-debug.log
fixtures
*.tsbuildinfo
*.vsix
goldens/models
Expand All @@ -16,3 +17,8 @@ betterer.*.log
.betterer.cache
.betterer.*.mjs
.eslintcache



.nx/cache
.nx/workspace-data
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
npx --no -- commitlint --edit $1
npx --no -- commitlint --config config/commitlint.config.mjs --edit $1
7 changes: 1 addition & 6 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
npm install
npx lint-staged
npm run test:api
npm run test:dependencies
npm run test:e2e
npm run betterer:precommit
npx lint-staged --config config/lint-staged.config.mjs
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
.husky
.gitattributes
.gitignore
.lintstagedrc
.npmrc
.prettierignore
.vscode-test
.nx
CHANGELOG.md
dist
fixtures
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion .betterer.ts → config/.betterer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
regexp(/(\/\/\s*HACK)/i).include(['./packages/**/src/**/*.ts', './packages/**/src/**/*.tsx']),
'no knip errors': () =>
knip(
'./knip.json',
'./config/knip.json',
{},
{
production: true,
Expand Down
10 changes: 7 additions & 3 deletions api-extractor.json → config/api-extractor.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"apiReport": {
"enabled": true,
"reportFileName": "<unscopedPackageName>.api.md",
"reportFolder": "./goldens/api/",
"reportTempFolder": "./goldens/temp/"
"reportFolder": "../goldens/api/",
"reportTempFolder": "../goldens/temp/"
},

"docModel": {
"enabled": true,
"apiJsonFilePath": "./goldens/models/<unscopedPackageName>.api.json"
"apiJsonFilePath": "../goldens/models/<unscopedPackageName>.api.json"
},

"dtsRollup": {
Expand All @@ -29,6 +29,10 @@
"default": {
"logLevel": "warning",
"addToApiReportFile": true
},
"ae-internal-missing-underscore": {
"logLevel": "none",
"addToApiReportFile": false
}
},
"tsdocMessageReporting": {
Expand Down
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions config/lint-staged.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
'*.{ts,tsx}': () => ['npm run compile:all', 'npm run api:all'],
'*.{ts,tsx,js,mjs}': 'eslint --fix',
'*': 'prettier --write'
};
File renamed without changes.
4 changes: 4 additions & 0 deletions config/tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../tsconfig.json",
"include": ["../**/*.js", "../**/*.mjs", "../**/*.ts", "../**/*.tsx", "../*.js", "../*.ts", ".betterer.ts"]
}
2 changes: 1 addition & 1 deletion tsconfig.spec.json → config/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.json",
"extends": "../tsconfig.json",
"compilerOptions": {
"allowJs": true,
"paths": {
Expand Down
2 changes: 1 addition & 1 deletion vitest.e2e.config.ts → config/vitest.e2e.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from 'vitest/config';

import config from './vitest.config.js';
import config from '../vitest.config.js';

export default defineConfig({
test: {
Expand Down
4 changes: 2 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const compat = new FlatCompat({
});

export default tsLint.config(
{ files: ['packages/**/src/**/*.{ts,tsx}', 'test/**/*.{ts,tsx}', '*.{ts}'] },
{ files: ['packages/**/src/**/*.{ts,tsx}', 'test/**/*.{ts,tsx}', 'tools/**/src/**/*.ts', '*.{ts}'] },
{
ignores: ['**/node_modules/**', '**/dist/**', 'fixtures/**', 'reports/**', 'website/**', '**/.vscode-test/**']
},
Expand All @@ -35,7 +35,7 @@ export default tsLint.config(
languageOptions: {
globals: globals.browser,
parserOptions: {
project: './tsconfig.eslint.json',
project: './config/tsconfig.eslint.json',
tsconfigRootDir: dirname
}
}
Expand Down
33 changes: 0 additions & 33 deletions lerna.json

This file was deleted.

4 changes: 0 additions & 4 deletions lint-staged.config.js

This file was deleted.

69 changes: 69 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"targetDefaults": {
"compile": {
"dependsOn": ["^compile"],
"outputs": ["{projectRoot}/dist"],
"cache": true
},
"lint": {
"options": {
"command": "eslint --cache ."
}
}
},
"defaultBase": "master",
"release": {
"projects": ["packages/*", "!packages/extension", "!packages/fixture", "!packages/docgen"],
"projectsRelationship": "fixed",
"version": {
"conventionalCommits": true,
"preVersionCommand": "nx run-many -t sync:metadata"
},
"changelog": {
"workspaceChangelog": true,
"projectChangelogs": false
},
"git": {
"commit": true,
"commitMessage": "chore(release 🔖): publish {version}",
"tag": true
}
},
"plugins": [
{
"plugin": "./tools/nx-plugin-betterer-monorepo-api/src/index.ts"
},
{
"plugin": "./tools/nx-plugin-betterer-monorepo-clean/src/index.ts"
},
{
"plugin": "./tools/nx-plugin-betterer-monorepo-metadata/src/index.ts"
},
{
"plugin": "./tools/nx-plugin-betterer-monorepo-docs/src/index.ts"
},
{
"plugin": "@nx/js/typescript",
"options": {
"typecheck": {
"targetName": "typecheck"
}
}
},
{
"plugin": "@nx/eslint/plugin",
"options": {
"targetName": "lint"
}
},
{
"plugin": "@nx/vite/plugin",
"options": {
"testTargetName": "test",
"typecheckTargetName": "typecheck"
}
}
],
"analytics": false
}
Loading
Loading