@adonisjs/vite 0.0.1-0 → 0.0.1-10

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 (77) hide show
  1. package/build/configure.d.ts +3 -1
  2. package/build/configure.js +24 -10
  3. package/build/index.d.ts +1 -1
  4. package/build/index.js +9 -0
  5. package/build/providers/vite_provider.d.ts +14 -4
  6. package/build/providers/vite_provider.js +82 -36
  7. package/build/services/vite.d.ts +1 -2
  8. package/build/services/vite.js +12 -0
  9. package/build/src/backend/debug.d.ts +3 -0
  10. package/{src/backend/types/extended.ts → build/src/backend/debug.js} +2 -11
  11. package/build/src/backend/define_config.d.ts +5 -0
  12. package/build/src/backend/define_config.js +19 -0
  13. package/build/src/backend/edge_plugin_vite.d.ts +7 -0
  14. package/build/src/backend/edge_plugin_vite.js +86 -0
  15. package/build/src/backend/types/extended.d.ts +8 -1
  16. package/build/src/backend/types/extended.js +8 -0
  17. package/build/src/backend/types/main.d.ts +57 -1
  18. package/build/src/backend/types/main.js +8 -0
  19. package/build/src/backend/utils.d.ts +7 -1
  20. package/build/src/backend/utils.js +29 -0
  21. package/build/src/backend/vite.d.ts +33 -13
  22. package/build/src/backend/vite.js +206 -113
  23. package/build/src/{vite_plugin → client}/config.d.ts +7 -2
  24. package/build/src/{vite_plugin → client}/config.js +28 -2
  25. package/build/src/{vite_plugin → client}/config_resolver.d.ts +13 -2
  26. package/build/src/{vite_plugin → client}/config_resolver.js +22 -3
  27. package/build/src/{vite_plugin → client}/helpers/inertia.d.ts +3 -1
  28. package/build/src/{vite_plugin → client}/helpers/inertia.js +11 -0
  29. package/build/src/{vite_plugin → client}/hot_file.d.ts +6 -1
  30. package/build/src/{vite_plugin → client}/hot_file.js +21 -2
  31. package/build/src/client/main.d.ts +6 -0
  32. package/build/src/client/main.js +24 -0
  33. package/build/src/client/types.d.ts +35 -0
  34. package/build/src/client/types.js +9 -0
  35. package/build/src/{vite_plugin → client}/utils.d.ts +7 -2
  36. package/build/src/{vite_plugin → client}/utils.js +14 -0
  37. package/build/stubs/client_config.stub +22 -0
  38. package/build/stubs/config.stub +21 -0
  39. package/build/stubs/index.d.ts +0 -1
  40. package/build/stubs/index.js +2 -2
  41. package/build/stubs/js_entrypoint.stub +4 -0
  42. package/package.json +74 -81
  43. package/build/configure.d.ts.map +0 -1
  44. package/build/index.d.ts.map +0 -1
  45. package/build/providers/vite_provider.d.ts.map +0 -1
  46. package/build/services/vite.d.ts.map +0 -1
  47. package/build/src/backend/types/extended.d.ts.map +0 -1
  48. package/build/src/backend/types/main.d.ts.map +0 -1
  49. package/build/src/backend/utils.d.ts.map +0 -1
  50. package/build/src/backend/vite.d.ts.map +0 -1
  51. package/build/src/vite_plugin/config.d.ts.map +0 -1
  52. package/build/src/vite_plugin/config_resolver.d.ts.map +0 -1
  53. package/build/src/vite_plugin/helpers/inertia.d.ts.map +0 -1
  54. package/build/src/vite_plugin/hot_file.d.ts.map +0 -1
  55. package/build/src/vite_plugin/index.d.ts +0 -4
  56. package/build/src/vite_plugin/index.d.ts.map +0 -1
  57. package/build/src/vite_plugin/index.js +0 -16
  58. package/build/src/vite_plugin/types/index.d.ts +0 -10
  59. package/build/src/vite_plugin/types/index.d.ts.map +0 -1
  60. package/build/src/vite_plugin/types/index.js +0 -1
  61. package/build/src/vite_plugin/utils.d.ts.map +0 -1
  62. package/build/stubs/index.d.ts.map +0 -1
  63. package/build/stubs/vite/vite_config.stub +0 -14
  64. package/configure.ts +0 -30
  65. package/index.ts +0 -15
  66. package/providers/vite_provider.ts +0 -89
  67. package/services/vite.ts +0 -23
  68. package/src/backend/types/main.ts +0 -31
  69. package/src/backend/utils.ts +0 -19
  70. package/src/backend/vite.ts +0 -367
  71. package/src/vite_plugin/config.ts +0 -97
  72. package/src/vite_plugin/config_resolver.ts +0 -62
  73. package/src/vite_plugin/helpers/inertia.ts +0 -27
  74. package/src/vite_plugin/hot_file.ts +0 -59
  75. package/src/vite_plugin/index.ts +0 -38
  76. package/src/vite_plugin/types/index.ts +0 -56
  77. package/src/vite_plugin/utils.ts +0 -40
@@ -1,56 +0,0 @@
1
- /*
2
- * @adonisjs/vite
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
-
10
- /**
11
- * Possible plugin options
12
- */
13
- export type PluginOptions = {
14
- /**
15
- * Path to the hot file
16
- *
17
- * @default public/hot.json
18
- */
19
- hotFile?: string
20
-
21
- /**
22
- * Paths to the entrypoints files
23
- */
24
- entrypoints: string[]
25
-
26
- /**
27
- * Path to your AdonisJS public directory
28
- *
29
- * @default 'public'
30
- */
31
- publicDirectory?: string
32
-
33
- /**
34
- * The URL where the assets will be served. This is particularly
35
- * useful if you are using a CDN to deploy your assets.
36
- *
37
- * @default ''
38
- */
39
- assetsUrl?: string
40
-
41
- /**
42
- * Public subdirectory where the assets will be compiled.
43
- *
44
- * @default 'assets'
45
- */
46
- buildDirectory?: string
47
-
48
- /**
49
- * Files that should trigger a page reload when changed.
50
- *
51
- * @default ['./resources/views/** /*.edge']
52
- */
53
- reload?: string[]
54
- }
55
-
56
- export type PluginFullOptions = Required<PluginOptions>
@@ -1,40 +0,0 @@
1
- /*
2
- * @adonisjs/vite
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
-
10
- import { AddressInfo } from 'node:net'
11
- import { ResolvedConfig } from 'vite'
12
-
13
- /**
14
- * Resolve the dev server URL from the server address and configuration.
15
- */
16
- export const resolveDevServerUrl = (address: AddressInfo, config: ResolvedConfig) => {
17
- const configHmrProtocol =
18
- typeof config.server.hmr === 'object' ? config.server.hmr.protocol : null
19
-
20
- const clientProtocol = configHmrProtocol ? (configHmrProtocol === 'wss' ? 'https' : 'http') : null
21
- const serverProtocol = config.server.https ? 'https' : 'http'
22
- const protocol = clientProtocol ?? serverProtocol
23
-
24
- const configHmrHost = typeof config.server.hmr === 'object' ? config.server.hmr.host : null
25
- const configHost = typeof config.server.host === 'string' ? config.server.host : null
26
-
27
- let host = configHmrHost ?? configHost ?? address.address
28
- if (host === '::1') {
29
- host = 'localhost'
30
- }
31
-
32
- return `${protocol}://${host}:${address.port}`
33
- }
34
-
35
- /**
36
- * Add a trailing slash if missing
37
- */
38
- export const addTrailingSlash = (url: string) => {
39
- return url.endsWith('/') ? url : url + '/'
40
- }