diff --git a/.gitignore b/.gitignore index 50e55cb..6eedd3f 100644 --- a/.gitignore +++ b/.gitignore @@ -33,4 +33,6 @@ bun.lock */build/* # IntelliJ -.idea \ No newline at end of file +.idea +.eslintcache +tsconfig.tsbuildinfo \ No newline at end of file diff --git a/.husky/pre-push b/.husky/pre-push old mode 100644 new mode 100755 index 48f9bf5..475c5bd --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1 +1,15 @@ -pnpm typecheck --minimumFailingSeverity warning +if git diff --cached --name-only | grep -q '\.astro$'; then + echo "Running full astro check" + astro check --minimumFailingSeverity warning +else + if [ -n "${DEBUG}" ]; then + echo "Using TypeScript version: $(tsc --version) at $(which tsc)" + start=$(date +%s%N) + tsc --noEmit + end=$(date +%s%N) + echo "TypeScript time (approx): $(((end - start)/1000000))ms" + else + echo "Running TypeScript check" + tsc --noEmit + fi +fi \ No newline at end of file diff --git a/.remarkrc.mjs b/.remarkrc.mjs index 3a3379b..d329309 100644 --- a/.remarkrc.mjs +++ b/.remarkrc.mjs @@ -12,19 +12,22 @@ export default { remarkPresetLintRecommended, remarkNoInlineCodeFences, remarkNoHtmlLinks, - [ - remarkLintNoDeadUrls, - { - skipLocalhost: false, - skipOffline: true, - skipUrlPatterns: [ - 'https://github.com/signup', - 'https://code.visualstudio.com/', - 'https://www.conventionalcommits.org/en/v1.0.0/', - 'https://vale.sh/', - 'https://squoosh.app/', - ], // Add known flaky URL patterns here - }, - ], + // only run dead link checker in CI to save time in dev + process.env.CI + ? [ + remarkLintNoDeadUrls, + { + skipLocalhost: false, + skipOffline: true, + skipUrlPatterns: [ + 'https://github.com/signup', + 'https://code.visualstudio.com/', + 'https://www.conventionalcommits.org/en/v1.0.0/', + 'https://vale.sh/', + 'https://squoosh.app/', + ], // Add known flaky URL patterns here + }, + ] + : () => undefined, ], }; diff --git a/eslint.config.mjs b/eslint.config.mjs index 0efff8c..5d5a1e9 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,7 +1,6 @@ import js from '@eslint/js'; import astro from 'eslint-plugin-astro'; import globals from 'globals'; -import process from 'node:process'; import tseslint from 'typescript-eslint'; import { defineConfig } from 'eslint/config'; @@ -21,8 +20,7 @@ export default defineConfig([ { argsIgnorePattern: '^_' }, ], '@typescript-eslint/no-explicit-any': 'error', - // ci runs `astro check` which runs a full typescript checker - 'no-undef': process.env.CI ? 'off' : 'error', + 'no-undef': 'off', }, }, { @@ -42,8 +40,5 @@ export default defineConfig([ ImageMetadata: 'readonly', }, }, - rules: { - 'no-undef': 'off', - }, }, ]); diff --git a/lint-staged.config.mjs b/lint-staged.config.mjs index 1b56c8b..8540e23 100644 --- a/lint-staged.config.mjs +++ b/lint-staged.config.mjs @@ -1,6 +1,25 @@ +const runPrettierOn = + '**/*.{' + + [ + 'js', + 'mjs', + 'ts', + 'json', + 'json5', + 'jsonc', + 'css', + 'md', + 'mdx', + 'yaml', + 'yml', + 'astro', + ].join(',') + + '}'; + /** @type {import('lint-staged').Configuration} */ export default { - '**/*': (files) => `prettier --write --ignore-unknown ${files.join(' ')}`, + [runPrettierOn]: (files) => + `prettier --write --ignore-unknown ${files.join(' ')}`, '**/*.{astro,ts,mjs,js}': (files) => `eslint --fix ${files.join(' ')}`, 'src/content/**/*.{md,mdx}': (files) => [ `pnpm remark ${files.join(' ')} --ext mdx --frail --no-stdout --quiet`, diff --git a/package.json b/package.json index 3197978..4554f67 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "prebuild": "tsx scripts/generate-glossary.ts", "predev": "tsx scripts/generate-glossary.ts", "lint": "pnpm lint:eslint && pnpm lint:md && pnpm lint:regions && pnpm lint:glossary && pnpm typecheck && pnpm vale", - "lint:eslint": "eslint .", + "lint:eslint": "eslint \"src/**/*.{ts,astro,js,mjs,css}\" \"*.mjs\" --cache", "lint:md": "remark src/content/docs --ext mdx --frail", "lint:regions": "tsx scripts/validate-regions.ts", "vale": "pnpm vale:setup && vale sync && vale src/content", @@ -40,12 +40,13 @@ "@eslint/js": "^10.0.1", "@types/estree": "^1.0.9", "@types/mdast": "^4.0.4", + "@types/node": "^26.1.2", "astro-eslint-parser": "^1.4.0", "eslint": "^10.5.0", "eslint-plugin-astro": "^1.7.0", - "mdast-util-mdx": "^3.0.0", "husky": "^9.1.7", "lint-staged": "^17.0.8", + "mdast-util-mdx": "^3.0.0", "mdast-util-mdx-jsx": "^3.2.0", "mdx2vast": "^0.3.1", "prettier": "^3.8.4", @@ -61,6 +62,7 @@ "tsx": "^4.22.4", "typescript": "^6.0.3", "typescript-eslint": "^8.61.1", - "vfile": "^6.0.3" + "vfile": "^6.0.3", + "typescript-7": "npm:typescript@^7.0.2" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5ba09bc..f50b4cb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,13 +13,13 @@ importers: version: 7.2.1 '@astrojs/starlight': specifier: ^0.41.4 - version: 0.41.4(@astrojs/markdown-remark@7.2.1)(astro@7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@24.12.4)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0))(typescript@6.0.3) + version: 0.41.4(@astrojs/markdown-remark@7.2.1)(astro@7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@26.1.2)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0))(typescript@6.0.3) '@mdi/js': specifier: ^7.4.47 version: 7.4.47 astro: specifier: ^7.1.3 - version: 7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@24.12.4)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0) + version: 7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@26.1.2)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0) sharp: specifier: ^0.34.5 version: 0.34.5 @@ -39,6 +39,9 @@ importers: '@types/mdast': specifier: ^4.0.4 version: 4.0.4 + '@types/node': + specifier: ^26.1.2 + version: 26.1.2 astro-eslint-parser: specifier: ^1.4.0 version: 1.4.0 @@ -92,13 +95,16 @@ importers: version: 7.0.1 starlight-links-validator: specifier: ^0.20.0 - version: 0.20.1(@astrojs/starlight@0.41.4(@astrojs/markdown-remark@7.2.1)(astro@7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@24.12.4)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0))(typescript@6.0.3))(astro@7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@24.12.4)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0)) + version: 0.20.1(@astrojs/starlight@0.41.4(@astrojs/markdown-remark@7.2.1)(astro@7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@26.1.2)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0))(typescript@6.0.3))(astro@7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@26.1.2)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0)) tsx: specifier: ^4.22.4 version: 4.22.4 typescript: specifier: ^6.0.3 version: 6.0.3 + typescript-7: + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 typescript-eslint: specifier: ^8.61.1 version: 8.61.1(eslint@10.5.0)(typescript@6.0.3) @@ -1158,6 +1164,9 @@ packages: '@types/node@24.12.4': resolution: {integrity: sha512-GUUEShf+PBCGW2KaXwcIt3Yk+e3pkKwWKb9GSyM9WQVE+ep2jzmHdGsHzu4wgcZy5fN9FBdVzjpBQsYlpfpgLA==} + '@types/node@26.1.2': + resolution: {integrity: sha512-Vu4a5UFA9rIIFJ7rB/Vaafh9lrCQszopTCx6KjFboXTGQbPNasehVR5TEiithSDGyd1DEiUByggTZsg8jukeIg==} + '@types/picomatch@4.0.3': resolution: {integrity: sha512-iG0T6+nYJ9FAPmx9SsUlnwcq1ZVRuCXcVEvWnntoPlrOpwtSTKNDC9uVAxTsC3PUvJ+99n4RpAcNgBbHX3JSnQ==} @@ -1235,6 +1244,126 @@ packages: resolution: {integrity: sha512-6fJ9MHWtK14C1DSkiMlHUSOmrVebL7150xZJBlJiL62jjhIA4JmOq6flwBgDxIdBKKdoiZRel+dfPD5MLfny3w==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript/typescript-aix-ppc64@7.0.2': + resolution: {integrity: sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==} + engines: {node: '>=16.20.0'} + cpu: [ppc64] + os: [aix] + + '@typescript/typescript-darwin-arm64@7.0.2': + resolution: {integrity: sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [darwin] + + '@typescript/typescript-darwin-x64@7.0.2': + resolution: {integrity: sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [darwin] + + '@typescript/typescript-freebsd-arm64@7.0.2': + resolution: {integrity: sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [freebsd] + + '@typescript/typescript-freebsd-x64@7.0.2': + resolution: {integrity: sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [freebsd] + + '@typescript/typescript-linux-arm64@7.0.2': + resolution: {integrity: sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [linux] + + '@typescript/typescript-linux-arm@7.0.2': + resolution: {integrity: sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==} + engines: {node: '>=16.20.0'} + cpu: [arm] + os: [linux] + + '@typescript/typescript-linux-loong64@7.0.2': + resolution: {integrity: sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==} + engines: {node: '>=16.20.0'} + cpu: [loong64] + os: [linux] + + '@typescript/typescript-linux-mips64el@7.0.2': + resolution: {integrity: sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==} + engines: {node: '>=16.20.0'} + cpu: [mips64el] + os: [linux] + + '@typescript/typescript-linux-ppc64@7.0.2': + resolution: {integrity: sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==} + engines: {node: '>=16.20.0'} + cpu: [ppc64] + os: [linux] + + '@typescript/typescript-linux-riscv64@7.0.2': + resolution: {integrity: sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==} + engines: {node: '>=16.20.0'} + cpu: [riscv64] + os: [linux] + + '@typescript/typescript-linux-s390x@7.0.2': + resolution: {integrity: sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==} + engines: {node: '>=16.20.0'} + cpu: [s390x] + os: [linux] + + '@typescript/typescript-linux-x64@7.0.2': + resolution: {integrity: sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [linux] + + '@typescript/typescript-netbsd-arm64@7.0.2': + resolution: {integrity: sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [netbsd] + + '@typescript/typescript-netbsd-x64@7.0.2': + resolution: {integrity: sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [netbsd] + + '@typescript/typescript-openbsd-arm64@7.0.2': + resolution: {integrity: sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [openbsd] + + '@typescript/typescript-openbsd-x64@7.0.2': + resolution: {integrity: sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [openbsd] + + '@typescript/typescript-sunos-x64@7.0.2': + resolution: {integrity: sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [sunos] + + '@typescript/typescript-win32-arm64@7.0.2': + resolution: {integrity: sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [win32] + + '@typescript/typescript-win32-x64@7.0.2': + resolution: {integrity: sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [win32] + '@ungap/structured-clone@1.3.0': resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==} deprecated: Potential CWE-502 - Update to 1.3.1 or higher @@ -3496,6 +3625,11 @@ packages: engines: {node: '>=14.17'} hasBin: true + typescript@7.0.2: + resolution: {integrity: sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==} + engines: {node: '>=16.20.0'} + hasBin: true + ufo@1.6.3: resolution: {integrity: sha512-yDJTmhydvl5lJzBmy/hyOAA0d+aqCBuwl818haVdYCRrWV84o7YyeVm4QlVHStqNrrJSTb6jKuFAVqAFsr+K3Q==} @@ -3511,6 +3645,9 @@ packages: undici-types@7.16.0: resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==} + undici-types@8.3.0: + resolution: {integrity: sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==} + undici@8.9.0: resolution: {integrity: sha512-aWZpUj7XoGonMClx4gdDRfgBjqeA+F473aDmROQQbM9n6PRfK/u1q/a0X4wMTgcHfT8H6fpbt98PFuDUwFg2YA==} engines: {node: '>=22.19.0'} @@ -4078,13 +4215,13 @@ snapshots: hast-util-from-html: 2.0.3 satteri: 0.9.5 - '@astrojs/mdx@7.0.3(@astrojs/markdown-satteri@0.3.4)(astro@7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@24.12.4)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0))': + '@astrojs/mdx@7.0.3(@astrojs/markdown-satteri@0.3.4)(astro@7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@26.1.2)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0))': dependencies: '@astrojs/internal-helpers': 0.10.1 '@astrojs/markdown-remark': 7.2.1 '@mdx-js/mdx': 3.1.1 acorn: 8.16.0 - astro: 7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@24.12.4)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0) + astro: 7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@26.1.2)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0) es-module-lexer: 2.1.0 estree-util-visit: 2.0.0 hast-util-to-html: 9.0.5 @@ -4110,17 +4247,17 @@ snapshots: stream-replace-string: 2.0.0 zod: 4.4.3 - '@astrojs/starlight@0.41.4(@astrojs/markdown-remark@7.2.1)(astro@7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@24.12.4)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0))(typescript@6.0.3)': + '@astrojs/starlight@0.41.4(@astrojs/markdown-remark@7.2.1)(astro@7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@26.1.2)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0))(typescript@6.0.3)': dependencies: '@astrojs/markdown-satteri': 0.3.4 - '@astrojs/mdx': 7.0.3(@astrojs/markdown-satteri@0.3.4)(astro@7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@24.12.4)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0)) + '@astrojs/mdx': 7.0.3(@astrojs/markdown-satteri@0.3.4)(astro@7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@26.1.2)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0)) '@astrojs/sitemap': 3.7.2 '@pagefind/default-ui': 1.4.0 '@types/hast': 3.0.4 '@types/js-yaml': 4.0.9 '@types/mdast': 4.0.4 - astro: 7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@24.12.4)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0) - astro-expressive-code: 0.44.1(astro@7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@24.12.4)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0)) + astro: 7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@26.1.2)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0) + astro-expressive-code: 0.44.1(astro@7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@26.1.2)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0)) bcp-47: 2.1.0 hast-util-from-html: 2.0.3 hast-util-select: 6.0.4 @@ -4881,7 +5018,7 @@ snapshots: '@types/concat-stream@2.0.3': dependencies: - '@types/node': 24.12.4 + '@types/node': 26.1.2 '@types/debug@4.1.12': dependencies: @@ -4940,11 +5077,15 @@ snapshots: dependencies: undici-types: 7.16.0 + '@types/node@26.1.2': + dependencies: + undici-types: 8.3.0 + '@types/picomatch@4.0.3': {} '@types/sax@1.2.7': dependencies: - '@types/node': 24.12.4 + '@types/node': 26.1.2 '@types/supports-color@8.1.3': {} @@ -5045,6 +5186,66 @@ snapshots: '@typescript-eslint/types': 8.61.1 eslint-visitor-keys: 5.0.1 + '@typescript/typescript-aix-ppc64@7.0.2': + optional: true + + '@typescript/typescript-darwin-arm64@7.0.2': + optional: true + + '@typescript/typescript-darwin-x64@7.0.2': + optional: true + + '@typescript/typescript-freebsd-arm64@7.0.2': + optional: true + + '@typescript/typescript-freebsd-x64@7.0.2': + optional: true + + '@typescript/typescript-linux-arm64@7.0.2': + optional: true + + '@typescript/typescript-linux-arm@7.0.2': + optional: true + + '@typescript/typescript-linux-loong64@7.0.2': + optional: true + + '@typescript/typescript-linux-mips64el@7.0.2': + optional: true + + '@typescript/typescript-linux-ppc64@7.0.2': + optional: true + + '@typescript/typescript-linux-riscv64@7.0.2': + optional: true + + '@typescript/typescript-linux-s390x@7.0.2': + optional: true + + '@typescript/typescript-linux-x64@7.0.2': + optional: true + + '@typescript/typescript-netbsd-arm64@7.0.2': + optional: true + + '@typescript/typescript-netbsd-x64@7.0.2': + optional: true + + '@typescript/typescript-openbsd-arm64@7.0.2': + optional: true + + '@typescript/typescript-openbsd-x64@7.0.2': + optional: true + + '@typescript/typescript-sunos-x64@7.0.2': + optional: true + + '@typescript/typescript-win32-arm64@7.0.2': + optional: true + + '@typescript/typescript-win32-x64@7.0.2': + optional: true + '@ungap/structured-clone@1.3.0': {} '@volar/kit@2.4.28(typescript@6.0.3)': @@ -5178,13 +5379,13 @@ snapshots: transitivePeerDependencies: - supports-color - astro-expressive-code@0.44.1(astro@7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@24.12.4)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0)): + astro-expressive-code@0.44.1(astro@7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@26.1.2)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0)): dependencies: - astro: 7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@24.12.4)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0) + astro: 7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@26.1.2)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0) rehype-expressive-code: 0.44.1 url-extras: 0.1.0 - astro@7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@24.12.4)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0): + astro@7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@26.1.2)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0): dependencies: '@astrojs/compiler-rs': 0.3.1(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1) '@astrojs/internal-helpers': 0.10.1 @@ -5234,8 +5435,8 @@ snapshots: ultrahtml: 1.6.0 unifont: 0.7.4 unstorage: 1.17.5 - vite: 8.1.5(@types/node@24.12.4)(esbuild@0.28.1)(tsx@4.22.4)(yaml@2.9.0) - vitefu: 1.1.2(vite@8.1.5(@types/node@24.12.4)(esbuild@0.28.1)(tsx@4.22.4)(yaml@2.9.0)) + vite: 8.1.5(@types/node@26.1.2)(esbuild@0.28.1)(tsx@4.22.4)(yaml@2.9.0) + vitefu: 1.1.2(vite@8.1.5(@types/node@26.1.2)(esbuild@0.28.1)(tsx@4.22.4)(yaml@2.9.0)) xxhash-wasm: 1.1.0 yargs-parser: 22.0.0 zod: 4.4.3 @@ -8165,11 +8366,11 @@ snapshots: spdx-license-ids@3.0.23: {} - starlight-links-validator@0.20.1(@astrojs/starlight@0.41.4(@astrojs/markdown-remark@7.2.1)(astro@7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@24.12.4)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0))(typescript@6.0.3))(astro@7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@24.12.4)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0)): + starlight-links-validator@0.20.1(@astrojs/starlight@0.41.4(@astrojs/markdown-remark@7.2.1)(astro@7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@26.1.2)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0))(typescript@6.0.3))(astro@7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@26.1.2)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0)): dependencies: - '@astrojs/starlight': 0.41.4(@astrojs/markdown-remark@7.2.1)(astro@7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@24.12.4)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0))(typescript@6.0.3) + '@astrojs/starlight': 0.41.4(@astrojs/markdown-remark@7.2.1)(astro@7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@26.1.2)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0))(typescript@6.0.3) '@types/picomatch': 4.0.3 - astro: 7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@24.12.4)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0) + astro: 7.1.3(@astrojs/markdown-remark@7.2.1)(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/node@26.1.2)(rollup@4.59.0)(tsx@4.22.4)(yaml@2.9.0) github-slugger: 2.0.0 hast-util-from-html: 2.0.3 hast-util-has-property: 3.0.0 @@ -8353,6 +8554,29 @@ snapshots: typescript@6.0.3: {} + typescript@7.0.2: + optionalDependencies: + '@typescript/typescript-aix-ppc64': 7.0.2 + '@typescript/typescript-darwin-arm64': 7.0.2 + '@typescript/typescript-darwin-x64': 7.0.2 + '@typescript/typescript-freebsd-arm64': 7.0.2 + '@typescript/typescript-freebsd-x64': 7.0.2 + '@typescript/typescript-linux-arm': 7.0.2 + '@typescript/typescript-linux-arm64': 7.0.2 + '@typescript/typescript-linux-loong64': 7.0.2 + '@typescript/typescript-linux-mips64el': 7.0.2 + '@typescript/typescript-linux-ppc64': 7.0.2 + '@typescript/typescript-linux-riscv64': 7.0.2 + '@typescript/typescript-linux-s390x': 7.0.2 + '@typescript/typescript-linux-x64': 7.0.2 + '@typescript/typescript-netbsd-arm64': 7.0.2 + '@typescript/typescript-netbsd-x64': 7.0.2 + '@typescript/typescript-openbsd-arm64': 7.0.2 + '@typescript/typescript-openbsd-x64': 7.0.2 + '@typescript/typescript-sunos-x64': 7.0.2 + '@typescript/typescript-win32-arm64': 7.0.2 + '@typescript/typescript-win32-x64': 7.0.2 + ufo@1.6.3: {} ultrahtml@1.6.0: {} @@ -8363,6 +8587,8 @@ snapshots: undici-types@7.16.0: {} + undici-types@8.3.0: {} + undici@8.9.0: {} unified-args@11.0.1: @@ -8620,7 +8846,7 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.3 - vite@8.1.5(@types/node@24.12.4)(esbuild@0.28.1)(tsx@4.22.4)(yaml@2.9.0): + vite@8.1.5(@types/node@26.1.2)(esbuild@0.28.1)(tsx@4.22.4)(yaml@2.9.0): dependencies: lightningcss: 1.33.0 picomatch: 4.0.5 @@ -8628,15 +8854,15 @@ snapshots: rolldown: 1.1.5 tinyglobby: 0.2.17 optionalDependencies: - '@types/node': 24.12.4 + '@types/node': 26.1.2 esbuild: 0.28.1 fsevents: 2.3.3 tsx: 4.22.4 yaml: 2.9.0 - vitefu@1.1.2(vite@8.1.5(@types/node@24.12.4)(esbuild@0.28.1)(tsx@4.22.4)(yaml@2.9.0)): + vitefu@1.1.2(vite@8.1.5(@types/node@26.1.2)(esbuild@0.28.1)(tsx@4.22.4)(yaml@2.9.0)): optionalDependencies: - vite: 8.1.5(@types/node@24.12.4)(esbuild@0.28.1)(tsx@4.22.4)(yaml@2.9.0) + vite: 8.1.5(@types/node@26.1.2)(esbuild@0.28.1)(tsx@4.22.4)(yaml@2.9.0) volar-service-css@0.0.70(@volar/language-service@2.4.28): dependencies: diff --git a/scripts/validate-regions.ts b/scripts/validate-regions.ts index d1128d0..1df61e0 100644 --- a/scripts/validate-regions.ts +++ b/scripts/validate-regions.ts @@ -1,10 +1,11 @@ import { readFileSync, readdirSync } from 'fs'; -import { join, relative } from 'path'; +import { basename, join, relative } from 'path'; import { fileURLToPath } from 'url'; const ROOT = fileURLToPath(new URL('..', import.meta.url)); const EXAMPLES_DIR = join(ROOT, 'examples'); const DOCS_DIR = join(ROOT, 'src', 'content', 'docs'); +const SKIP_DIRS = new Set(['build', '.gradle', 'node_modules', 'gradle']); const START_RE = /^\s*(?:\/\/|#|--|)?\s*\[(\w+)\]\s*$/; const END_RE = /^\s*(?:\/\/|#|--|)?\s*\[\/(\w+)\]\s*$/; @@ -15,6 +16,7 @@ const CODE_REGION_SOURCES_KEY_RE = /^codeRegionSources:\s*$/; const CODE_REGION_SOURCE_ENTRY_RE = /^\s+([\w-]+):\s*(.+?)\s*$/; const errors: string[] = []; +const extensions: Set = new Set(); function parseCodeRegionSources(content: string): Map { const sources = new Map(); @@ -35,9 +37,9 @@ function parseCodeRegionSources(content: string): Map { const m = line.match(CODE_REGION_SOURCE_ENTRY_RE); if (m) { sources.set(m[1]!, m[2]!); + extensions.add(m[2]!.split('.').at(-1)!); } } - return sources; } @@ -147,11 +149,18 @@ function validateSource(filePath: string) { } function walkExamples(dir: string) { + if (SKIP_DIRS.has(basename(dir))) { + return; + } for (const entry of readdirSync(dir, { withFileTypes: true })) { const full = join(dir, entry.name); if (entry.isDirectory()) { walkExamples(full); } else { + if (!extensions.has(full.split('.').at(-1)!)) { + // we only care about source files + continue; + } validateSource(full); } } diff --git a/src/content/docs/learning-course/stage0/operators.mdx b/src/content/docs/learning-course/stage0/operators.mdx index 56bc398..4ab9a5d 100644 --- a/src/content/docs/learning-course/stage0/operators.mdx +++ b/src/content/docs/learning-course/stage0/operators.mdx @@ -7,7 +7,7 @@ codeRegionSources: default: stage0/snippets/Operators.java --- -In Java, we use operators to change or compare the values of variables. +In Java, we use operators to change, or compare the values of variables. There four different types of operators are: - Arithmetic Operators diff --git a/src/content/docs/learning-course/stage1/stage1b/command-based-overview.mdx b/src/content/docs/learning-course/stage1/stage1b/command-based-overview.mdx index b527129..c47064a 100644 --- a/src/content/docs/learning-course/stage1/stage1b/command-based-overview.mdx +++ b/src/content/docs/learning-course/stage1/stage1b/command-based-overview.mdx @@ -15,8 +15,8 @@ set of instructions (execute this task, then this, and finally this). However, robots (and humans!) don't just execute a set of tasks and shut down. Imagine your daily routine. -When an alarm clock rings, you turn it off and tumble out of bed. -When your belly rumbles, you walk to the fridge and get a snack. +When an alarm clock rings, you turn it off, and tumble out of bed. +When your belly rumbles, you walk to the fridge, and get a snack. When the clock strikes 8 AM, you open the front door to leave for school. @@ -48,7 +48,7 @@ However, the structure of using `Command`s to represent behaviors misses an impo Think back to the human example: you’re walking to the fridge, but the clock hits 8 AM before you get there. You can't do both at once, since both actions require your arms and legs. -So, you stop and leave for school. +So, you stop, and leave for school. Next, the robot. If the X and Y buttons are held, the shooter and intake motors should both run. diff --git a/tsconfig.json b/tsconfig.json index bb51518..29d2c72 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,9 +3,11 @@ "include": [".astro/types.d.ts", "**/*"], "exclude": ["dist"], "compilerOptions": { + "lib": ["DOM", "ESNext"], "paths": { "@components/*": ["./src/components/*"] }, - "checkJs": true + "checkJs": true, + "incremental": true } }