create-fvtt-module 0.0.4 → 0.0.6

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,37 @@
1
+ packs
2
+
3
+ # dependencies (bun install)
4
+ node_modules
5
+
6
+ # output
7
+ out
8
+ dist
9
+ *.tgz
10
+
11
+ # code coverage
12
+ coverage
13
+ *.lcov
14
+
15
+ # logs
16
+ logs
17
+ _.log
18
+ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
19
+
20
+ # dotenv environment variable files
21
+ .env
22
+ .env.development.local
23
+ .env.test.local
24
+ .env.production.local
25
+ .env.local
26
+
27
+ # caches
28
+ .eslintcache
29
+ .cache
30
+ *.tsbuildinfo
31
+ .vite-cache
32
+
33
+ # IntelliJ based IDEs
34
+ .idea
35
+
36
+ # Finder (MacOS) folder config
37
+ .DS_Store
@@ -1,25 +1,27 @@
1
- {
2
- "name": "new-module",
3
- "type": "module",
4
- "private": true,
5
- "license": "MIT",
6
- "scripts": {
7
- "build": "vite build",
8
- "dev": "vite",
9
- "extract": "node scripts/extractPacks.mjs",
10
- "symlink": "node scripts/symlink.mjs"
11
- },
12
- "devDependencies": {
13
- "@foundryvtt/foundryvtt-cli": "^3.0.2",
14
- "foundryvtt-sync": "https://github.com/MrVauxs/FoundryVTT-Sync",
15
- "postcss-preset-env": "^10.6.0",
16
- "@clack/prompts": "^1.0.0-alpha.9",
17
- "kolorist": "^1.8.0",
18
- "vite": "^7.3.0",
19
- "dotenv": "^17.2.3"
20
- },
21
- "browserslist": [
22
- ">5%",
23
- "not IE 11"
24
- ]
25
- }
1
+ {
2
+ "name": "new-module",
3
+ "type": "module",
4
+ "private": true,
5
+ "license": "MIT",
6
+ "scripts": {
7
+ "build": "vite build",
8
+ "dev": "vite",
9
+ "extract": "node scripts/extractPacks.mjs",
10
+ "symlink": "node scripts/symlink.mjs"
11
+ },
12
+ "devDependencies": {
13
+ "@foundryvtt/foundryvtt-cli": "^3.0.2",
14
+ "@7h3laughingman/foundry-types": "^13.351.2",
15
+ "foundryvtt-sync": "https://github.com/MrVauxs/FoundryVTT-Sync",
16
+ "postcss-preset-env": "^10.6.0",
17
+ "@clack/prompts": "^1.0.0-alpha.9",
18
+ "kolorist": "^1.8.0",
19
+ "terser": "^5.46.0",
20
+ "vite": "^7.3.0",
21
+ "dotenv": "^17.2.3"
22
+ },
23
+ "browserslist": [
24
+ ">5%",
25
+ "not IE 11"
26
+ ]
27
+ }
@@ -1,14 +1,26 @@
1
- const mod = (await Bun.file("../module.json").json());
2
- const pack = (await Bun.file("../package.json").json());
3
-
4
- // Module
5
- mod.esmodules = [`dist/${mod.id}.js`];
6
- mod.styles = [`dist/${mod.id}.css`];
7
-
8
- // Package
9
- pack.name = mod.id;
10
-
11
- await Bun.write("../module.json", JSON.stringify(mod, null, "\t"));
12
- await Bun.write("../package.json", JSON.stringify(pack, null, "\t"));
13
-
14
- export { };
1
+ import { renameSync } from "fs";
2
+
3
+ const mod = (await Bun.file("../module.json").json());
4
+ const pack = (await Bun.file("../package.json").json());
5
+
6
+ // Module
7
+ mod.esmodules = [`dist/${mod.id}.js`];
8
+ mod.styles = [`dist/${mod.id}.css`];
9
+
10
+ // Package
11
+ pack.name = mod.id;
12
+
13
+ mod.media = [
14
+ {
15
+ "type": "setup",
16
+ "url": `modules/${mod.id}/assets/setup.webp`
17
+ }
18
+ ];
19
+
20
+ await Bun.write("../module.json", JSON.stringify(mod, null, "\t"));
21
+ await Bun.write("../package.json", JSON.stringify(pack, null, "\t"));
22
+
23
+ // Rename gitignore to .gitignore
24
+ renameSync("../gitignore", "../.gitignore");
25
+
26
+ export { };
@@ -0,0 +1,29 @@
1
+ {
2
+ "compilerOptions": {
3
+ "lib": ["ESNext", "DOM", "DOM.Iterable"],
4
+ "target": "esnext",
5
+ "module": "esnext",
6
+ "moduleDetection": "force",
7
+ "moduleResolution": "bundler",
8
+ "declaration": true,
9
+ "declarationMap": true,
10
+ "sourceMap": true,
11
+ "outDir": "./dist",
12
+ "rootDir": "./src",
13
+ "allowJs": true,
14
+ "resolveJsonModule": true,
15
+ "strict": true,
16
+ "skipLibCheck": true,
17
+ "noFallthroughCasesInSwitch": true,
18
+ "noUncheckedIndexedAccess": true,
19
+ "noImplicitOverride": true,
20
+ "noUnusedLocals": false,
21
+ "noUnusedParameters": false,
22
+ "noPropertyAccessFromIndexSignature": false,
23
+ "esModuleInterop": true,
24
+ "allowSyntheticDefaultImports": true,
25
+ "types": ["@7h3laughingman/foundry-types", "jquery"],
26
+ },
27
+ "include": ["src/**/*"],
28
+ "exclude": ["node_modules", "dist"],
29
+ }
@@ -64,9 +64,13 @@ export default defineConfig(({ mode: _mode }) => {
64
64
  },
65
65
  build: {
66
66
  outDir: "../dist", // The output directory.
67
- emptyOutDir: false,
67
+ emptyOutDir: true,
68
68
  sourcemap: true, // Provide a publicly available sourcemap for debuggin purposes.
69
69
  target,
70
+ minify: "terser",
71
+ terserOptions: {
72
+ keep_classnames: true, // Don't mangle class names since Foundry relies on them
73
+ },
70
74
  lib: {
71
75
  entry: "./" + libEntry,
72
76
  formats: ["es"],