Skip to content

Commit

Permalink
feat(repo): migrate from nx to turbo (#7)
Browse files Browse the repository at this point in the history
* feat(turbo): migrate from nx

* ci(codecov): using cobertura for codecov

* ci(codecov): reverting as it was working already
  • Loading branch information
bashaus committed Jun 5, 2023
1 parent da9e866 commit a634950
Show file tree
Hide file tree
Showing 64 changed files with 731 additions and 2,742 deletions.
5 changes: 4 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
node_modules
.turbo/
coverage/
dist/
node_modules/
42 changes: 1 addition & 41 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,4 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
}
]
}
]
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"rules": {}
},
{
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
"env": {
"jest": true
},
"rules": {
"@nrwl/nx/enforce-module-boundaries": 0
}
}
]
"extends": ["@apollo-link-debug"]
}
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
run: yarn prettier --check .

- name: lint
run: yarn nx run-many --target=lint
run: yarn eslint .
19 changes: 12 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
name: Publish

on:
push:
tags:
- 'v*'
release:
types:
- created

jobs:
publish:
Expand All @@ -18,6 +18,10 @@ jobs:
- handle-timer

runs-on: ubuntu-latest

permissions:
id-token: write

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand All @@ -30,10 +34,11 @@ jobs:
run: yarn install --frozen-lockfile

- name: build ${{ matrix.package }}
run: yarn nx run ${{ matrix.package }}:build
working-directory: packages/${{ matrix.package }}
run: yarn build

- name: npm publish
working-directory: dist/packages/${{ matrix.package }}
run: npm publish --access public
- name: publish ${{ matrix.package }}
working-directory: packages/${{ matrix.package }}
run: npm publish --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
dist
tmp
/out-tsc
dist/
coverage/
tmp/

# dependencies
node_modules
.turbo/
node_modules/

# IDEs and editors
/.idea
Expand All @@ -27,7 +28,6 @@ node_modules
# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn nx affected --target=test
yarn test
8 changes: 4 additions & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Add files here to ignore them from prettier formatting

/dist
/coverage
.turbo/
coverage/
dist/
node_modules/
1 change: 0 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"esbenp.prettier-vscode",
"firsttris.vscode-jest-runner",
"graphql.vscode-graphql",
"nrwl.angular-console",
"wix.vscode-import-cost"
]
}
12 changes: 11 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.rulers": [80]
"editor.rulers": [80],
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[typescriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
}
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @apollo-link-debug/\*

[![codecov](https://codecov.io/gh/bashaus/apollo-link-debug/branch/main/graph/badge.svg?token=QJNOYSFXDH)](https://codecov.io/gh/bashaus/apollo-link-debug)

A collection of apollo links used to help debug GraphQL requests and responses.

See the individual packages for more information:
Expand Down
8 changes: 5 additions & 3 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { getJestProjects } from '@nrwl/jest';
import { Config } from 'jest';

export default {
projects: getJestProjects(),
const config: Config = {
projects: ['packages/*'],
};

export default config;
3 changes: 0 additions & 3 deletions jest.preset.js

This file was deleted.

43 changes: 0 additions & 43 deletions nx.json

This file was deleted.

50 changes: 23 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,41 @@
"url": "https://github.com/bashaus/apollo-link-debug.git"
},
"license": "MIT",
"workspaces": [
"packages/*"
],
"scripts": {
"build": "nx run-many --target=build",
"lint": "nx run-many --target=lint",
"build": "turbo run build",
"clean": "turbo run clean",
"lint": "turbo run lint",
"prepare": "husky install",
"prepublishOnly": "exit 1",
"test": "jest"
},
"dependencies": {
"cookie": "^0.5.0",
"cross-fetch": "^3.1.5"
"cross-fetch": "^3.1.6"
},
"devDependencies": {
"@apollo/client": "^3.7.10",
"@commitlint/cli": "^17.4.4",
"@commitlint/config-conventional": "^17.4.4",
"@nrwl/eslint-plugin-nx": "15.8.6",
"@nrwl/jest": "15.8.6",
"@nrwl/js": "15.8.6",
"@nrwl/linter": "15.8.6",
"@nrwl/workspace": "15.8.6",
"@types/cookie": "^0.5.1",
"@types/jest": "^29.4.0",
"@types/node": "16.11.7",
"@typescript-eslint/eslint-plugin": "^5.36.1",
"@typescript-eslint/parser": "^5.36.1",
"eslint": "~8.15.0",
"eslint-config-prettier": "8.1.0",
"@apollo/client": "^3.7.15",
"@commitlint/cli": "17.6.5",
"@commitlint/config-conventional": "17.6.5",
"@swc/core": "^1.3.62",
"@swc/jest": "^0.2.26",
"@types/jest": "^29.5.2",
"@types/node": "^20.2.5",
"eslint": "^8.42.0",
"graphql": "^16.6.0",
"husky": "^8.0.3",
"jest": "^29.4.1",
"jest-environment-jsdom": "^29.4.1",
"lint-staged": "^13.2.0",
"nx": "15.8.6",
"prettier": "2.8.4",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"lint-staged": "^13.2.2",
"prettier": "2.8.8",
"pretty-quick": "^3.1.3",
"react": "^18.2.0",
"sort-package-json": "^2.4.1",
"ts-jest": "^29.0.5",
"ts-node": "10.9.1",
"typescript": "~4.9.5"
"ts-jest": "^29.1.0",
"ts-node": "^10.9.1",
"turbo": "^1.10.1",
"typescript": "^5.1.3"
}
}
4 changes: 4 additions & 0 deletions packages/core/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.turbo/
coverage/
dist/
node_modules/
6 changes: 6 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "@apollo-link-debug/core",
"version": "0.0.0",
"private": true,
"main": "./src/index.ts"
}
16 changes: 0 additions & 16 deletions packages/core/project.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"outDir": "./dist",
"declaration": true,
"types": ["node"]
},
Expand Down
4 changes: 2 additions & 2 deletions packages/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "@apollo-link-debug/tsconfig",
"compilerOptions": {
"module": "commonjs",
"forceConsistentCasingInFileNames": true,
Expand All @@ -13,7 +13,7 @@
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
"path": "./tsconfig.build.json"
}
]
}
12 changes: 12 additions & 0 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "@apollo-link-debug/eslint-config",
"version": "0.0.0",
"private": true,
"main": "./src/index.js",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "5.59.8",
"@typescript-eslint/parser": "5.59.8",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-prettier": "^4.2.1"
}
}
Loading

0 comments on commit a634950

Please sign in to comment.