forgepress 0.0.0 → 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.
Files changed (57) hide show
  1. package/dist/THIRD-PARTY-LICENSES.md +42 -0
  2. package/dist/_chunks/client.d.mts +2 -0
  3. package/dist/_chunks/config.mjs +79 -0
  4. package/dist/_chunks/content.mjs +733 -0
  5. package/dist/_chunks/error.mjs +4 -0
  6. package/dist/_chunks/fetch.mjs +13 -0
  7. package/dist/_chunks/files.mjs +32 -0
  8. package/dist/_chunks/libs/diff.mjs +485 -0
  9. package/dist/_chunks/locate.mjs +7 -0
  10. package/dist/_chunks/media.mjs +282 -0
  11. package/dist/_chunks/once.mjs +16 -0
  12. package/dist/_chunks/output.mjs +104 -0
  13. package/dist/_chunks/overlay.mjs +8 -0
  14. package/dist/_chunks/plugin.mjs +87 -0
  15. package/dist/_chunks/preview.mjs +248 -0
  16. package/dist/_chunks/project.d.mts +7 -0
  17. package/dist/_chunks/reader.mjs +19 -0
  18. package/dist/_chunks/reader2.mjs +797 -0
  19. package/dist/_chunks/references.mjs +56 -0
  20. package/dist/_chunks/resolve.d.mts +2 -0
  21. package/dist/_chunks/response.mjs +5 -0
  22. package/dist/_chunks/routes.mjs +9 -0
  23. package/dist/_chunks/serialize.mjs +82 -0
  24. package/dist/_chunks/settings.mjs +328 -0
  25. package/dist/_chunks/settings2.mjs +2 -0
  26. package/dist/_chunks/types.d.mts +230 -0
  27. package/dist/_chunks/types2.d.mts +25 -0
  28. package/dist/_chunks/value.mjs +139 -0
  29. package/dist/cli/bin.d.mts +1 -0
  30. package/dist/cli/bin.mjs +61 -0
  31. package/dist/disk/reader.d.mts +4 -0
  32. package/dist/disk/reader.mjs +2 -0
  33. package/dist/editor/index.d.mts +3 -0
  34. package/dist/editor/index.mjs +61951 -0
  35. package/dist/index.d.mts +104 -0
  36. package/dist/index.mjs +237 -0
  37. package/dist/next/preview.d.mts +1 -0
  38. package/dist/next/preview.mjs +3 -0
  39. package/dist/next/reload.d.mts +1 -0
  40. package/dist/next/reload.mjs +20 -0
  41. package/dist/next/settings.d.mts +12 -0
  42. package/dist/next/settings.mjs +2 -0
  43. package/dist/plugin/next.d.mts +11 -0
  44. package/dist/plugin/next.mjs +213 -0
  45. package/dist/plugin/nuxt.d.mts +7 -0
  46. package/dist/plugin/nuxt.mjs +52 -0
  47. package/dist/plugin/watcher.d.mts +1 -0
  48. package/dist/plugin/watcher.mjs +23 -0
  49. package/dist/preview/index.d.mts +4 -0
  50. package/dist/preview/index.mjs +2 -0
  51. package/dist/preview/react.d.mts +1 -0
  52. package/dist/preview/react.mjs +34 -0
  53. package/dist/query/fetch.d.mts +3 -0
  54. package/dist/query/fetch.mjs +2 -0
  55. package/dist/unplugin.d.mts +13 -0
  56. package/dist/unplugin.mjs +2 -0
  57. package/package.json +146 -2
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1,23 @@
1
+ import { basename, dirname, join } from "node:path";
2
+ import { existsSync, watch } from "node:fs";
3
+ import { parentPort, workerData } from "node:worker_threads";
4
+ const { dir, schema } = workerData;
5
+ function changed(file) {
6
+ parentPort?.postMessage(file);
7
+ }
8
+ function start() {
9
+ if (!existsSync(dir)) return false;
10
+ watch(dir, { recursive: true }, (_, name) => {
11
+ if (name) changed(join(dir, name));
12
+ });
13
+ return true;
14
+ }
15
+ if (!start() && existsSync(dirname(dir))) {
16
+ const parent = watch(dirname(dir), (_, name) => {
17
+ if (name !== basename(dir) || !start()) return;
18
+ parent.close();
19
+ changed(schema);
20
+ });
21
+ }
22
+ parentPort?.postMessage(null);
23
+ export {};
@@ -0,0 +1,4 @@
1
+ import "../_chunks/types.mjs";
2
+ export declare function previewing(): boolean;
3
+ export declare function onPreviewChange(listener: () => void): () => void;
4
+ export declare function enablePreview(): boolean;
@@ -0,0 +1,2 @@
1
+ import { enablePreview, onPreviewChange, previewing } from "../_chunks/preview.mjs";
2
+ export { enablePreview, onPreviewChange, previewing };
@@ -0,0 +1 @@
1
+ export declare function usePreviewData<TData>(data: TData, load: () => Promise<TData>): TData;
@@ -0,0 +1,34 @@
1
+ import { enablePreview, onPreviewChange } from "../_chunks/preview.mjs";
2
+ import { useEffect, useRef, useState } from "react";
3
+ function usePreviewData(data, load) {
4
+ const [previewed, setPreviewed] = useState();
5
+ const loader = useRef(load);
6
+ useEffect(() => {
7
+ loader.current = load;
8
+ });
9
+ useEffect(() => {
10
+ let latest = 0;
11
+ let stopped = false;
12
+ function update() {
13
+ const run = ++latest;
14
+ if (!enablePreview()) {
15
+ setPreviewed(void 0);
16
+ return;
17
+ }
18
+ loader.current().then((result) => {
19
+ if (!stopped && run === latest) setPreviewed({
20
+ from: data,
21
+ data: result
22
+ });
23
+ });
24
+ }
25
+ update();
26
+ const stop = onPreviewChange(update);
27
+ return () => {
28
+ stopped = true;
29
+ stop();
30
+ };
31
+ }, [data]);
32
+ return previewed?.from === data ? previewed.data : data;
33
+ }
34
+ export { usePreviewData };
@@ -0,0 +1,3 @@
1
+ import { ContentReader } from "../_chunks/client.mjs";
2
+ export declare function fetchReader(url: string): ContentReader;
3
+ export declare const reader: ContentReader;
@@ -0,0 +1,2 @@
1
+ import { fetchReader, reader } from "../_chunks/fetch.mjs";
2
+ export { fetchReader, reader };
@@ -0,0 +1,13 @@
1
+ import { Options } from "./_chunks/project.mjs";
2
+ import { UnpluginFactory, UnpluginInstance } from "unplugin";
3
+ export declare const unpluginFactory: UnpluginFactory<Options | undefined>;
4
+ type Instance = UnpluginInstance<Options | undefined, boolean>;
5
+ export declare const unplugin: Instance;
6
+ export declare const vitePlugin: Instance['vite'];
7
+ export declare const rollupPlugin: Instance['rollup'];
8
+ export declare const rolldownPlugin: Instance['rolldown'];
9
+ export declare const webpackPlugin: Instance['webpack'];
10
+ export declare const rspackPlugin: Instance['rspack'];
11
+ export declare const farmPlugin: Instance['farm'];
12
+ export declare const bunPlugin: Instance['bun'];
13
+ export { type Options, unplugin as default };
@@ -0,0 +1,2 @@
1
+ import { bunPlugin, farmPlugin, rolldownPlugin, rollupPlugin, rspackPlugin, unplugin, unpluginFactory, vitePlugin, webpackPlugin } from "./_chunks/plugin.mjs";
2
+ export { bunPlugin, unplugin as default, farmPlugin, rolldownPlugin, rollupPlugin, rspackPlugin, unplugin, unpluginFactory, vitePlugin, webpackPlugin };
package/package.json CHANGED
@@ -1,4 +1,148 @@
1
1
  {
2
2
  "name": "forgepress",
3
- "version": "0.0.0"
4
- }
3
+ "type": "module",
4
+ "version": "0.0.2",
5
+ "description": "Fully static, git based CMS.",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/forgepress-cms/forgepress.git"
10
+ },
11
+ "sideEffects": [
12
+ "./dist/next/preview.mjs",
13
+ "./dist/next/reload.mjs"
14
+ ],
15
+ "imports": {
16
+ "#content-reader": {
17
+ "node": "./dist/disk/reader.mjs",
18
+ "default": "./dist/query/fetch.mjs"
19
+ }
20
+ },
21
+ "exports": {
22
+ ".": {
23
+ "types": "./dist/index.d.mts",
24
+ "default": "./dist/index.mjs"
25
+ },
26
+ "./unplugin": {
27
+ "types": "./dist/unplugin.d.mts",
28
+ "default": "./dist/unplugin.mjs"
29
+ },
30
+ "./nuxt": {
31
+ "types": "./dist/plugin/nuxt.d.mts",
32
+ "default": "./dist/plugin/nuxt.mjs"
33
+ },
34
+ "./next": {
35
+ "types": "./dist/plugin/next.d.mts",
36
+ "default": "./dist/plugin/next.mjs"
37
+ },
38
+ "./next/preview": {
39
+ "types": "./dist/next/preview.d.mts",
40
+ "default": "./dist/next/preview.mjs"
41
+ },
42
+ "./next/reload": {
43
+ "types": "./dist/next/reload.d.mts",
44
+ "default": "./dist/next/reload.mjs"
45
+ },
46
+ "./next/settings": {
47
+ "types": "./dist/next/settings.d.mts",
48
+ "default": "./dist/next/settings.mjs"
49
+ },
50
+ "./editor": {
51
+ "types": "./dist/editor/index.d.mts",
52
+ "default": "./dist/editor/index.mjs"
53
+ },
54
+ "./preview": {
55
+ "types": "./dist/preview/index.d.mts",
56
+ "default": "./dist/preview/index.mjs"
57
+ },
58
+ "./react": {
59
+ "types": "./dist/preview/react.d.mts",
60
+ "default": "./dist/preview/react.mjs"
61
+ }
62
+ },
63
+ "types": "./dist/index.d.mts",
64
+ "bin": {
65
+ "forgepress": "./dist/cli/bin.mjs"
66
+ },
67
+ "files": [
68
+ "dist"
69
+ ],
70
+ "peerDependencies": {
71
+ "@nuxt/kit": "^4.0.0",
72
+ "@nuxt/schema": "^4.0.0",
73
+ "next": "^16.3.0",
74
+ "react": "^18.0.0 || ^19.0.0",
75
+ "vue": "^3.5.0"
76
+ },
77
+ "peerDependenciesMeta": {
78
+ "@nuxt/kit": {
79
+ "optional": true
80
+ },
81
+ "@nuxt/schema": {
82
+ "optional": true
83
+ },
84
+ "next": {
85
+ "optional": true
86
+ },
87
+ "react": {
88
+ "optional": true
89
+ },
90
+ "vue": {
91
+ "optional": true
92
+ }
93
+ },
94
+ "dependencies": {
95
+ "citty": "^0.2.2",
96
+ "idb-keyval": "^6.3.0",
97
+ "jsonc-parser": "^3.3.1",
98
+ "oauth4webapi": "^3.8.8",
99
+ "perfect-debounce": "^2.1.0",
100
+ "unplugin": "^3.0.0",
101
+ "ws": "^8.21.3"
102
+ },
103
+ "devDependencies": {
104
+ "@antfu/eslint-config": "^9.5.1",
105
+ "@arethetypeswrong/cli": "^0.18.5",
106
+ "@fontsource-variable/bricolage-grotesque": "^5.3.0",
107
+ "@iconify-json/hugeicons": "^1.2.34",
108
+ "@nuxt/kit": "^4.5.2",
109
+ "@nuxt/schema": "^4.5.2",
110
+ "@nuxt/ui": "^4.11.1",
111
+ "@tanstack/vue-table": "^8.21.3",
112
+ "@types/node": "^24.0.0",
113
+ "@types/react": "^19.3.0",
114
+ "@types/react-dom": "^19.3.0",
115
+ "@types/ws": "^8.18.1",
116
+ "@vitejs/plugin-vue": "^6.0.8",
117
+ "@vueuse/core": "^14.4.0",
118
+ "diff": "^8.0.4",
119
+ "eslint": "^10.10.0",
120
+ "fake-indexeddb": "^6.2.5",
121
+ "happy-dom": "^20.14.3",
122
+ "next": "^16.3.5",
123
+ "obuild": "^0.4.39",
124
+ "publint": "^0.3.24",
125
+ "react": "^19.3.0",
126
+ "react-dom": "^19.3.0",
127
+ "tailwindcss": "^4.3.3",
128
+ "typescript": "^6.0.3",
129
+ "vite": "^8.3.0",
130
+ "vitest": "^4.1.11",
131
+ "vue": "^3.5.42",
132
+ "vue-tsc": "^3.3.11"
133
+ },
134
+ "scripts": {
135
+ "lint": "eslint .",
136
+ "typecheck": "vue-tsc --noEmit && pnpm --filter=playground-nuxt run typecheck && pnpm --filter=playground-next run typecheck && pnpm --filter=docs run typecheck",
137
+ "test": "vitest run",
138
+ "test:watch": "vitest",
139
+ "build": "obuild && pnpm run build:editor",
140
+ "build:editor": "vite build --config editor/vite.config.mjs",
141
+ "dev": "node --watch-path=src --watch-preserve-output scripts/build.mjs",
142
+ "dev:editor": "vite build --config editor/vite.config.mjs --watch",
143
+ "dev:nuxt": "pnpm --filter=playground-nuxt run dev",
144
+ "dev:next": "pnpm --filter=playground-next run dev",
145
+ "dev:docs": "pnpm --filter=docs run dev",
146
+ "check:package": "publint --strict && attw --pack . --profile esm-only"
147
+ }
148
+ }