@fragno-dev/create 0.0.2

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.
@@ -0,0 +1,30 @@
1
+ import { defineConfig } from "tsdown";
2
+
3
+ import unpluginFragno from "@fragno-dev/unplugin-fragno/rollup";
4
+
5
+ export default defineConfig([
6
+ {
7
+ ignoreWatch: ["./dist"],
8
+ entry: [
9
+ "./src/index.ts",
10
+ "./src/client/react.ts",
11
+ "./src/client/svelte.ts",
12
+ "./src/client/vanilla.ts",
13
+ "./src/client/vue.ts",
14
+ ],
15
+ dts: true,
16
+ platform: "browser",
17
+ outDir: "./dist/browser",
18
+ plugins: [unpluginFragno({ platform: "browser" })],
19
+ noExternal: [/^@fragno-dev\/core\//],
20
+ },
21
+ {
22
+ ignoreWatch: ["./dist"],
23
+ entry: "./src/index.ts",
24
+ dts: true,
25
+ platform: "node",
26
+ outDir: "./dist/node",
27
+ plugins: [unpluginFragno({ platform: "node" })],
28
+ unbundle: true,
29
+ },
30
+ ]);
@@ -0,0 +1,25 @@
1
+ import { defineConfig } from "vite";
2
+ import unpluginFragno from "@fragno-dev/unplugin-fragno/vite";
3
+
4
+ export default defineConfig({
5
+ plugins: [unpluginFragno({ platform: "browser" })],
6
+ // https://vite.dev/guide/build.html#library-mode
7
+ build: {
8
+ lib: {
9
+ entry: {
10
+ index: "./src/index.ts",
11
+ "client/react": "./src/client/react.ts",
12
+ "client/svelte": "./src/client/svelte.ts",
13
+ "client/vanilla": "./src/client/vanilla.ts",
14
+ "client/vue": "./src/client/vue.ts",
15
+ },
16
+ formats: ["es"],
17
+ },
18
+ rollupOptions: {
19
+ external: ["react", "vue", "svelte", "zod"],
20
+ },
21
+ outDir: "./dist/browser",
22
+ sourcemap: true,
23
+ target: "es2020",
24
+ },
25
+ });
@@ -0,0 +1,79 @@
1
+ import path from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+ import unpluginFragno from "@fragno-dev/unplugin-fragno/webpack";
4
+
5
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
6
+
7
+ /** @type {import('webpack').Configuration[]} */
8
+ export default [
9
+ // Browser build
10
+ {
11
+ name: "browser",
12
+ mode: "production",
13
+ entry: {
14
+ index: "./src/index.ts",
15
+ "client/react": "./src/client/react.ts",
16
+ "client/svelte": "./src/client/svelte.ts",
17
+ "client/vanilla": "./src/client/vanilla.ts",
18
+ "client/vue": "./src/client/vue.ts",
19
+ },
20
+ output: {
21
+ path: path.resolve(__dirname, "dist/browser"),
22
+ filename: "[name].js",
23
+ library: {
24
+ type: "module",
25
+ },
26
+ },
27
+ experiments: {
28
+ outputModule: true,
29
+ },
30
+ resolve: {
31
+ extensions: [".ts", ".js"],
32
+ },
33
+ module: {
34
+ rules: [
35
+ {
36
+ test: /\.ts$/,
37
+ use: "ts-loader",
38
+ exclude: /node_modules/,
39
+ },
40
+ ],
41
+ },
42
+ plugins: [unpluginFragno({ platform: "browser" })],
43
+ devtool: "source-map",
44
+ externals: ["react", "vue", "svelte", "zod"],
45
+ },
46
+ // Node build
47
+ {
48
+ name: "node",
49
+ mode: "production",
50
+ entry: {
51
+ index: "./src/index.ts",
52
+ },
53
+ output: {
54
+ path: path.resolve(__dirname, "dist/node"),
55
+ filename: "[name].js",
56
+ library: {
57
+ type: "module",
58
+ },
59
+ },
60
+ experiments: {
61
+ outputModule: true,
62
+ },
63
+ resolve: {
64
+ extensions: [".ts", ".js"],
65
+ },
66
+ module: {
67
+ rules: [
68
+ {
69
+ test: /\.ts$/,
70
+ use: "ts-loader",
71
+ exclude: /node_modules/,
72
+ },
73
+ ],
74
+ },
75
+ plugins: [unpluginFragno({ platform: "node" })],
76
+ devtool: "source-map",
77
+ externals: ["zod"],
78
+ },
79
+ ];
package/tsconfig.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "@fragno-private/typescript-config/tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "outDir": "./dist",
5
+ "rootDir": ".",
6
+ "composite": true
7
+ },
8
+ "include": ["src"],
9
+ "exclude": ["node_modules", "dist"]
10
+ }
@@ -0,0 +1,10 @@
1
+ import { defineConfig } from "tsdown";
2
+
3
+ export default defineConfig([
4
+ {
5
+ entry: "./src/index.ts",
6
+ dts: true,
7
+ platform: "node",
8
+ outDir: "./dist/",
9
+ },
10
+ ]);
@@ -0,0 +1,4 @@
1
+ import { defineConfig } from "vitest/config";
2
+ import { baseConfig } from "@fragno-private/vitest-config";
3
+
4
+ export default defineConfig(baseConfig);