chore(desktop): build config — keep tsc emit out of src, gitignore artifacts

This commit is contained in:
Brooklyn Nicholson 2026-07-13 17:28:32 -04:00
parent a57b33782e
commit d14bf23fa3
4 changed files with 32 additions and 0 deletions

11
.gitignore vendored
View file

@ -68,6 +68,17 @@ environments/benchmarks/evals/
hermes_cli/web_dist/
apps/desktop/build/
apps/desktop/dist/
# tsc-emitted artifacts (a stray `tsc -b` compiles into src/, and vite then
# resolves the stale .js OVER the .tsx — never track these)
apps/desktop/src/**/*.js
apps/desktop/src/**/*.js.map
apps/desktop/src/**/*.d.ts
!apps/desktop/src/global.d.ts
!apps/desktop/src/vite-env.d.ts
apps/shared/src/**/*.js
apps/shared/src/**/*.js.map
apps/shared/src/**/*.d.ts
apps/desktop/release/
*.tsbuildinfo

View file

@ -104,6 +104,25 @@ export default [
react: { version: 'detect' }
}
},
{
// THE PLUGIN FENCE: plugins speak @hermes/plugin-sdk (+ react), never `@/…`
// internals — the same isolation a runtime-fetched published plugin gets,
// enforced on bundled ones so the SDK surface stays honest and sufficient.
files: ['src/plugins/**/*.{ts,tsx}'],
rules: {
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['@/*', '../*', '@hermes/shared'],
message: 'Plugins import only @hermes/plugin-sdk (and react). Missing something? Add it to the SDK.'
}
]
}
]
}
},
{
files: ['**/*.js', '**/*.cjs', '**/*.mjs'],
ignores: ['**/node_modules/**', '**/dist/**'],

View file

@ -17,6 +17,7 @@
"jsx": "react-jsx",
"paths": {
"@/*": ["./src/*"],
"@hermes/plugin-sdk": ["./src/sdk/index.ts"],
"@hermes/shared": ["../shared/src/index.ts"]
}
},

View file

@ -58,6 +58,7 @@ export default defineConfig({
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@hermes/plugin-sdk': path.resolve(__dirname, './src/sdk/index.ts'),
'@hermes/shared': path.resolve(__dirname, '../shared/src'),
react: path.resolve(__dirname, '../../node_modules/react'),
'react-dom': path.resolve(__dirname, '../../node_modules/react-dom'),