foundrycms 0.1.0

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 (75) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +152 -0
  3. package/dist/__tests__/foundry.test.d.ts +2 -0
  4. package/dist/__tests__/foundry.test.d.ts.map +1 -0
  5. package/dist/__tests__/foundry.test.js +1013 -0
  6. package/dist/__tests__/foundry.test.js.map +1 -0
  7. package/dist/config-manager.d.ts +33 -0
  8. package/dist/config-manager.d.ts.map +1 -0
  9. package/dist/config-manager.js +169 -0
  10. package/dist/config-manager.js.map +1 -0
  11. package/dist/hook-system.d.ts +61 -0
  12. package/dist/hook-system.d.ts.map +1 -0
  13. package/dist/hook-system.js +114 -0
  14. package/dist/hook-system.js.map +1 -0
  15. package/dist/index.d.ts +47 -0
  16. package/dist/index.d.ts.map +1 -0
  17. package/dist/index.js +82 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/page-builder/element-registry.d.ts +47 -0
  20. package/dist/page-builder/element-registry.d.ts.map +1 -0
  21. package/dist/page-builder/element-registry.js +98 -0
  22. package/dist/page-builder/element-registry.js.map +1 -0
  23. package/dist/page-builder/elements/index.d.ts +22 -0
  24. package/dist/page-builder/elements/index.d.ts.map +1 -0
  25. package/dist/page-builder/elements/index.js +770 -0
  26. package/dist/page-builder/elements/index.js.map +1 -0
  27. package/dist/page-builder/renderer.d.ts +14 -0
  28. package/dist/page-builder/renderer.d.ts.map +1 -0
  29. package/dist/page-builder/renderer.js +240 -0
  30. package/dist/page-builder/renderer.js.map +1 -0
  31. package/dist/page-builder/serializer.d.ts +1220 -0
  32. package/dist/page-builder/serializer.d.ts.map +1 -0
  33. package/dist/page-builder/serializer.js +111 -0
  34. package/dist/page-builder/serializer.js.map +1 -0
  35. package/dist/page-builder/template-studio.d.ts +37 -0
  36. package/dist/page-builder/template-studio.d.ts.map +1 -0
  37. package/dist/page-builder/template-studio.js +923 -0
  38. package/dist/page-builder/template-studio.js.map +1 -0
  39. package/dist/page-builder/types.d.ts +99 -0
  40. package/dist/page-builder/types.d.ts.map +1 -0
  41. package/dist/page-builder/types.js +5 -0
  42. package/dist/page-builder/types.js.map +1 -0
  43. package/dist/plugin-system.d.ts +128 -0
  44. package/dist/plugin-system.d.ts.map +1 -0
  45. package/dist/plugin-system.js +252 -0
  46. package/dist/plugin-system.js.map +1 -0
  47. package/dist/plugins/communication.d.ts +6 -0
  48. package/dist/plugins/communication.d.ts.map +1 -0
  49. package/dist/plugins/communication.js +922 -0
  50. package/dist/plugins/communication.js.map +1 -0
  51. package/dist/plugins/core.d.ts +6 -0
  52. package/dist/plugins/core.d.ts.map +1 -0
  53. package/dist/plugins/core.js +675 -0
  54. package/dist/plugins/core.js.map +1 -0
  55. package/dist/plugins/growth.d.ts +6 -0
  56. package/dist/plugins/growth.d.ts.map +1 -0
  57. package/dist/plugins/growth.js +668 -0
  58. package/dist/plugins/growth.js.map +1 -0
  59. package/dist/plugins/index.d.ts +8 -0
  60. package/dist/plugins/index.d.ts.map +1 -0
  61. package/dist/plugins/index.js +43 -0
  62. package/dist/plugins/index.js.map +1 -0
  63. package/dist/plugins/operations.d.ts +7 -0
  64. package/dist/plugins/operations.d.ts.map +1 -0
  65. package/dist/plugins/operations.js +930 -0
  66. package/dist/plugins/operations.js.map +1 -0
  67. package/dist/theme/presets.d.ts +8 -0
  68. package/dist/theme/presets.d.ts.map +1 -0
  69. package/dist/theme/presets.js +257 -0
  70. package/dist/theme/presets.js.map +1 -0
  71. package/dist/theme/types.d.ts +83 -0
  72. package/dist/theme/types.d.ts.map +1 -0
  73. package/dist/theme/types.js +5 -0
  74. package/dist/theme/types.js.map +1 -0
  75. package/package.json +38 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jonathan Ellis
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,152 @@
1
+ # Foundry CMS
2
+
3
+ The modern WordPress replacement. TypeScript-native, plugin-based, self-hosted.
4
+
5
+ ## Quick Start
6
+
7
+ ```bash
8
+ npm install @foundrycms/core
9
+ ```
10
+
11
+ ```typescript
12
+ import { createFoundryWithDefaults } from '@foundrycms/core';
13
+
14
+ const foundry = createFoundryWithDefaults();
15
+
16
+ // 15 elements + 10 templates ready to go
17
+ console.log(foundry.elements.list().length); // 15
18
+ console.log(foundry.templates.list().length); // 10
19
+ ```
20
+
21
+ ## What's Included
22
+
23
+ - **Plugin System** — Register, activate, deactivate plugins with dependency resolution
24
+ - **Hook Engine** — Event emitters and filters with priority ordering
25
+ - **Config Manager** — Dot-notation access with Zod schema validation
26
+ - **Page Builder** — 15 elements across 5 categories (Layout, Content, Media, Data, Interactive)
27
+ - **Template Studio** — 10 starter templates (Hero, About, Services, Pricing, etc.)
28
+ - **Theme System** — 3 built-in presets (Architect, Quantum, Elegant)
29
+ - **Server Renderer** — Render pages to HTML strings
30
+ - **Serializer** — Serialize/deserialize page data with validation
31
+ - **17 Plugins** — Forge, Ledger, Scout, Roster, Depot, Stage, Relay, Oracle, Sentinel, Compass, Beacon, Chronicle, Canvas, Market, Blueprint, Pulse, Atlas
32
+
33
+ ## Elements (15)
34
+
35
+ | Category | Elements |
36
+ |----------|----------|
37
+ | Layout | Row, Column, Spacer, Divider |
38
+ | Content | Heading, Text Block, Button, Icon |
39
+ | Media | Image, Gallery, Video |
40
+ | Data | Pricing Table, Testimonial |
41
+ | Interactive | Accordion, Call to Action |
42
+
43
+ ## Plugins (17)
44
+
45
+ | Category | Plugins |
46
+ |----------|---------|
47
+ | Core | Forge (builder), Ledger (invoicing), Compass (CRM), Oracle (AI) |
48
+ | Growth | Scout (prospects), Beacon (SEO), Chronicle (blog), Atlas (analytics) |
49
+ | Operations | Roster (booking), Depot (inventory), Stage (events), Blueprint (projects), Pulse (team) |
50
+ | Communication | Relay (messaging), Canvas (forms), Market (e-commerce), Sentinel (monitoring) |
51
+
52
+ ## Usage
53
+
54
+ ### Create a page
55
+
56
+ ```typescript
57
+ import { createFoundryWithDefaults, type PageData } from '@foundrycms/core';
58
+
59
+ const foundry = createFoundryWithDefaults();
60
+
61
+ const page: PageData = {
62
+ rows: [
63
+ {
64
+ id: 'row-1',
65
+ settings: { layout: 'boxed' },
66
+ columns: [
67
+ {
68
+ id: 'col-1',
69
+ settings: { width: '1/1' },
70
+ elements: [
71
+ {
72
+ id: 'heading-1',
73
+ type: 'heading',
74
+ settings: { text: 'Hello World', level: 'h1', alignment: 'center' },
75
+ },
76
+ ],
77
+ },
78
+ ],
79
+ },
80
+ ],
81
+ meta: {
82
+ title: 'Home',
83
+ description: 'Welcome to my site',
84
+ },
85
+ };
86
+ ```
87
+
88
+ ### Render to HTML
89
+
90
+ ```typescript
91
+ import { renderPage } from '@foundrycms/core';
92
+
93
+ const html = renderPage(page, foundry.elements);
94
+ // Returns full HTML string
95
+ ```
96
+
97
+ ### Register a custom plugin
98
+
99
+ ```typescript
100
+ import { createFoundry, type FoundryPlugin } from '@foundrycms/core';
101
+
102
+ const myPlugin: FoundryPlugin = {
103
+ id: 'my-plugin',
104
+ name: 'My Plugin',
105
+ version: '1.0.0',
106
+ description: 'Does something cool',
107
+ hooks: [
108
+ {
109
+ hook: 'page:before_render',
110
+ handler: async (core, html) => {
111
+ // Modify HTML before rendering
112
+ return html;
113
+ },
114
+ },
115
+ ],
116
+ onActivate: async (core) => {
117
+ console.log('Plugin activated!');
118
+ },
119
+ };
120
+
121
+ const foundry = createFoundry();
122
+ foundry.plugins.register(myPlugin);
123
+ await foundry.plugins.activate('my-plugin');
124
+ ```
125
+
126
+ ### Use themes
127
+
128
+ ```typescript
129
+ import { getPresetById, builtInPresets } from '@foundrycms/core';
130
+
131
+ // List all presets
132
+ console.log(builtInPresets.map(p => p.name)); // ['Architect', 'Quantum', 'Elegant']
133
+
134
+ // Get a specific preset
135
+ const quantum = getPresetById('quantum');
136
+ console.log(quantum?.tokens.colors.primary); // '#00e640'
137
+ ```
138
+
139
+ ## Self-Hosting
140
+
141
+ Foundry is designed to run on any Node.js server. For the full CMS experience with a visual editor, database, and API:
142
+
143
+ 1. **Cloudflare Pages** (free) — Static + serverless functions
144
+ 2. **Vercel** (free tier) — Next.js deployment
145
+ 3. **Any Node.js host** — Express/Fastify server
146
+ 4. **GoDaddy/cPanel** — Node.js application
147
+
148
+ See full documentation at [jonathanellis.work/foundry](https://jonathanellis.work/foundry)
149
+
150
+ ## License
151
+
152
+ MIT - Jonathan Ellis
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=foundry.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foundry.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/foundry.test.ts"],"names":[],"mappings":""}