@absolutejs/absolute 0.13.11 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/.claude/settings.local.json +7 -1
  2. package/CLAUDE.md +65 -56
  3. package/LICENSE +80 -24
  4. package/README.md +163 -163
  5. package/THIRD_PARTY_NOTICES.md +61 -0
  6. package/dist/cli/index.js +24 -8
  7. package/dist/index.js +3013 -480
  8. package/dist/index.js.map +56 -26
  9. package/dist/{build → src/build}/compileSvelte.d.ts +2 -1
  10. package/dist/src/build/compileVue.d.ts +33 -0
  11. package/dist/src/build/generateReactIndexes.d.ts +1 -0
  12. package/dist/src/build/htmlScriptHMRPlugin.d.ts +13 -0
  13. package/dist/src/build/wrapHTMLScript.d.ts +24 -0
  14. package/dist/src/core/build.d.ts +2 -0
  15. package/dist/src/core/devBuild.d.ts +6 -0
  16. package/dist/{core → src/core}/index.d.ts +2 -1
  17. package/dist/src/core/lookup.d.ts +3 -0
  18. package/dist/{core → src/core}/pageHandlers.d.ts +4 -4
  19. package/dist/src/dev/assetStore.d.ts +12 -0
  20. package/dist/src/dev/buildHMRClient.d.ts +1 -0
  21. package/dist/src/dev/clientManager.d.ts +26 -0
  22. package/dist/src/dev/configResolver.d.ts +13 -0
  23. package/dist/src/dev/dependencyGraph.d.ts +13 -0
  24. package/dist/src/dev/fileHashTracker.d.ts +2 -0
  25. package/dist/src/dev/fileWatcher.d.ts +3 -0
  26. package/dist/src/dev/moduleMapper.d.ts +21 -0
  27. package/dist/src/dev/moduleVersionTracker.d.ts +7 -0
  28. package/dist/src/dev/pathUtils.d.ts +5 -0
  29. package/dist/src/dev/reactComponentClassifier.d.ts +2 -0
  30. package/dist/src/dev/rebuildTrigger.d.ts +10 -0
  31. package/dist/src/dev/simpleHTMLHMR.d.ts +4 -0
  32. package/dist/src/dev/simpleHTMXHMR.d.ts +4 -0
  33. package/dist/src/dev/simpleSvelteHMR.d.ts +1 -0
  34. package/dist/src/dev/simpleVueHMR.d.ts +1 -0
  35. package/dist/src/dev/webSocket.d.ts +9 -0
  36. package/dist/{index.d.ts → src/index.d.ts} +1 -0
  37. package/dist/src/plugins/hmr.d.ts +62 -0
  38. package/dist/{plugins → src/plugins}/index.d.ts +2 -1
  39. package/dist/{plugins → src/plugins}/networking.d.ts +3 -0
  40. package/dist/{svelte → src/svelte}/renderToReadableStream.d.ts +3 -1
  41. package/dist/src/utils/getRegisterClientScript.d.ts +10 -0
  42. package/dist/{utils → src/utils}/index.d.ts +2 -0
  43. package/dist/src/utils/logger.d.ts +45 -0
  44. package/dist/src/utils/networking.d.ts +2 -0
  45. package/dist/src/utils/normalizePath.d.ts +9 -0
  46. package/dist/src/utils/registerClientScript.d.ts +51 -0
  47. package/dist/{types.d.ts → types/build.d.ts} +7 -0
  48. package/dist/types/client.d.ts +104 -0
  49. package/dist/types/index.d.ts +4 -0
  50. package/dist/types/messages.d.ts +138 -0
  51. package/dist/types/websocket.d.ts +6 -0
  52. package/eslint.config.mjs +238 -234
  53. package/package.json +17 -12
  54. package/tsconfig.build.json +20 -20
  55. package/types/build.ts +46 -0
  56. package/types/client.ts +109 -0
  57. package/types/index.ts +4 -0
  58. package/types/messages.ts +205 -0
  59. package/types/websocket.ts +12 -0
  60. package/types/window-globals.ts +53 -0
  61. package/dist/build/compileVue.d.ts +0 -5
  62. package/dist/build/generateReactIndexes.d.ts +0 -1
  63. package/dist/core/build.d.ts +0 -2
  64. package/dist/core/lookup.d.ts +0 -1
  65. package/dist/utils/networking.d.ts +0 -1
  66. /package/dist/{build → src/build}/generateManifest.d.ts +0 -0
  67. /package/dist/{build → src/build}/outputLogs.d.ts +0 -0
  68. /package/dist/{build → src/build}/scanEntryPoints.d.ts +0 -0
  69. /package/dist/{build → src/build}/updateAssetPaths.d.ts +0 -0
  70. /package/dist/{cli → src/cli}/index.d.ts +0 -0
  71. /package/dist/{constants.d.ts → src/constants.d.ts} +0 -0
  72. /package/dist/{plugins → src/plugins}/pageRouter.d.ts +0 -0
  73. /package/dist/{svelte → src/svelte}/renderToPipeableStream.d.ts +0 -0
  74. /package/dist/{svelte → src/svelte}/renderToString.d.ts +0 -0
  75. /package/dist/{utils → src/utils}/cleanup.d.ts +0 -0
  76. /package/dist/{utils → src/utils}/commonAncestor.d.ts +0 -0
  77. /package/dist/{utils → src/utils}/escapeScriptContent.d.ts +0 -0
  78. /package/dist/{utils → src/utils}/generateHeadElement.d.ts +0 -0
  79. /package/dist/{utils → src/utils}/getDurationString.d.ts +0 -0
  80. /package/dist/{utils → src/utils}/getEnv.d.ts +0 -0
  81. /package/dist/{utils → src/utils}/stringModifiers.d.ts +0 -0
  82. /package/dist/{utils → src/utils}/validateSafePath.d.ts +0 -0
package/eslint.config.mjs CHANGED
@@ -1,234 +1,238 @@
1
- // eslint.config.mjs
2
- import { dirname } from 'path';
3
- import { fileURLToPath } from 'url';
4
- import pluginJs from '@eslint/js';
5
- import stylisticTs from '@stylistic/eslint-plugin-ts';
6
- import tsParser from '@typescript-eslint/parser';
7
- import { defineConfig } from 'eslint/config';
8
- import absolutePlugin from 'eslint-plugin-absolute';
9
- import importPlugin from 'eslint-plugin-import';
10
- import promisePlugin from 'eslint-plugin-promise';
11
- import securityPlugin from 'eslint-plugin-security';
12
- import globals from 'globals';
13
- import tseslint from 'typescript-eslint';
14
-
15
- const __dirname = dirname(fileURLToPath(import.meta.url));
16
-
17
- export default defineConfig([
18
- {
19
- ignores: [
20
- 'dist/**',
21
- '**/compiled/**',
22
- '**/*/htmx.*.min.js',
23
- 'example/build/**',
24
- 'tailwind.config.ts',
25
- 'postcss.config.ts',
26
- 'example/react/indexes/*'
27
- ]
28
- },
29
-
30
- pluginJs.configs.recommended,
31
-
32
- ...tseslint.configs.recommended,
33
-
34
- {
35
- files: ['**/*.{ts,tsx}'],
36
- languageOptions: {
37
- globals: {
38
- // TODO: These should only be applied to the src/core/build.ts file.
39
- BuildMessage: 'readonly',
40
- ResolveMessage: 'readonly'
41
- },
42
- parser: tsParser,
43
- parserOptions: {
44
- createDefaultProgram: true,
45
- project: './tsconfig.json',
46
- tsconfigRootDir: __dirname
47
- }
48
- },
49
- plugins: { '@stylistic/ts': stylisticTs },
50
- rules: {
51
- '@stylistic/ts/padding-line-between-statements': [
52
- 'error',
53
- { blankLine: 'always', next: 'return', prev: '*' }
54
- ],
55
-
56
- '@typescript-eslint/no-unnecessary-type-assertion': 'error'
57
- }
58
- },
59
- {
60
- files: ['**/*.{js,mjs,cjs,json,ts,tsx,jsx}'],
61
- ignores: ['node_modules/**'],
62
- languageOptions: {
63
- globals: {
64
- ...globals.browser
65
- }
66
- },
67
- plugins: {
68
- absolute: absolutePlugin,
69
- import: importPlugin,
70
- promise: promisePlugin,
71
- security: securityPlugin
72
- },
73
- rules: {
74
- 'absolute/explicit-object-types': 'error',
75
- 'absolute/localize-react-props': 'error',
76
- 'absolute/max-depth-extended': ['error', 1],
77
- 'absolute/max-jsxnesting': ['error', 5],
78
- 'absolute/min-var-length': [
79
- 'error',
80
- { allowedVars: ['_', 'id', 'db', 'OK'], minLength: 3 }
81
- ],
82
- 'absolute/no-explicit-return-type': 'error',
83
- 'absolute/no-useless-function': 'error',
84
- 'absolute/sort-exports': [
85
- 'error',
86
- {
87
- caseSensitive: true,
88
- natural: true,
89
- order: 'asc',
90
- variablesBeforeFunctions: true
91
- }
92
- ],
93
- 'absolute/sort-keys-fixable': [
94
- 'error',
95
- {
96
- caseSensitive: true,
97
- natural: true,
98
- order: 'asc',
99
- variablesBeforeFunctions: true
100
- }
101
- ],
102
- 'arrow-body-style': ['error', 'as-needed'],
103
- 'consistent-return': 'error',
104
- eqeqeq: 'error',
105
- 'func-style': [
106
- 'error',
107
- 'expression',
108
- { allowArrowFunctions: true }
109
- ],
110
- 'import/no-cycle': 'error',
111
- 'import/no-default-export': 'error',
112
- 'import/no-relative-packages': 'error',
113
- 'import/no-unused-modules': ['error', { missingExports: true }],
114
- 'import/order': ['error', { alphabetize: { order: 'asc' } }],
115
- 'no-await-in-loop': 'error',
116
- 'no-debugger': 'error',
117
- 'no-duplicate-case': 'error',
118
- 'no-duplicate-imports': 'error',
119
- 'no-else-return': 'error',
120
- 'no-empty-function': 'error',
121
- 'no-empty-pattern': 'error',
122
- 'no-empty-static-block': 'error',
123
- 'no-fallthrough': 'error',
124
- 'no-floating-decimal': 'error',
125
- 'no-global-assign': 'error',
126
- 'no-implicit-coercion': 'error',
127
- 'no-implicit-globals': 'error',
128
- 'no-loop-func': 'error',
129
- 'no-magic-numbers': [
130
- 'warn',
131
- { detectObjects: false, enforceConst: true, ignore: [0, 1, 2] }
132
- ],
133
- 'no-misleading-character-class': 'error',
134
- 'no-nested-ternary': 'error',
135
- 'no-new-native-nonconstructor': 'error',
136
- 'no-new-wrappers': 'error',
137
- 'no-param-reassign': 'error',
138
- 'no-restricted-imports': [
139
- 'error',
140
- {
141
- paths: [
142
- {
143
- importNames: ['default'],
144
- message:
145
- 'Import only named React exports for tree-shaking.',
146
- name: 'react'
147
- },
148
- {
149
- importNames: ['default'],
150
- message: 'Import only the required Bun exports.',
151
- name: 'bun'
152
- }
153
- ]
154
- }
155
- ],
156
- 'no-return-await': 'error',
157
- 'no-shadow': 'error',
158
- 'no-undef': 'error',
159
- 'no-unneeded-ternary': 'error',
160
- 'no-unreachable': 'error',
161
- 'no-useless-assignment': 'error',
162
- 'no-useless-concat': 'error',
163
- 'no-useless-return': 'error',
164
- 'no-var': 'error',
165
- 'prefer-arrow-callback': 'error',
166
- 'prefer-const': 'error',
167
- 'prefer-destructuring': [
168
- 'error',
169
- { array: true, object: true },
170
- { enforceForRenamedProperties: false }
171
- ],
172
- 'prefer-template': 'error',
173
- 'promise/always-return': 'warn',
174
- 'promise/avoid-new': 'warn',
175
- 'promise/catch-or-return': 'error',
176
- 'promise/no-callback-in-promise': 'warn',
177
- 'promise/no-nesting': 'warn',
178
- 'promise/no-promise-in-callback': 'warn',
179
- 'promise/no-return-wrap': 'error',
180
- 'promise/param-names': 'error'
181
- }
182
- },
183
- {
184
- //TODO: Add official eslint support for Svelte.
185
- files: ['**/*.svelte.ts'],
186
- languageOptions: {
187
- globals: {
188
- $derived: 'readonly',
189
- $effect: 'readonly',
190
- $props: 'readonly',
191
- $state: 'readonly'
192
- }
193
- }
194
- },
195
- {
196
- files: ['eslint.config.mjs', 'src/constants.ts'],
197
- rules: {
198
- 'no-magic-numbers': 'off'
199
- }
200
- },
201
- {
202
- files: ['eslint.config.mjs'],
203
- rules: {
204
- 'import/no-default-export': 'off'
205
- }
206
- },
207
- {
208
- files: [
209
- 'src/utils/index.ts',
210
- 'src/plugins/index.ts',
211
- 'src/core/index.ts',
212
- 'src/index.ts',
213
- 'example/html/scripts/*',
214
- 'tsconfig.json',
215
- 'tsconfig.build.json',
216
- 'package.json',
217
- '.prettierrc.json'
218
- ],
219
- rules: {
220
- 'import/no-unused-modules': 'off'
221
- }
222
- },
223
- {
224
- files: [
225
- 'tsconfig.json',
226
- 'tsconfig.build.json',
227
- 'package.json',
228
- '.prettierrc.json'
229
- ],
230
- rules: {
231
- '@typescript-eslint/no-unused-expressions': 'off'
232
- }
233
- }
234
- ]);
1
+ // eslint.config.mjs
2
+ import { dirname } from 'path';
3
+ import { fileURLToPath } from 'url';
4
+ import pluginJs from '@eslint/js';
5
+ import stylisticTs from '@stylistic/eslint-plugin-ts';
6
+ import tsParser from '@typescript-eslint/parser';
7
+ import { defineConfig } from 'eslint/config';
8
+ import absolutePlugin from 'eslint-plugin-absolute';
9
+ import importPlugin from 'eslint-plugin-import';
10
+ import promisePlugin from 'eslint-plugin-promise';
11
+ import securityPlugin from 'eslint-plugin-security';
12
+ import globals from 'globals';
13
+ import tseslint from 'typescript-eslint';
14
+
15
+ const __dirname = dirname(fileURLToPath(import.meta.url));
16
+
17
+ export default defineConfig([
18
+ {
19
+ ignores: [
20
+ 'dist/**',
21
+ '**/compiled/**',
22
+ '**/*/htmx.*.min.js',
23
+ 'example/build/**',
24
+ 'tailwind.config.ts',
25
+ 'postcss.config.ts',
26
+ 'example/react/indexes/*'
27
+ ]
28
+ },
29
+
30
+ pluginJs.configs.recommended,
31
+
32
+ ...tseslint.configs.recommended,
33
+
34
+ {
35
+ files: ['**/*.{ts,tsx}'],
36
+ languageOptions: {
37
+ globals: {
38
+ ...globals.node,
39
+ // TODO: These should only be applied to the src/core/build.ts file.
40
+ BuildMessage: 'readonly',
41
+ ResolveMessage: 'readonly',
42
+ NodeJS: 'readonly',
43
+ Bun: 'readonly',
44
+ Buffer: 'readonly'
45
+ },
46
+ parser: tsParser,
47
+ parserOptions: {
48
+ createDefaultProgram: true,
49
+ project: './tsconfig.json',
50
+ tsconfigRootDir: __dirname
51
+ }
52
+ },
53
+ plugins: { '@stylistic/ts': stylisticTs },
54
+ rules: {
55
+ '@stylistic/ts/padding-line-between-statements': [
56
+ 'error',
57
+ { blankLine: 'always', next: 'return', prev: '*' }
58
+ ],
59
+
60
+ '@typescript-eslint/no-unnecessary-type-assertion': 'error'
61
+ }
62
+ },
63
+ {
64
+ files: ['**/*.{js,mjs,cjs,json,ts,tsx,jsx}'],
65
+ ignores: ['node_modules/**'],
66
+ languageOptions: {
67
+ globals: {
68
+ ...globals.browser
69
+ }
70
+ },
71
+ plugins: {
72
+ absolute: absolutePlugin,
73
+ import: importPlugin,
74
+ promise: promisePlugin,
75
+ security: securityPlugin
76
+ },
77
+ rules: {
78
+ 'absolute/explicit-object-types': 'error',
79
+ 'absolute/localize-react-props': 'error',
80
+ 'absolute/max-depth-extended': ['error', 1],
81
+ 'absolute/max-jsxnesting': ['error', 5],
82
+ 'absolute/min-var-length': [
83
+ 'error',
84
+ { allowedVars: ['_', 'id', 'db', 'OK'], minLength: 3 }
85
+ ],
86
+ 'absolute/no-explicit-return-type': 'error',
87
+ 'absolute/no-useless-function': 'error',
88
+ 'absolute/sort-exports': [
89
+ 'error',
90
+ {
91
+ caseSensitive: true,
92
+ natural: true,
93
+ order: 'asc',
94
+ variablesBeforeFunctions: true
95
+ }
96
+ ],
97
+ 'absolute/sort-keys-fixable': [
98
+ 'error',
99
+ {
100
+ caseSensitive: true,
101
+ natural: true,
102
+ order: 'asc',
103
+ variablesBeforeFunctions: true
104
+ }
105
+ ],
106
+ 'arrow-body-style': ['error', 'as-needed'],
107
+ 'consistent-return': 'error',
108
+ eqeqeq: 'error',
109
+ 'func-style': [
110
+ 'error',
111
+ 'expression',
112
+ { allowArrowFunctions: true }
113
+ ],
114
+ 'import/no-cycle': 'error',
115
+ 'import/no-default-export': 'error',
116
+ 'import/no-relative-packages': 'error',
117
+ 'import/no-unused-modules': ['error', { missingExports: true }],
118
+ 'import/order': ['error', { alphabetize: { order: 'asc' } }],
119
+ 'no-await-in-loop': 'error',
120
+ 'no-debugger': 'error',
121
+ 'no-duplicate-case': 'error',
122
+ 'no-duplicate-imports': 'error',
123
+ 'no-else-return': 'error',
124
+ 'no-empty-function': 'error',
125
+ 'no-empty-pattern': 'error',
126
+ 'no-empty-static-block': 'error',
127
+ 'no-fallthrough': 'error',
128
+ 'no-floating-decimal': 'error',
129
+ 'no-global-assign': 'error',
130
+ 'no-implicit-coercion': 'error',
131
+ 'no-implicit-globals': 'error',
132
+ 'no-loop-func': 'error',
133
+ 'no-magic-numbers': [
134
+ 'warn',
135
+ { detectObjects: false, enforceConst: true, ignore: [0, 1, 2] }
136
+ ],
137
+ 'no-misleading-character-class': 'error',
138
+ 'no-nested-ternary': 'error',
139
+ 'no-new-native-nonconstructor': 'error',
140
+ 'no-new-wrappers': 'error',
141
+ 'no-param-reassign': 'error',
142
+ 'no-restricted-imports': [
143
+ 'error',
144
+ {
145
+ paths: [
146
+ {
147
+ importNames: ['default'],
148
+ message:
149
+ 'Import only named React exports for tree-shaking.',
150
+ name: 'react'
151
+ },
152
+ {
153
+ importNames: ['default'],
154
+ message: 'Import only the required Bun exports.',
155
+ name: 'bun'
156
+ }
157
+ ]
158
+ }
159
+ ],
160
+ 'no-return-await': 'error',
161
+ 'no-shadow': 'error',
162
+ 'no-undef': 'error',
163
+ 'no-unneeded-ternary': 'error',
164
+ 'no-unreachable': 'error',
165
+ 'no-useless-assignment': 'error',
166
+ 'no-useless-concat': 'error',
167
+ 'no-useless-return': 'error',
168
+ 'no-var': 'error',
169
+ 'prefer-arrow-callback': 'error',
170
+ 'prefer-const': 'error',
171
+ 'prefer-destructuring': [
172
+ 'error',
173
+ { array: true, object: true },
174
+ { enforceForRenamedProperties: false }
175
+ ],
176
+ 'prefer-template': 'error',
177
+ 'promise/always-return': 'warn',
178
+ 'promise/avoid-new': 'warn',
179
+ 'promise/catch-or-return': 'error',
180
+ 'promise/no-callback-in-promise': 'warn',
181
+ 'promise/no-nesting': 'warn',
182
+ 'promise/no-promise-in-callback': 'warn',
183
+ 'promise/no-return-wrap': 'error',
184
+ 'promise/param-names': 'error'
185
+ }
186
+ },
187
+ {
188
+ //TODO: Add official eslint support for Svelte.
189
+ files: ['**/*.svelte.ts'],
190
+ languageOptions: {
191
+ globals: {
192
+ $derived: 'readonly',
193
+ $effect: 'readonly',
194
+ $props: 'readonly',
195
+ $state: 'readonly'
196
+ }
197
+ }
198
+ },
199
+ {
200
+ files: ['eslint.config.mjs', 'src/constants.ts'],
201
+ rules: {
202
+ 'no-magic-numbers': 'off'
203
+ }
204
+ },
205
+ {
206
+ files: ['eslint.config.mjs'],
207
+ rules: {
208
+ 'import/no-default-export': 'off'
209
+ }
210
+ },
211
+ {
212
+ files: [
213
+ 'src/utils/index.ts',
214
+ 'src/plugins/index.ts',
215
+ 'src/core/index.ts',
216
+ 'src/index.ts',
217
+ 'example/html/scripts/*',
218
+ 'tsconfig.json',
219
+ 'tsconfig.build.json',
220
+ 'package.json',
221
+ '.prettierrc.json'
222
+ ],
223
+ rules: {
224
+ 'import/no-unused-modules': 'off'
225
+ }
226
+ },
227
+ {
228
+ files: [
229
+ 'tsconfig.json',
230
+ 'tsconfig.build.json',
231
+ 'package.json',
232
+ '.prettierrc.json'
233
+ ],
234
+ rules: {
235
+ '@typescript-eslint/no-unused-expressions': 'off'
236
+ }
237
+ }
238
+ ]);
package/package.json CHANGED
@@ -4,15 +4,18 @@
4
4
  "absolutejs": "./dist/cli/index.js"
5
5
  },
6
6
  "description": "A fullstack meta-framework for building web applications with TypeScript",
7
+ "engines": {
8
+ "bun": ">=1.3.6"
9
+ },
7
10
  "devDependencies": {
8
- "@elysiajs/static": "1.3.0",
11
+ "@elysiajs/static": "1.4.0",
9
12
  "@stylistic/eslint-plugin-ts": "4.2.0",
10
13
  "@tailwindcss/cli": "4.1.7",
11
- "@types/bun": "latest",
12
- "@types/react": "19.1.5",
13
- "@types/react-dom": "19.1.5",
14
+ "@types/bun": "^1.2.18",
15
+ "@types/react": "19.2.0",
16
+ "@types/react-dom": "19.2.0",
14
17
  "autoprefixer": "10.4.21",
15
- "elysia": "1.3.1",
18
+ "elysia": "1.4.18",
16
19
  "elysia-scoped-state": "0.1.1",
17
20
  "eslint": "9.26.0",
18
21
  "eslint-plugin-absolute": "0.1.4",
@@ -22,20 +25,21 @@
22
25
  "postcss": "8.5.3",
23
26
  "prettier": "3.5.3",
24
27
  "prettier-plugin-svelte": "3.4.0",
25
- "react": "19.1.0",
28
+ "react": "19.2.1",
29
+ "react-dom": "19.2.1",
30
+ "react-refresh": "^0.18.0",
26
31
  "svelte": "5.35.2",
27
32
  "tailwindcss": "4.1.7",
28
33
  "typescript": "5.8.3",
29
34
  "typescript-eslint": "8.32.0",
30
35
  "vue": "3.5.27"
31
36
  },
32
- "license": "CC BY-NC 4.0",
37
+ "license": "BSL-1.1",
33
38
  "main": "./dist/index.js",
34
39
  "name": "@absolutejs/absolute",
35
40
  "peerDependencies": {
36
- "elysia": "^1.3.0",
41
+ "elysia": "^1.4.0",
37
42
  "react": "^19.1.0",
38
- "react-dom": "^19.1.0",
39
43
  "svelte": "^5.35.2",
40
44
  "vue": "^3.5.27"
41
45
  },
@@ -47,13 +51,14 @@
47
51
  "build": "rm -rf dist && bun build src/index.ts --outdir dist --sourcemap --target=bun --external react --external react-dom --external vue --external @vue/compiler-sfc --external svelte --external elysia && bun build src/cli/index.ts --outfile dist/cli/index.js --target=bun && tsc --emitDeclarationOnly --project tsconfig.build.json",
48
52
  "db:push": "drizzle-kit push",
49
53
  "db:studio": "drizzle-kit studio",
50
- "dev": "bun src/cli/index.ts dev example/server.ts",
54
+ "dev": "bun run src/cli/index.ts dev example/server.ts",
55
+ "start": "NODE_ENV=production bun run example/server.ts",
51
56
  "format": "prettier --write \"./**/*.{js,jsx,ts,tsx,css,json,mjs,md,svelte,html,vue}\"",
52
57
  "lint": "eslint ./",
53
58
  "release": "bun run format && bun run build && bun publish",
54
- "test": "echo \"Error: no test specified\" && exit 1",
59
+ "test": "bun test",
55
60
  "typecheck": "bun run tsc --noEmit"
56
61
  },
57
62
  "types": "./dist/index.d.ts",
58
- "version": "0.13.11"
63
+ "version": "0.15.0"
59
64
  }
@@ -1,20 +1,20 @@
1
- {
2
- "compilerOptions": {
3
- "allowJs": true,
4
- "declaration": true,
5
- "esModuleInterop": true,
6
- "forceConsistentCasingInFileNames": true,
7
- "jsx": "react-jsx",
8
- "lib": ["DOM", "DOM.Iterable", "ESNext"],
9
- "module": "ESNext",
10
- "moduleResolution": "bundler",
11
- "noImplicitAny": true,
12
- "noUncheckedIndexedAccess": true,
13
- "outDir": "dist",
14
- "skipLibCheck": true,
15
- "strict": true,
16
- "target": "ESNext"
17
- },
18
- "exclude": ["node_modules"],
19
- "include": ["src/**/*"]
20
- }
1
+ {
2
+ "compilerOptions": {
3
+ "allowJs": true,
4
+ "declaration": true,
5
+ "esModuleInterop": true,
6
+ "forceConsistentCasingInFileNames": true,
7
+ "jsx": "react-jsx",
8
+ "lib": ["DOM", "DOM.Iterable", "ESNext"],
9
+ "module": "ESNext",
10
+ "moduleResolution": "bundler",
11
+ "noImplicitAny": true,
12
+ "noUncheckedIndexedAccess": true,
13
+ "outDir": "dist",
14
+ "skipLibCheck": true,
15
+ "strict": true,
16
+ "target": "ESNext"
17
+ },
18
+ "exclude": ["node_modules", "src/dev/client"],
19
+ "include": ["src/**/*"]
20
+ }
package/types/build.ts ADDED
@@ -0,0 +1,46 @@
1
+ import { ComponentType as ReactComponent } from 'react';
2
+ import { Component as SvelteComponent } from 'svelte';
3
+ import { Component as VueComponent } from 'vue';
4
+
5
+ export type BuildOptions = {
6
+ preserveIntermediateFiles?: boolean;
7
+ /** When true, build() throws on error instead of exit(1) - used by HMR rebuilds */
8
+ throwOnError?: boolean;
9
+ hmr?: {
10
+ debounceMs?: number;
11
+ };
12
+ };
13
+
14
+ export type BuildConfig = {
15
+ buildDirectory?: string;
16
+ assetsDirectory?: string;
17
+ publicDirectory?: string;
18
+ reactDirectory?: string;
19
+ vueDirectory?: string;
20
+ angularDirectory?: string;
21
+ astroDirectory?: string;
22
+ svelteDirectory?: string;
23
+ htmlDirectory?: string;
24
+ htmxDirectory?: string;
25
+ tailwind?: {
26
+ input: string;
27
+ output: string;
28
+ };
29
+ options?: BuildOptions;
30
+ // Optional: List of files to rebuild incrementally (absolute paths)
31
+ // When provided, only these files and their dependencies will be rebuilt
32
+ incrementalFiles?: string[];
33
+ };
34
+
35
+ export type PropsOf<Component> =
36
+ Component extends ReactComponent<infer Props>
37
+ ? Props
38
+ : Component extends SvelteComponent<infer Props>
39
+ ? Props
40
+ : Component extends VueComponent<infer Props>
41
+ ? Props
42
+ : Record<string, never>;
43
+
44
+ export type PropsArgs<C> = keyof PropsOf<C> extends never ? [] : [PropsOf<C>];
45
+
46
+ export type Prettify<T> = { [K in keyof T]: T[K] } & {};