Skip to content

Commit bc29d15

Browse files
committed
Convert to Node.js monorepo
1 parent 4da1752 commit bc29d15

File tree

10 files changed

+1944
-429
lines changed

10 files changed

+1944
-429
lines changed

.github/actions/setup-env/action.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,19 @@ runs:
3737
key:
3838
${{ runner.os }}-${{ inputs.rust_cache_key }}-${{
3939
hashFiles('**/Cargo.lock') }}
40+
41+
- name: Enable Corepack
42+
shell: bash
43+
run: corepack enable pnpm
44+
45+
- name: Setup Node.js
46+
uses: actions/setup-node@v4
47+
with:
48+
cache: pnpm
49+
node-version-file: .nvmrc
50+
env:
51+
COREPACK_INTEGRITY_KEYS: '{"npm":[{"expires":"2025-01-29T00:00:00.000Z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","keytype":"ecdsa-sha2-nistp256","scheme":"ecdsa-sha2-nistp256","key":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1Olb3zMAFFxXKHiIkQO5cJ3Yhl5i6UPp+IhuteBJbuHcA5UogKo0EWtlWwW6KSaKoTNEYL7JlCQiVnkhBktUgg=="},{"expires":null,"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","keytype":"ecdsa-sha2-nistp256","scheme":"ecdsa-sha2-nistp256","key":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEY6Ya7W++7aUPzvMTrezH6Ycx3c+HOKYCcNGybJZSCJq/fd7Qa8uuAKtdIkUQtQiEKERhAmE5lMMJhP8OkDOa2g=="}]}'
52+
53+
- name: Install Node.js dependencies
54+
shell: bash
55+
run: pnpm install

.github/workflows/ci.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -136,21 +136,6 @@ jobs:
136136
python-version-file: examples/pyproject.toml
137137
cache-dependency-path: examples/pdm.lock
138138

139-
- name: Enable Corepack
140-
run: corepack enable pnpm
141-
142-
- name: Setup Node.js
143-
uses: actions/setup-node@v4
144-
with:
145-
cache: pnpm
146-
node-version-file: .nvmrc
147-
cache-dependency-path: "**/pnpm-lock.yaml"
148-
env:
149-
COREPACK_INTEGRITY_KEYS: '{"npm":[{"expires":"2025-01-29T00:00:00.000Z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","keytype":"ecdsa-sha2-nistp256","scheme":"ecdsa-sha2-nistp256","key":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1Olb3zMAFFxXKHiIkQO5cJ3Yhl5i6UPp+IhuteBJbuHcA5UogKo0EWtlWwW6KSaKoTNEYL7JlCQiVnkhBktUgg=="},{"expires":null,"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","keytype":"ecdsa-sha2-nistp256","scheme":"ecdsa-sha2-nistp256","key":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEY6Ya7W++7aUPzvMTrezH6Ycx3c+HOKYCcNGybJZSCJq/fd7Qa8uuAKtdIkUQtQiEKERhAmE5lMMJhP8OkDOa2g=="}]}'
150-
151-
- name: Install all dependencies
152-
run: just install
153-
154139
- name: Generate examples
155140
working-directory: examples/
156141
run: just all

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
.vscode
33
.idea
44

5+
# Node.js modules
6+
node_modules
7+
58
# Build artifacts
69
target
710

.pre-commit-config.yaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,21 @@ repos:
8787
# JavaScript
8888
# ==========
8989

90-
- repo: https://github.com/pre-commit/mirrors-prettier
91-
rev: v4.0.0-alpha.8
90+
- repo: local
9291
hooks:
9392
- id: prettier
93+
name: prettier
94+
"types": [text]
95+
language: system
96+
pass_filenames: true
97+
# Set log-level to error to prevent prettier printing every single file it checks
98+
# when running pre-commit with --all-files
99+
entry: pnpm exec prettier --write --ignore-unknown --log-level error
100+
101+
- id: eslint
102+
name: eslint
103+
files: (frontend|automations|packages/js).*?\.(js|ts|mjs|vue|json5?)$
104+
"types": [file] # ESLint only accepts [javascript] by default.
105+
language: system
106+
pass_filenames: false
107+
entry: pnpm exec eslint --max-warnings=0 --no-warn-ignored --fix

.prettierignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
# pnpm lockfile
1+
# Autogenerated
2+
.astro
3+
4+
# Lockfiles
25
pnpm-lock.yaml

eslint.config.mjs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import path from 'node:path'
2+
import { fileURLToPath } from 'node:url'
3+
4+
import globals from 'globals'
5+
6+
import { includeIgnoreFile } from '@eslint/compat'
7+
8+
import js from '@eslint/js'
9+
import ts from 'typescript-eslint'
10+
import astro from 'eslint-plugin-astro'
11+
12+
const __filename = fileURLToPath(import.meta.url)
13+
const srcDir = path.dirname(__filename)
14+
15+
const gitignorePath = path.resolve(srcDir, '.gitignore')
16+
17+
export default [
18+
includeIgnoreFile(gitignorePath),
19+
20+
{
21+
languageOptions: {
22+
ecmaVersion: 'latest',
23+
sourceType: 'module',
24+
globals: {
25+
...globals.node,
26+
...globals.browser,
27+
},
28+
},
29+
30+
rules: {
31+
'import/prefer-default-export': 'off',
32+
'@typescript-eslint/consistent-type-imports': 'error',
33+
},
34+
},
35+
36+
js.configs.recommended,
37+
...ts.configs.strict,
38+
...ts.configs.stylistic,
39+
...astro.configs.recommended,
40+
41+
// Type definitions
42+
{
43+
files: ['**/*.d.ts'],
44+
rules: {
45+
'@typescript-eslint/triple-slash-reference': 'off',
46+
},
47+
},
48+
]

package.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "pls",
3+
"description": "pls is a prettier and powerful ls(1) for the pros.",
4+
"private": true,
5+
"version": "0.0.0",
6+
"scripts": {
7+
"prepare": "husky",
8+
"lint": "eslint .",
9+
"lint:fix": "pnpm lint --fix",
10+
"format": "prettier --write .",
11+
"format:check": "prettier --check .",
12+
"checks": "pnpm lint && pnpm format:check"
13+
},
14+
"packageManager": "[email protected]",
15+
"devDependencies": {
16+
"@eslint/compat": "^1.2.8",
17+
"@eslint/js": "^9.24.0",
18+
"@types/eslint__js": "^8.42.3",
19+
"eslint": "^9.24.0",
20+
"eslint-plugin-astro": "^1.3.1",
21+
"globals": "^15.15.0",
22+
"husky": "^9.1.7",
23+
"lint-staged": "^15.5.1",
24+
"prettier": "^3.5.3",
25+
"prettier-plugin-astro": "^0.14.1",
26+
"typescript": "^5.8.3",
27+
"typescript-eslint": "^8.29.1"
28+
}
29+
}

0 commit comments

Comments
 (0)