oc-template-svelte-compiler 0.0.3 → 0.0.4

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.
@@ -1 +1 @@
1
- export declare const compile: (options: import("oc-generic-template-compiler").CompilerOptions, callback: (err: Error | null, data: unknown) => void) => void;
1
+ export declare const compile: (options: import("oc-vite-compiler/dist/lib/createCompile").CompilerOptions, callback: (err: Error | null, data: any) => void) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oc-template-svelte-compiler",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Compiler for the Svelte OC template",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
32
32
  "oc-template-svelte": "^0.0.2",
33
- "oc-vite-compiler": "^4.1.0",
33
+ "oc-vite-compiler": "^4.1.1",
34
34
  "svelte": "^5.23.0"
35
35
  },
36
36
  "files": [
@@ -0,0 +1,12 @@
1
+ import fs from "node:fs";
2
+
3
+ /**
4
+ * Temporary fix for the svelte vite plugin to make it work with CJS
5
+ */
6
+
7
+ const path = "./node_modules/@sveltejs/vite-plugin-svelte/package.json";
8
+
9
+ const pkg = JSON.parse(fs.readFileSync(path, "utf8"));
10
+ pkg.exports["."].node = pkg.exports["."].import;
11
+
12
+ fs.writeFileSync(path, JSON.stringify(pkg, null, 2), "utf8");
@@ -6,7 +6,8 @@
6
6
  "dev": "oc-server dev",
7
7
  "build": "npm run check && oc package .",
8
8
  "check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json",
9
- "test": "vitest"
9
+ "test": "vitest",
10
+ "postinstall": "node fixBuild.mjs"
10
11
  },
11
12
  "oc": {
12
13
  "files": {
@@ -26,7 +27,7 @@
26
27
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
27
28
  "jsdom": "^21.1.1",
28
29
  "oc-server": "^2.0.5",
29
- "oc-template-svelte-compiler": "^0.0.2",
30
+ "oc-template-svelte-compiler": "^0.0.4",
30
31
  "svelte": "^5.23.0",
31
32
  "typescript": "5.0.2",
32
33
  "vitest": "^0.29.7"
@@ -0,0 +1,7 @@
1
+ import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
2
+
3
+ export default {
4
+ // Consult https://svelte.dev/docs#compile-time-svelte-preprocess
5
+ // for more information about preprocessors
6
+ preprocess: vitePreprocess(),
7
+ }
@@ -20,5 +20,5 @@
20
20
  "noFallthroughCasesInSwitch": true,
21
21
  "noUncheckedSideEffectImports": true
22
22
  },
23
- "include": ["vite.config.ts"]
23
+ "include": ["vite.config.ts", "src/server.ts"]
24
24
  }