@ogygia/compiler 0.0.0 → 0.14.1

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 (160) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +62 -1
  3. package/dist/_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/taggedTemplateLiteral.js +5 -0
  4. package/dist/app-spec.d.ts +18 -0
  5. package/dist/app-spec.js +22 -0
  6. package/dist/blank-styles.d.ts +1 -0
  7. package/dist/blank-styles.js +24 -0
  8. package/dist/bom.d.ts +2 -0
  9. package/dist/bom.js +7 -0
  10. package/dist/build-cache.d.ts +13 -0
  11. package/dist/build-cache.js +65 -0
  12. package/dist/ctx.d.ts +238 -0
  13. package/dist/ctx.js +221 -0
  14. package/dist/dev/css-scope.d.ts +16 -0
  15. package/dist/dev/css-scope.js +32 -0
  16. package/dist/dev/dev-hmr.d.ts +24 -0
  17. package/dist/dev/dev-hmr.js +51 -0
  18. package/dist/dev/hmr.d.ts +34 -0
  19. package/dist/dev/hmr.js +52 -0
  20. package/dist/driver.d.ts +351 -0
  21. package/dist/driver.js +1402 -0
  22. package/dist/exports/index.d.ts +77 -0
  23. package/dist/exports/index.js +349 -0
  24. package/dist/exports/parse.d.ts +65 -0
  25. package/dist/exports/parse.js +251 -0
  26. package/dist/fouc-css.d.ts +112 -0
  27. package/dist/fouc-css.js +314 -0
  28. package/dist/free-vars.d.ts +32 -0
  29. package/dist/free-vars.js +454 -0
  30. package/dist/fs.d.ts +31 -0
  31. package/dist/fs.js +82 -0
  32. package/dist/ids.d.ts +49 -0
  33. package/dist/ids.js +52 -0
  34. package/dist/index.d.ts +23 -0
  35. package/dist/index.js +23 -0
  36. package/dist/kit.d.ts +204 -0
  37. package/dist/kit.js +554 -0
  38. package/dist/leg.d.ts +34 -0
  39. package/dist/leg.js +26 -0
  40. package/dist/link/analyses.d.ts +26 -0
  41. package/dist/link/analyses.js +237 -0
  42. package/dist/link/build-output.d.ts +47 -0
  43. package/dist/link/build-output.js +168 -0
  44. package/dist/link/caps.d.ts +32 -0
  45. package/dist/link/caps.js +39 -0
  46. package/dist/link/context-detect.d.ts +28 -0
  47. package/dist/link/context-detect.js +143 -0
  48. package/dist/link/emit-gate.d.ts +43 -0
  49. package/dist/link/emit-gate.js +55 -0
  50. package/dist/link/file-token.d.ts +11 -0
  51. package/dist/link/file-token.js +15 -0
  52. package/dist/link/island-deps.d.ts +183 -0
  53. package/dist/link/island-deps.js +802 -0
  54. package/dist/link/location-map.d.ts +24 -0
  55. package/dist/link/location-map.js +51 -0
  56. package/dist/link/own-reach.d.ts +15 -0
  57. package/dist/link/own-reach.js +188 -0
  58. package/dist/link/registry-stub.d.ts +50 -0
  59. package/dist/link/registry-stub.js +163 -0
  60. package/dist/link/relocations.d.ts +79 -0
  61. package/dist/link/relocations.js +204 -0
  62. package/dist/link/router-css.d.ts +38 -0
  63. package/dist/link/router-css.js +124 -0
  64. package/dist/link/runtime-entry.d.ts +103 -0
  65. package/dist/link/runtime-entry.js +183 -0
  66. package/dist/link/server-manifest.d.ts +25 -0
  67. package/dist/link/server-manifest.js +102 -0
  68. package/dist/link/transport.d.ts +42 -0
  69. package/dist/link/transport.js +91 -0
  70. package/dist/macros/dollar.d.ts +24 -0
  71. package/dist/macros/dollar.js +397 -0
  72. package/dist/macros/pipeline.d.ts +50 -0
  73. package/dist/macros/pipeline.js +133 -0
  74. package/dist/macros/source.d.ts +9 -0
  75. package/dist/macros/source.js +115 -0
  76. package/dist/macros/store.d.ts +22 -0
  77. package/dist/macros/store.js +217 -0
  78. package/dist/macros/wire.d.ts +17 -0
  79. package/dist/macros/wire.js +116 -0
  80. package/dist/map-chain.d.ts +18 -0
  81. package/dist/map-chain.js +42 -0
  82. package/dist/messages.d.ts +673 -0
  83. package/dist/messages.js +938 -0
  84. package/dist/ownership-stamps.d.ts +11 -0
  85. package/dist/ownership-stamps.js +112 -0
  86. package/dist/parse/oxc.d.ts +36 -0
  87. package/dist/parse/oxc.js +35 -0
  88. package/dist/parse/roots.d.ts +4 -0
  89. package/dist/parse/roots.js +27 -0
  90. package/dist/parse/scan.d.ts +65 -0
  91. package/dist/parse/scan.js +297 -0
  92. package/dist/parse/svelte-ast.d.ts +7 -0
  93. package/dist/parse/svelte-ast.js +99 -0
  94. package/dist/program.d.ts +140 -0
  95. package/dist/program.js +304 -0
  96. package/dist/queries.d.ts +105 -0
  97. package/dist/queries.js +326 -0
  98. package/dist/region/emit.d.ts +168 -0
  99. package/dist/region/emit.js +292 -0
  100. package/dist/region/identity.d.ts +32 -0
  101. package/dist/region/identity.js +46 -0
  102. package/dist/region/ir.d.ts +56 -0
  103. package/dist/region/ir.js +0 -0
  104. package/dist/region/marked-imports.d.ts +27 -0
  105. package/dist/region/marked-imports.js +265 -0
  106. package/dist/region/transform.d.ts +189 -0
  107. package/dist/region/transform.js +1565 -0
  108. package/dist/scan-facts.d.ts +36 -0
  109. package/dist/scan-facts.js +54 -0
  110. package/dist/script-request.d.ts +1 -0
  111. package/dist/script-request.js +33 -0
  112. package/dist/splice.d.ts +11 -0
  113. package/dist/splice.js +33 -0
  114. package/dist/transportables.d.ts +23 -0
  115. package/dist/transportables.js +144 -0
  116. package/dist/virtual/core.d.ts +158 -0
  117. package/dist/virtual/core.js +588 -0
  118. package/dist/virtual/resolver.d.ts +62 -0
  119. package/dist/virtual/resolver.js +265 -0
  120. package/dist/virtual/specifier.d.ts +10 -0
  121. package/dist/virtual/specifier.js +6 -0
  122. package/dist/virtual/table.d.ts +120 -0
  123. package/dist/virtual/table.js +54 -0
  124. package/dist/virtual/types.d.ts +17 -0
  125. package/dist/virtual/types.js +100 -0
  126. package/dist/virtual/value-names.d.ts +2 -0
  127. package/dist/virtual/value-names.js +18 -0
  128. package/dist/vite/definers.d.ts +16 -0
  129. package/dist/vite/definers.js +69 -0
  130. package/dist/vite/dev-maps.d.ts +34 -0
  131. package/dist/vite/dev-maps.js +91 -0
  132. package/dist/vite/index.d.ts +21 -0
  133. package/dist/vite/index.js +890 -0
  134. package/dist/vite/kit-dirs.d.ts +6 -0
  135. package/dist/vite/kit-dirs.js +53 -0
  136. package/dist/vite/late-island.d.ts +8 -0
  137. package/dist/vite/late-island.js +18 -0
  138. package/dist/vite/lazy-files.d.ts +2 -0
  139. package/dist/vite/lazy-files.js +72 -0
  140. package/dist/vite/options.d.ts +195 -0
  141. package/dist/vite/options.js +72 -0
  142. package/dist/vite/package-files.d.ts +3 -0
  143. package/dist/vite/package-files.js +88 -0
  144. package/dist/vite/paths.d.ts +16 -0
  145. package/dist/vite/paths.js +39 -0
  146. package/dist/vite/plugin-api.d.ts +316 -0
  147. package/dist/vite/plugin-api.js +328 -0
  148. package/dist/vite/route-watch.d.ts +15 -0
  149. package/dist/vite/route-watch.js +32 -0
  150. package/dist/vite/session.d.ts +28 -0
  151. package/dist/vite/session.js +43 -0
  152. package/dist/vite/sourcemaps.d.ts +19 -0
  153. package/dist/vite/sourcemaps.js +75 -0
  154. package/dist/vite/style-preprocess.d.ts +2 -0
  155. package/dist/vite/style-preprocess.js +84 -0
  156. package/dist/vite/svelte-entries.d.ts +4 -0
  157. package/dist/vite/svelte-entries.js +10 -0
  158. package/dist/vite/svelte-options.d.ts +20 -0
  159. package/dist/vite/svelte-options.js +22 -0
  160. package/package.json +87 -12
@@ -0,0 +1,32 @@
1
+ /**
2
+ * DEV: what each watched file event changed in the route answers, read when the event comes and
3
+ * once more after the watcher's quiet window, while `owner` is open. A save that truncates the file
4
+ * and then writes it is reported at the truncate, so its first read can be a write in progress.
5
+ * When the second read finds a change, the event the watcher dropped is `replay`ed, so the dev
6
+ * server updates what it ran from the file as it does for any event.
7
+ */
8
+ var RouteWatch = class {
9
+ #owner;
10
+ #changed;
11
+ #invalidate;
12
+ #replay;
13
+ constructor(owner, changed, invalidate, replay) {
14
+ this.#owner = owner;
15
+ this.#changed = changed;
16
+ this.#invalidate = invalidate;
17
+ this.#replay = replay;
18
+ }
19
+ /** The watcher reported `event` at `file`. */
20
+ heard(file, event) {
21
+ this.#read(file, event);
22
+ if (event !== "delete") this.#owner.timeout(() => {
23
+ if (this.#read(file, "update")) this.#replay(file);
24
+ }, 100);
25
+ }
26
+ #read(file, event) {
27
+ const ids = this.#changed(file, event);
28
+ for (const id of ids) this.#invalidate(id);
29
+ return ids.length > 0;
30
+ }
31
+ };
32
+ export { RouteWatch };
@@ -0,0 +1,28 @@
1
+ import { Compiler } from "../driver.js";
2
+ import { Machine } from "@ogygia/machine";
3
+ type SessionStates = {
4
+ created: {};
5
+ configured: {};
6
+ resolved: {
7
+ compiler: Compiler;
8
+ };
9
+ };
10
+ declare const SESSION_STEPS: {
11
+ readonly created: readonly ["configured", "resolved"];
12
+ readonly configured: readonly ["configured", "resolved"];
13
+ readonly resolved: readonly ["configured", "resolved"];
14
+ };
15
+ export type Session = Machine<SessionStates, typeof SESSION_STEPS>;
16
+ export declare function new_session(): Session;
17
+ /** The `config` hook ran (again). */
18
+ export declare function configured(session: Session): void;
19
+ /**
20
+ * The bundler resolved the build: the session's compiler, made with that build's context. `prev` is
21
+ * the compiler a resolve with no `config` since made (a plugin shared across a builder's
22
+ * environments): the new one keeps its build (`Compiler.with_ctx`), else the next leg would start
23
+ * from nothing.
24
+ */
25
+ export declare function resolve(session: Session, make: (prev: Compiler | null) => Compiler): Compiler;
26
+ /** The session's compiler, for `hook`: refused before the build is resolved. */
27
+ export declare function compiler_of(session: Session, hook: string): Compiler;
28
+ export {};
@@ -0,0 +1,43 @@
1
+ import { OgygiaError } from "../messages.js";
2
+ import { machine } from "@ogygia/machine";
3
+ const SESSION = machine()({
4
+ name: "plugin session",
5
+ initial: "created",
6
+ steps: {
7
+ created: ["configured", "resolved"],
8
+ configured: ["configured", "resolved"],
9
+ resolved: ["configured", "resolved"]
10
+ }
11
+ });
12
+ function new_session() {
13
+ return SESSION.create();
14
+ }
15
+ /** The `config` hook ran (again). */
16
+ function configured(session) {
17
+ session.go("configured");
18
+ }
19
+ /**
20
+ * The bundler resolved the build: the session's compiler, made with that build's context. `prev` is
21
+ * the compiler a resolve with no `config` since made (a plugin shared across a builder's
22
+ * environments): the new one keeps its build (`Compiler.with_ctx`), else the next leg would start
23
+ * from nothing.
24
+ */
25
+ function resolve(session, make) {
26
+ const now = session.now;
27
+ const compiler = make(now.kind === "resolved" ? now.compiler : null);
28
+ session.go("resolved", { compiler });
29
+ return compiler;
30
+ }
31
+ /** The session's compiler, for `hook`: refused before the build is resolved. */
32
+ function compiler_of(session, hook) {
33
+ const now = session.now;
34
+ if (now.kind !== "resolved") refuse(session, hook);
35
+ return now.compiler;
36
+ }
37
+ function refuse(session, hook) {
38
+ throw new OgygiaError("plugin_session_order", {
39
+ hook,
40
+ state: session.now.kind
41
+ });
42
+ }
43
+ export { compiler_of, configured, new_session, resolve };
@@ -0,0 +1,19 @@
1
+ import { Program } from "../program.js";
2
+ import { Plugin } from "vite";
3
+ /**
4
+ * Rewrite vite-plugin-svelte island sourcemap `sources` so Vite treats them as virtual.
5
+ *
6
+ * Svelte emits the basename of `ogygia:region/entry/<id>.svelte` (just `<id>.svelte`).
7
+ * That string does not match Vite's `virtualSourceRE`, so `injectSourcesContent` tries a
8
+ * disk read and warns "points to missing source files". Pointing sources back at the
9
+ * full virtual module id silences the warning (and keeps maps coherent).
10
+ *
11
+ * @internal Also covered by unit tests.
12
+ */
13
+ export declare function rewrite_island_sourcemap_sources(moduleId: string, sources: (string | null)[] | undefined): (string | null)[] | null;
14
+ /** The `ogygia:island-sourcemaps` post plugin (Vite flattens it into the adapter's array). */
15
+ export declare function island_sourcemaps_plugin(deps: {
16
+ /** The build under way's program. */
17
+ program: () => Program;
18
+ is_island_path: (id: string) => boolean;
19
+ }): Plugin;
@@ -0,0 +1,75 @@
1
+ import { strip_id } from "../program.js";
2
+ import { is_generated_specifier } from "../virtual/table.js";
3
+ import path from "node:path";
4
+ // src/vite/sourcemaps.ts
5
+ /**
6
+ * Rewrite vite-plugin-svelte island sourcemap `sources` so Vite treats them as virtual.
7
+ *
8
+ * Svelte emits the basename of `ogygia:region/entry/<id>.svelte` (just `<id>.svelte`).
9
+ * That string does not match Vite's `virtualSourceRE`, so `injectSourcesContent` tries a
10
+ * disk read and warns "points to missing source files". Pointing sources back at the
11
+ * full virtual module id silences the warning (and keeps maps coherent).
12
+ *
13
+ * @internal Also covered by unit tests.
14
+ */
15
+ function rewrite_island_sourcemap_sources(moduleId, sources) {
16
+ if (!sources?.length) return null;
17
+ let changed = false;
18
+ const next = sources.map((s) => {
19
+ if (typeof s !== "string") return s;
20
+ if (s === moduleId || is_generated_specifier(s) || s.includes("\0")) return s;
21
+ if (s.endsWith(".svelte") && !s.includes("/") && !path.isAbsolute(s)) {
22
+ changed = true;
23
+ return moduleId;
24
+ }
25
+ return s;
26
+ });
27
+ return changed ? next : null;
28
+ }
29
+ /** The `ogygia:island-sourcemaps` post plugin (Vite flattens it into the adapter's array). */
30
+ function island_sourcemaps_plugin(deps) {
31
+ const { program, is_island_path } = deps;
32
+ return {
33
+ name: "ogygia:island-sourcemaps",
34
+ enforce: "post",
35
+ transform(code, id) {
36
+ const bare = strip_id(id);
37
+ if (!is_island_path(bare)) return null;
38
+ if (bare.includes("/wrapper/")) return {
39
+ code,
40
+ map: { mappings: "" }
41
+ };
42
+ let map;
43
+ try {
44
+ map = this.getCombinedSourcemap();
45
+ } catch {
46
+ return null;
47
+ }
48
+ if (!map?.mappings || !map.sources?.length) return null;
49
+ const rewritten = rewrite_island_sourcemap_sources(bare, map.sources);
50
+ const sources = rewritten ?? map.sources;
51
+ const entry = program().registry.get(bare);
52
+ const base_name = bare.slice(bare.lastIndexOf("/") + 1);
53
+ let injected = false;
54
+ const sourcesContent = sources.map((s, i) => {
55
+ const prev = Array.isArray(map.sourcesContent) ? map.sourcesContent[i] : null;
56
+ if (prev != null) return prev;
57
+ if (entry && (s === bare || s === base_name)) {
58
+ injected = true;
59
+ return entry.source;
60
+ }
61
+ return null;
62
+ });
63
+ if (!rewritten && !injected) return null;
64
+ return {
65
+ code,
66
+ map: {
67
+ ...map,
68
+ sources,
69
+ sourcesContent
70
+ }
71
+ };
72
+ }
73
+ };
74
+ }
75
+ export { island_sourcemaps_plugin, rewrite_island_sourcemap_sources };
@@ -0,0 +1,2 @@
1
+ /** `source` with `<style lang="scss|sass">` compiled to CSS and `<script lang="ts">` stripped of TS. */
2
+ export declare function preprocess_component_for_css(source: string, abs: string, root: string): Promise<string>;
@@ -0,0 +1,84 @@
1
+ import { warn } from "../messages.js";
2
+ import { component_blocks } from "../parse/scan.js";
3
+ import path from "node:path";
4
+ import { attr_spans } from "@ogygia/core/contract";
5
+ import { createRequire } from "node:module";
6
+ import { say } from "@ogygia/machine";
7
+ // src/vite/style-preprocess.ts
8
+ let sass;
9
+ const sass_missing = say({ max: 1 });
10
+ let transform;
11
+ function load_sass(root) {
12
+ if (sass !== void 0) return sass;
13
+ const require = createRequire(path.join(root, "package.json"));
14
+ for (const name of ["sass-embedded", "sass"]) try {
15
+ sass = require(name);
16
+ return sass;
17
+ } catch {}
18
+ sass = null;
19
+ return sass;
20
+ }
21
+ async function load_ts_transform() {
22
+ if (transform !== void 0) return transform;
23
+ const vite = await import("vite");
24
+ const oxc = vite.transformWithOxc;
25
+ const esbuild = vite.transformWithEsbuild;
26
+ if (oxc) transform = (code, id) => oxc(code, id, {
27
+ lang: "ts",
28
+ typescript: { onlyRemoveTypeImports: true }
29
+ });
30
+ else if (esbuild) transform = (code, id) => esbuild(code, id, {
31
+ loader: "ts",
32
+ target: "esnext",
33
+ tsconfigRaw: { compilerOptions: { verbatimModuleSyntax: true } }
34
+ });
35
+ else transform = null;
36
+ return transform;
37
+ }
38
+ /** `source` with `<style lang="scss|sass">` compiled to CSS and `<script lang="ts">` stripped of TS. */
39
+ async function preprocess_component_for_css(source, abs, root) {
40
+ const blocks = component_blocks(source);
41
+ const sassy = (lang) => lang === "scss" || lang === "sass";
42
+ const sass_compiler = blocks.some((b) => b.kind === "style" && sassy(b.lang)) ? load_sass(root) : void 0;
43
+ if (sass_compiler === null) sass_missing.once("sass_missing", () => warn("sass_missing"));
44
+ const ts = blocks.some((b) => b.kind === "script" && b.lang === "ts") ? await load_ts_transform() : null;
45
+ let out = "";
46
+ let at = 0;
47
+ const splice = (start, end, text) => {
48
+ out += source.slice(at, start) + text;
49
+ at = end;
50
+ };
51
+ for (const b of blocks) {
52
+ const body = source.slice(b.start, b.end);
53
+ if (b.kind === "style" && sass_compiler && sassy(b.lang)) try {
54
+ const { css } = sass_compiler.compileString(body, {
55
+ syntax: b.lang === "sass" ? "indented" : "scss",
56
+ loadPaths: [
57
+ path.dirname(abs),
58
+ root,
59
+ path.join(root, "node_modules")
60
+ ],
61
+ quietDeps: true,
62
+ silenceDeprecations: ["import"]
63
+ });
64
+ for (const [s, e] of attr_spans(source, b.tag, "style", "lang")) splice(s, e, "");
65
+ splice(b.start, b.end, css);
66
+ } catch (err) {
67
+ warn("scss_compile_failed", {
68
+ file: path.relative(root, abs),
69
+ reason: err.message
70
+ });
71
+ }
72
+ else if (b.kind === "script" && ts && b.lang === "ts") try {
73
+ const { code } = await ts(body, `${abs}.ts`);
74
+ splice(b.start, b.end, code);
75
+ } catch (err) {
76
+ warn("ts_strip_failed", {
77
+ file: path.relative(root, abs),
78
+ reason: err.message
79
+ });
80
+ }
81
+ }
82
+ return at === 0 ? source : out + source.slice(at);
83
+ }
84
+ export { preprocess_component_for_css };
@@ -0,0 +1,4 @@
1
+ /** The Svelte entries the compiler names by module id: Vite pre-bundles them for a dev island, among
2
+ * them Svelte's private client runtime. test/canary/svelte-entries.test.ts resolves each in the
3
+ * installed Svelte's exports map (#1721). */
4
+ export declare const SVELTE_DEV_ISLAND_ENTRIES: readonly string[];
@@ -0,0 +1,10 @@
1
+ // src/vite/svelte-entries.ts
2
+ /** The Svelte entries the compiler names by module id: Vite pre-bundles them for a dev island, among
3
+ * them Svelte's private client runtime. test/canary/svelte-entries.test.ts resolves each in the
4
+ * installed Svelte's exports map (#1721). */
5
+ const SVELTE_DEV_ISLAND_ENTRIES = [
6
+ "svelte",
7
+ "svelte/internal/client",
8
+ "svelte/server"
9
+ ];
10
+ export { SVELTE_DEV_ISLAND_ENTRIES };
@@ -0,0 +1,20 @@
1
+ import { CompileOptions } from "svelte/compiler";
2
+ /** The parts of vite-plugin-svelte's resolved options that decide how it compiles a component. */
3
+ export interface SvelteCompile {
4
+ readonly compilerOptions?: CompileOptions;
5
+ dynamicCompileOptions?(data: {
6
+ filename: string;
7
+ code: string;
8
+ compileOptions: CompileOptions;
9
+ }): Promise<Partial<CompileOptions> | void> | Partial<CompileOptions> | void;
10
+ }
11
+ /** The app's Svelte compile, read off vite-plugin-svelte's resolved options (its config plugin
12
+ * publishes them as `api.options`, resolved before any plugin's own configResolved); null when
13
+ * the app lists no vite-plugin-svelte. */
14
+ export declare function svelte_compile(plugins: readonly {
15
+ name?: string;
16
+ api?: unknown;
17
+ }[] | undefined): SvelteCompile | null;
18
+ /** The options vite-plugin-svelte compiles `filename` with: the app's `compilerOptions`, then that
19
+ * file's `dynamicCompileOptions`. */
20
+ export declare function app_compile_options(svelte: SvelteCompile | null, filename: string, code: string): Promise<CompileOptions>;
@@ -0,0 +1,22 @@
1
+ // src/vite/svelte-options.ts
2
+ /** The app's Svelte compile, read off vite-plugin-svelte's resolved options (its config plugin
3
+ * publishes them as `api.options`, resolved before any plugin's own configResolved); null when
4
+ * the app lists no vite-plugin-svelte. */
5
+ function svelte_compile(plugins) {
6
+ return (plugins?.find((p) => p.name === "vite-plugin-svelte:config")?.api)?.options ?? null;
7
+ }
8
+ /** The options vite-plugin-svelte compiles `filename` with: the app's `compilerOptions`, then that
9
+ * file's `dynamicCompileOptions`. */
10
+ async function app_compile_options(svelte, filename, code) {
11
+ const base = { ...svelte?.compilerOptions };
12
+ const dynamic = await svelte?.dynamicCompileOptions?.({
13
+ filename,
14
+ code,
15
+ compileOptions: base
16
+ });
17
+ return dynamic ? {
18
+ ...base,
19
+ ...dynamic
20
+ } : base;
21
+ }
22
+ export { app_compile_options, svelte_compile };
package/package.json CHANGED
@@ -1,13 +1,88 @@
1
1
  {
2
- "name": "@ogygia/compiler",
3
- "version": "0.0.0",
4
- "description": "Placeholder that reserves the name for ogygia. The first real release is 0.14.",
5
- "homepage": "https://ogygiajs.dev",
6
- "license": "MIT",
7
- "repository": {
8
- "type": "git",
9
- "url": "git+https://github.com/ogygiajs/ogygia.git",
10
- "directory": "packages/compiler"
11
- },
12
- "files": ["README.md"]
13
- }
2
+ "name": "@ogygia/compiler",
3
+ "version": "0.14.1",
4
+ "description": "The compiler of ogygia (SSR islands for SvelteKit): the region transform, the build's link step and the Vite plugin",
5
+ "keywords": [
6
+ "compiler",
7
+ "ogygia",
8
+ "sveltekit",
9
+ "vite-plugin"
10
+ ],
11
+ "homepage": "https://ogygiajs.dev",
12
+ "bugs": {
13
+ "url": "https://github.com/ogygiajs/ogygia/issues"
14
+ },
15
+ "license": "MIT",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/ogygiajs/ogygia.git",
19
+ "directory": "packages/compiler"
20
+ },
21
+ "files": [
22
+ "dist",
23
+ "README.md"
24
+ ],
25
+ "type": "module",
26
+ "sideEffects": false,
27
+ "exports": {
28
+ ".": {
29
+ "types": "./dist/index.d.ts",
30
+ "default": "./dist/index.js"
31
+ },
32
+ "./vite": {
33
+ "types": "./dist/vite/index.d.ts",
34
+ "default": "./dist/vite/index.js"
35
+ },
36
+ "./ids": {
37
+ "types": "./dist/ids.d.ts",
38
+ "svelte": "./dist/ids.js",
39
+ "default": "./dist/ids.js"
40
+ }
41
+ },
42
+ "publishConfig": {
43
+ "access": "public"
44
+ },
45
+ "dependencies": {
46
+ "@jridgewell/remapping": "^2.3.5",
47
+ "@ogygia/machine": "^0.14.0",
48
+ "devalue": "^5.9.3",
49
+ "estree-walker": "^3.0.3",
50
+ "magic-string": "^1.4.5",
51
+ "tinyglobby": "^0.2.17"
52
+ },
53
+ "devDependencies": {
54
+ "@jridgewell/trace-mapping": "^0.3.31",
55
+ "@ogygia/config": "0.0.0",
56
+ "@ogygia/core": "0.14.1",
57
+ "@sveltejs/kit": "^2.70.2",
58
+ "@sveltejs/vite-plugin-svelte": "^7.2.0",
59
+ "@types/node": "^26.1.2",
60
+ "@typescript/native": "npm:typescript@^7.0.2",
61
+ "fast-check": "^4.10.2",
62
+ "rolldown": "^1.2.2",
63
+ "sass-embedded": "^1.104.1",
64
+ "svelte": "5.57.3",
65
+ "tsdown": "^0.23.4",
66
+ "typescript": "^6.0.3",
67
+ "vite": "^8.3.5",
68
+ "vitest": "^4.1.12"
69
+ },
70
+ "peerDependencies": {
71
+ "@ogygia/core": "^0.14.1",
72
+ "@sveltejs/kit": ">=2.70.2 <4",
73
+ "rolldown": ">=1.0.0",
74
+ "svelte": "^5.56.8",
75
+ "vite": "^8.2.4"
76
+ },
77
+ "peerDependenciesMeta": {
78
+ "rolldown": {
79
+ "optional": true
80
+ }
81
+ },
82
+ "scripts": {
83
+ "build": "node scripts/virtual-types.ts && tsdown",
84
+ "test": "vitest run",
85
+ "check": "tsc --noEmit && tsc -p test && vitest run",
86
+ "verify:package": "node ../core/scripts/verify-package.ts ."
87
+ }
88
+ }