Skip to content

Commit

Permalink
Merge pull request #150 from solidjs-community/turbo-monorepo
Browse files Browse the repository at this point in the history
Restructure to turbo monorepo
  • Loading branch information
joshwilsonvu authored Aug 24, 2024
2 parents b097fdd + 6e7dc29 commit 0380b51
Show file tree
Hide file tree
Showing 186 changed files with 2,088 additions and 564 deletions.
42 changes: 22 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: CI
on:
push:
branches-ignore:
- reactivity-v2
branches: ["main"]
pull_request:
branches:
- main
types: [opened, synchronize]
jobs:
build:
name: Build
Expand All @@ -14,26 +12,30 @@ jobs:
matrix:
node: ["18", "20", "22"]
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3
uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
run_install: false

- name: Install node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run build
run: pnpm run build
- name: Lint source code
run: pnpm run lint --max-warnings=0
- name: Run all tests
run: pnpm run test:all
- name: Sanity check standalone build
working-directory: standalone
run: |
pnpm install --frozen-lockfile
pnpm build
pnpm test

- name: Cache turbo setup
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Run CI with turbo
run: pnpm run ci
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Build directory
dist
dist.*
!packages/eslint-solid-standalone/dist.d.ts

# Logs
logs
Expand Down Expand Up @@ -106,3 +107,6 @@ typings/
# TernJS port file
.tern-port
.DS_Store

# Turbo cache
.turbo
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm build
git add README.md docs/*
pnpm run docs
git add README.md packages/eslint-plugin-solid/README.md packages/eslint-plugin-solid/docs/*
pnpm lint-staged
3 changes: 2 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
auto-install-peers=true
link-workspace-packages=true
disallow-workspace-cycles=true
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ const [editedValue, setEditedValue] = createSignal(props.value);

_Please note_: there may also be times where a rule correctly warns about a subtle problem,
even if it looks like a false positive at first. With `solid/reactivity`, please look at the
[reactivity docs](./docs/reactivity.md#troubleshooting) before deciding to disable the rule.
[reactivity docs](https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/reactivity.md#troubleshooting) before deciding to disable the rule.

When in doubt, feel free to [file an
issue](https://github.com/solidjs-community/eslint-plugin-solid/issues/new/choose).
Expand Down
4 changes: 0 additions & 4 deletions configs/recommended.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion configs/recommended.js

This file was deleted.

4 changes: 0 additions & 4 deletions configs/typescript.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion configs/typescript.js

This file was deleted.

38 changes: 6 additions & 32 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// @ts-check
import path from "node:path";
import js from "@eslint/js";
import globals from "globals";
import tseslint from "typescript-eslint";
import pluginEslintPlugin from "eslint-plugin-eslint-plugin";
import solid from "./dist/index.js";

const tsconfigPath = path.resolve("tsconfig.json");

export default tseslint.config(
{
ignores: ["dist", "**/dist.*", "./configs", "node_modules", "eslint.config.mjs"],
ignores: ["**/dist/", "**/dist.*", "**/.tsup/", "**/eslint.config.mjs", "test/"],
},
js.configs.recommended,
tseslint.configs.eslintRecommended,
Expand All @@ -17,7 +19,7 @@ export default tseslint.config(
sourceType: "module",
parser: tseslint.parser,
parserOptions: {
project: "./tsconfig.json",
project: tsconfigPath,
},
globals: globals.node,
},
Expand All @@ -33,7 +35,7 @@ export default tseslint.config(
},
},
{
files: ["src/rules/*.ts", "configs/*"],
files: ["packages/eslint-plugin-solid/src/rules/*.ts"],
languageOptions: {
globals: globals.node,
},
Expand All @@ -57,33 +59,5 @@ export default tseslint.config(
},
],
},
},
// needed for CommonJS / ESLint <= v8 compatibility
{
files: ["configs/*"],
rules: {
"@typescript-eslint/no-require-imports": "off",
},
},
// standalone is designed not to need any Node or browser APIs
{
files: ["standalone/index.js"],
languageOptions: {
globals: {},
},
},
// fixture gets tested with the plugin
{
files: ["test/fixture/**/*.{js,jsx,ts,tsx}"],
...solid.configs["flat/recommended"],
languageOptions: {
globals: globals.browser,
},
rules: {
...solid.configs["flat/recommended"].rules,
"@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/no-unused-expressions": 0,
"@typescript-eslint/no-unused-vars": 0,
},
}
);
104 changes: 31 additions & 73 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,92 +1,50 @@
{
"name": "eslint-plugin-solid",
"version": "0.14.2",
"description": "Solid-specific linting rules for ESLint.",
"keywords": [
"eslint",
"eslintplugin",
"solid",
"solidjs",
"reactivity"
],
"main": "dist/index.js",
"types": "dist/index.d.ts",
"repository": "https://github.com/solidjs-community/eslint-plugin-solid",
"author": "Josh Wilson <[email protected]>",
"name": "eslint-plugin-solid-monorepo",
"private": true,
"license": "MIT",
"engines": {
"node": ">=12.0.0"
},
"scripts": {
"build": "turbo run turbo:build",
"ci": "PARSER=all turbo run turbo:build turbo:test turbo:docs turbo:lint turbo:tsc",
"docs": "turbo run turbo:docs",
"lint": "turbo run turbo:lint",
"prepare": "husky install",
"prepublishOnly": "pnpm build && pnpm lint && prettier --check src && pnpm test:all",
"build": "tsc -p tsconfig.build.json && pnpm run docs",
"eslint": "node node_modules/eslint/bin/eslint.js",
"lint": "pnpm eslint --ignore-pattern test/fixture/invalid",
"docs": "PARSER=none tsx scripts/docs.ts",
"test": "vitest",
"test:ts": "PARSER=ts pnpm test",
"test:babel": "PARSER=babel pnpm test",
"test:v6": "PARSER=v6 pnpm test",
"test:v7": "PARSER=v7 pnpm test",
"test:all": "PARSER=all pnpm test"
"test": "turbo run turbo:test",
"tsc": "turbo run turbo:tsc",
"turbo:docs": "cp packages/eslint-plugin-solid/README.md README.md",
"turbo:lint": "eslint --max-warnings=0",
"turbo:tsc": "tsc"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"pnpm lint -- --no-warn-ignored --fix",
"prettier --write"
]
},
"files": [
"src",
"dist",
"configs",
"README.md"
],
"dependencies": {
"@typescript-eslint/utils": "^7.13.1 || ^8.0.0",
"estraverse": "^5.3.0",
"is-html": "^2.0.0",
"kebab-case": "^1.0.2",
"known-css-properties": "^0.30.0",
"style-to-object": "^1.0.6"
"prettier": {
"plugins": [
"prettier-plugin-packagejson"
],
"printWidth": 100
},
"devDependencies": {
"@babel/core": "^7.24.4",
"@babel/eslint-parser": "^7.24.7",
"@tsconfig/node20": "^20.1.4",
"@types/eslint": "^8.56.10",
"@types/eslint-v6": "npm:@types/eslint@6",
"@types/eslint-v7": "npm:@types/eslint@7",
"@types/eslint-v8": "npm:@types/eslint@8",
"@types/eslint__js": "^8.42.3",
"@types/estraverse": "^5.1.7",
"@types/is-html": "^2.0.2",
"@types/node": "^20",
"@types/prettier": "^2.7.3",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"eslint": "^9.5.0",
"eslint-plugin-eslint-plugin": "^6.1.0",
"eslint-plugin-solid": "link:",
"eslint-v6": "npm:eslint@6",
"eslint-v7": "npm:eslint@7",
"eslint-v8": "npm:eslint@8",
"globals": "^15.6.0",
"husky": "^8.0.3",
"lint-staged": "^13.3.0",
"markdown-magic": "^3.3.0",
"prettier": "^2.8.8",
"tsx": "^4.7.3",
"prettier-plugin-packagejson": "^2.5.1",
"turbo": "^2.0.14",
"typescript": "^5.5.4",
"typescript-eslint": "^8.1.0",
"vitest": "^1.5.2"
},
"peerDependencies": {
"eslint": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0"
},
"lint-staged": {
"*!(test).{js,jsx,ts,tsx}": [
"pnpm lint --fix",
"prettier --write"
]
},
"prettier": {
"printWidth": 100
"typescript-eslint": "^8.1.0"
},
"packageManager": "[email protected]"
"packageManager": "[email protected]",
"pnpm": {
"patchedDependencies": {
"[email protected]": "patches/[email protected]"
}
}
}
Loading

0 comments on commit 0380b51

Please sign in to comment.