create-lt-adventure 0.0.16 → 0.1.3

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 (36) hide show
  1. package/README.md +85 -85
  2. package/addons/github-workflow/addon.json +5 -5
  3. package/addons/github-workflow/main.yml +96 -48
  4. package/addons/github-workflow/{setup.ts → setup.mjs} +115 -112
  5. package/addons/sf2e-pf2e-redirects/addon.json +5 -0
  6. package/addons/sf2e-pf2e-redirects/setup.mjs +119 -0
  7. package/dist/bin.js +223 -84
  8. package/dist/bin.js.map +1 -1
  9. package/dist/migrate.d.ts +2 -0
  10. package/dist/migrate.d.ts.map +1 -0
  11. package/dist/migrate.js +169 -0
  12. package/dist/migrate.js.map +1 -0
  13. package/dist/options.d.ts +5 -2
  14. package/dist/options.d.ts.map +1 -1
  15. package/dist/options.js +14 -5
  16. package/dist/options.js.map +1 -1
  17. package/package.json +68 -66
  18. package/templates/vite/.env.example +1 -1
  19. package/templates/vite/CHANGELOG +1 -0
  20. package/templates/vite/gitignore +37 -37
  21. package/templates/vite/module.json +37 -36
  22. package/templates/vite/package.json +3 -2
  23. package/templates/vite/scripts/extractPacks.mjs +54 -49
  24. package/templates/vite/scripts/jsonReplacer.mjs +11 -0
  25. package/templates/vite/scripts/onCreate.mjs +41 -13
  26. package/templates/vite/scripts/symlink.mjs +78 -78
  27. package/templates/vite/src/adventureSheet/index.js +497 -497
  28. package/templates/vite/src/hooks.ts +22 -0
  29. package/templates/vite/src/index.js +4 -4
  30. package/templates/vite/src/lib/utils.ts +1 -0
  31. package/templates/vite/src/misc/prosemirror.js +46 -46
  32. package/templates/vite/src/module.css +306 -306
  33. package/templates/vite/src/types.d.ts +7 -7
  34. package/templates/vite/tsconfig.json +33 -29
  35. package/templates/vite/vite.config.ts +129 -128
  36. package/templates/vite/bun.lock +0 -802
@@ -0,0 +1,22 @@
1
+ import moduleJSON from "moduleJSON";
2
+ import { dev } from "$lib/utils";
3
+
4
+ function ready() {
5
+ if (dev) ui.notifications.info(`${moduleJSON.title} is ready!`);
6
+ }
7
+
8
+ const hooks = {
9
+ ready: Hooks.on("ready", ready)
10
+ };
11
+
12
+ // Hot Module Replacement (HMR) used in development mode.
13
+ // https://vite.dev/guide/api-hmr
14
+ // Its simpler than you'd imagine!
15
+ if (import.meta.hot) {
16
+ import.meta.hot.accept((newModule) => {
17
+ if (newModule) {
18
+ // Remove all old hooks
19
+ Object.entries(hooks).forEach(([k, h]) => Array.isArray(h) ? h.forEach((hook) => Hooks.off(k, hook)) : Hooks.off(k, h));
20
+ }
21
+ })
22
+ }
@@ -1,5 +1,5 @@
1
- import "./module.css";
2
- import "./misc/fonts.js"
3
- import "./misc/prosemirror.js"
4
-
1
+ import "./module.css";
2
+ import "./misc/fonts.js"
3
+ import "./misc/prosemirror.js"
4
+
5
5
  Hooks.on("ready", () => import("./adventureSheet"))
@@ -0,0 +1 @@
1
+ export const dev = import.meta.env.DEV;
@@ -1,47 +1,47 @@
1
- import { id, title } from "moduleJSON";
2
-
3
- // https://github.com/foundryvtt/pf2e/blob/master/src/scripts/hooks/get-prosemirror-menu-dropdowns.ts
4
- Hooks.on("getProseMirrorMenuDropDowns", (menu, dropdowns) => {
5
- const toggleMark = foundry.prosemirror.commands.toggleMark;
6
- const wrapIn = foundry.prosemirror.commands.wrapIn;
7
- if ("format" in dropdowns) {
8
- dropdowns.format.entries.push({
9
- action: `${id}`,
10
- title,
11
- children: [
12
- {
13
- action: `${id}-green-check`,
14
- class: `${id} Checks-and-Saves`,
15
- title: "Checks and Saves",
16
- mark: menu.schema.marks.span,
17
- attrs: { _preserve: { class: `${id} Checks-and-Saves` } },
18
- priority: 1,
19
- cmd: toggleMark(menu.schema.marks.span, {
20
- _preserve: { class: `${id} Checks-and-Saves` },
21
- }),
22
- },
23
- {
24
- action: `${id}-sidebar`,
25
- class: "sidebar",
26
- title: "Sidebar",
27
- node: menu.schema.nodes.section,
28
- attrs: { _preserve: { class: `${id} sidebar right` } },
29
- priority: 1,
30
- cmd: () => {
31
- menu._toggleBlock(menu.schema.nodes.section, wrapIn, {
32
- attrs: { _preserve: { class: `${id} sidebar right` } },
33
- });
34
- return true;
35
- },
36
- },
37
- ],
38
- });
39
- }
40
- });
41
-
42
- if (import.meta.hot) {
43
- import.meta.hot.accept()
44
- import.meta.hot.dispose(() => {
45
- Hooks.off(hook)
46
- });
1
+ import { id, title } from "moduleJSON";
2
+
3
+ // https://github.com/foundryvtt/pf2e/blob/master/src/scripts/hooks/get-prosemirror-menu-dropdowns.ts
4
+ Hooks.on("getProseMirrorMenuDropDowns", (menu, dropdowns) => {
5
+ const toggleMark = foundry.prosemirror.commands.toggleMark;
6
+ const wrapIn = foundry.prosemirror.commands.wrapIn;
7
+ if ("format" in dropdowns) {
8
+ dropdowns.format.entries.push({
9
+ action: `${id}`,
10
+ title,
11
+ children: [
12
+ {
13
+ action: `${id}-green-check`,
14
+ class: `${id} Checks-and-Saves`,
15
+ title: "Checks and Saves",
16
+ mark: menu.schema.marks.span,
17
+ attrs: { _preserve: { class: `${id} Checks-and-Saves` } },
18
+ priority: 1,
19
+ cmd: toggleMark(menu.schema.marks.span, {
20
+ _preserve: { class: `${id} Checks-and-Saves` },
21
+ }),
22
+ },
23
+ {
24
+ action: `${id}-sidebar`,
25
+ class: "sidebar",
26
+ title: "Sidebar",
27
+ node: menu.schema.nodes.section,
28
+ attrs: { _preserve: { class: `${id} sidebar right` } },
29
+ priority: 1,
30
+ cmd: () => {
31
+ menu._toggleBlock(menu.schema.nodes.section, wrapIn, {
32
+ attrs: { _preserve: { class: `${id} sidebar right` } },
33
+ });
34
+ return true;
35
+ },
36
+ },
37
+ ],
38
+ });
39
+ }
40
+ });
41
+
42
+ if (import.meta.hot) {
43
+ import.meta.hot.accept()
44
+ import.meta.hot.dispose(() => {
45
+ Hooks.off(hook)
46
+ });
47
47
  }