-
-
Notifications
You must be signed in to change notification settings - Fork 13
refactor: extract shared files, move test files, prepare for lsp #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| .DS_Store | ||
| node_modules | ||
| dist | ||
| src/generated-meta.ts | ||
| shared/meta.ts | ||
|
|
||
| # local env files | ||
| .env.local | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,10 @@ | ||
| import type { ConfigKey } from '../generated-meta' | ||
| import type { ConfigKey } from './meta' | ||
|
|
||
| type StripPrefix<T, Prefix extends string> | ||
| = T extends `${Prefix}${infer Rest}` | ||
| ? Rest | ||
| : never | ||
|
|
||
| export type DiagnosticsCode = StripPrefix<ConfigKey, 'npmx.diagnostics.'> | ||
|
|
||
| export type PackageManager = 'npm' | 'pnpm' | 'yarn' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| import { NPMX_DEV } from '#constants' | ||
| import { NPMX_DEV } from '#shared/constants' | ||
|
|
||
| const SPACES = /\s+/g | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "extends": "./tsconfig.base.json", | ||
| "compilerOptions": { | ||
| "tsBuildInfoFile": "./node_modules/.tsbuildinfo/app", | ||
| "paths": { | ||
| "#shared/*": ["./shared/*"], | ||
| "#state": ["./src/state.ts"], | ||
| "#api/*": ["./src/api/*"], | ||
| "#types/*": ["./src/types/*"], | ||
| "#utils/*": ["./src/utils/*"], | ||
| "#core/*": ["./src/core/*"], | ||
| "#composables/*": ["./src/composables/*"], | ||
| "#test-utils/*": ["./tests/utils/*"] | ||
| } | ||
| }, | ||
| "include": [ | ||
| "src/**/*", | ||
| "shared", | ||
| "tests" | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "target": "ESNext", | ||
| "lib": ["ESNext"], | ||
| "module": "ESNext", | ||
| "moduleResolution": "Bundler", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# Locate relevant config files
TS_APP="$(fd -HI '^tsconfig\.app\.json$' | head -n1 || true)"
TS_DOWN="$(fd -HI '^tsdown\.config\.ts$' | head -n1 || true)"
VITEST="$(fd -HI '^vitest\.config\.ts$' | head -n1 || true)"
echo "tsconfig.app.json: ${TS_APP:-NOT FOUND}"
echo "tsdown.config.ts: ${TS_DOWN:-NOT FOUND}"
echo "vitest.config.ts: ${VITEST:-NOT FOUND}"
echo
# Show TS path aliases
if [[ -n "${TS_APP}" ]]; then
echo "=== paths in tsconfig.app.json ==="
rg -n -C2 '"paths"|#shared|#api|#types|#utils|#core|#composables|#test-utils' "$TS_APP"
echo
fi
# Show bundler resolver/alias settings
if [[ -n "${TS_DOWN}" ]]; then
echo "=== resolver settings in tsdown.config.ts ==="
rg -n -C3 'alias|resolve|tsconfig|paths|plugin' "$TS_DOWN"
echo
fi
# Confirm test-only alias support exists
if [[ -n "${VITEST}" ]]; then
echo "=== alias support in vitest.config.ts ==="
rg -n -C2 'vite-tsconfig-paths|plugins' "$VITEST"
fiRepository: npmx-dev/vscode-npmx Length of output: 1363 Add path alias mappings to tsdown.config.ts to match tsconfig.app.json Line 6 ( |
||
| "resolveJsonModule": true, | ||
| "types": ["node"], | ||
| "noFallthroughCasesInSwitch": true, | ||
| "noImplicitThis": true, | ||
| "noUncheckedIndexedAccess": true, | ||
| "noUnusedLocals": true, | ||
| "noUnusedParameters": true, | ||
| "noEmit": true, | ||
| "skipLibCheck": true | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,6 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "target": "ESNext", | ||
| "lib": ["ESNext"], | ||
| "module": "ESNext", | ||
| "moduleResolution": "Bundler", | ||
| "paths": { | ||
| "#constants": ["./src/constants.ts"], | ||
| "#state": ["./src/state.ts"], | ||
| "#types/*": ["./src/types/*"], | ||
| "#api/*": ["./src/api/*"], | ||
| "#utils/*": ["./src/utils/*"], | ||
| "#core/*": ["./src/core/*"], | ||
| "#composables/*": ["./src/composables/*"] | ||
| }, | ||
| "resolveJsonModule": true, | ||
| "strict": true, | ||
| "noFallthroughCasesInSwitch": true, | ||
| "noImplicitThis": true, | ||
| "noUnusedLocals": true, | ||
| "noEmit": true, | ||
| "skipLibCheck": true | ||
| } | ||
| "references": [ | ||
| { "path": "./tsconfig.app.json" } | ||
| ], | ||
| "files": [] | ||
|
9romise marked this conversation as resolved.
|
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.