anhedral 0.3.0 → 0.4.1
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.
- package/CHANGELOG.md +35 -0
- package/CONTRIBUTING.md +4 -1
- package/LICENSE +201 -26
- package/README.md +79 -15
- package/SECURITY.md +4 -2
- package/SKILL.md +78 -11
- package/assets/anhedral-cli-init.svg +238 -0
- package/assets/images/svg/ably-symbol-color.svg +8 -0
- package/assets/images/svg/logo-white-subtract.svg +4 -0
- package/dist/architecture/contributions.js +7 -0
- package/dist/architecture/modules.d.ts +2 -2
- package/dist/architecture/modules.js +11 -3
- package/dist/bin.js +17 -5
- package/dist/cli.d.ts +2 -2
- package/dist/cli.js +4 -1
- package/dist/composers/root.js +1 -0
- package/dist/dependencies.d.ts +2 -0
- package/dist/dependencies.js +8 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/prompts.d.ts +1 -1
- package/dist/scaffold.d.ts +8 -0
- package/dist/scaffold.js +320 -38
- package/dist/templates/api.js +8 -0
- package/dist/templates/desktop.js +78 -11
- package/dist/templates/electron-updater.d.ts +3 -0
- package/dist/templates/electron-updater.js +358 -0
- package/dist/templates/shared.js +23 -6
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/conventions.md +4 -1
- package/docs/master-stack-map.md +199 -0
- package/docs/output-tree-contract.md +45 -5
- package/{references → docs/references}/manual-scaffolding.md +24 -7
- package/docs/references/provisioning.md +220 -0
- package/package.json +12 -5
- package/scripts/render-master-stack-map.mjs +510 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,41 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
6
6
|
|
|
7
7
|
## Unreleased
|
|
8
8
|
|
|
9
|
+
## 0.4.1 - 2026-07-22
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Add the public launch artwork, reusable stack-map renderer, and expanded brand asset library to the repository and published package.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- Present Anhedral as a cross-platform, modular product stack that lets teams build once, ship everywhere, and scale without repeating framework setup.
|
|
18
|
+
- Automatically create patch versions for ordinary changes merged to `main`, while preserving explicitly declared minor and major releases.
|
|
19
|
+
- Keep project upgrades compatible across automatic patch releases and retain the supported 0.3-to-0.4 ownership migration.
|
|
20
|
+
- Publish from the exact generated release commit and attach npm provenance now that the source repository is public.
|
|
21
|
+
|
|
22
|
+
## 0.4.0 - 2026-07-22
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- Add the `electron-updater` feature module, including packaged-app update checks, private R2 storage, a read-only bound Cloudflare Worker on a custom domain, ordered architecture-specific publishing commands, and a complete generated release runbook.
|
|
27
|
+
- Make the `anhedral-init` coding-agent skill the recommended setup path, with project/domain intake, Computer Use and subagent orchestration, provider provisioning order, authentication and secret-generation stops, and verified Cloudflare/Vercel domain handoffs.
|
|
28
|
+
- Add the canonical fixed-width master stack map to the published documentation and route the coding-agent skill through it for whole-platform planning and explanation.
|
|
29
|
+
- Add a transactional project-upgrade path so compatible 0.3 projects can adopt 0.4 without regeneration.
|
|
30
|
+
- Add a focused default development loop for the primary web and API surfaces, with `dev:all` available for intentionally launching every selected client.
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
|
|
34
|
+
- Make generated onboarding follow the real environment, managed-Neon, verification, and framework source layout instead of promising an unconfigured one-command boot.
|
|
35
|
+
- Treat developer extension points as user-owned source while retaining conflict protection for generated wiring and mergeable workspace configuration.
|
|
36
|
+
- Publish the skill's provisioning references from their canonical `docs/references` location and validate every packed local documentation link.
|
|
37
|
+
- Upgrade GitHub artifact transfer actions to their Node.js 24-native releases and keep manual npm publication routed through the trusted-publisher workflow identity.
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
|
|
41
|
+
- Canonicalize module ordering when an incremental feature contributes a previously absent dependency.
|
|
42
|
+
- Attach release integrity metadata beside the npm tarball in GitHub Releases.
|
|
43
|
+
|
|
9
44
|
## 0.3.0 - 2026-07-21
|
|
10
45
|
|
|
11
46
|
### Added
|
package/CONTRIBUTING.md
CHANGED
|
@@ -67,4 +67,7 @@ Scheduled Toolchain Drift failures and release-workflow failures must alert the
|
|
|
67
67
|
|
|
68
68
|
Do not run `npm publish` from a development checkout. Version changes are reviewed before release, and CI publishes the verified tarball. See [docs/RELEASING.md](docs/RELEASING.md).
|
|
69
69
|
|
|
70
|
-
This repository and package are
|
|
70
|
+
This repository and package are licensed under the Apache License 2.0. Unless
|
|
71
|
+
explicitly stated otherwise, contributions intentionally submitted for
|
|
72
|
+
inclusion in Anhedral are provided under the same license, as described in
|
|
73
|
+
Section 5 of [LICENSE](LICENSE).
|
package/LICENSE
CHANGED
|
@@ -1,26 +1,201 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
or
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Anhedral, Inc.
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -5,22 +5,59 @@
|
|
|
5
5
|
|
|
6
6
|
Anhedral generates a complete, production-oriented TypeScript stack whose source code stays understandable and customizable.
|
|
7
7
|
|
|
8
|
-
> **
|
|
8
|
+
> **Build once. Ship everywhere. Scale is built in.** Pick the platforms,
|
|
9
|
+
> frameworks, and features your product needs; Anhedral assembles them into a
|
|
10
|
+
> production-ready TypeScript workspace for web, iOS, Android, desktop, APIs,
|
|
11
|
+
> and browser extensions. Start free, skip months of repetitive setup and
|
|
12
|
+
> integration work, and focus on what makes your app unique.
|
|
13
|
+
|
|
14
|
+

|
|
9
15
|
|
|
10
16
|
Anhedral is not a new programming language and generated applications do not run inside a proprietary application framework. It assembles well-documented tools, connects their difficult integration boundaries, and leaves developers with ordinary Next.js, Expo Router, Fastify, Drizzle, Electron, and WXT projects.
|
|
11
17
|
|
|
12
|
-
|
|
18
|
+
Anhedral is open source under the [Apache License 2.0](LICENSE). You may use,
|
|
19
|
+
modify, and distribute it subject to that license, including its notice and
|
|
20
|
+
redistribution requirements. Generated applications remain ordinary project
|
|
21
|
+
source that their developers can customize and license for their products.
|
|
22
|
+
|
|
23
|
+
## Recommended: use the coding-agent skill
|
|
24
|
+
|
|
25
|
+
Install the Anhedral skill for Codex, Claude Code, or another compatible coding
|
|
26
|
+
agent:
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
pnpm dlx skills add https://github.com/anhedral/anhedral-init --skill anhedral-init
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Choose the agent and global or project scope when prompted. Then ask the agent:
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
Use $anhedral-init to create and provision my application.
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The skill begins by asking for the project name and whether you already own a
|
|
39
|
+
custom domain. It selects the CLI command with you, detects Computer Use and
|
|
40
|
+
subagent support, generates the project, and walks through the selected cloud
|
|
41
|
+
providers. It pauses for sign-in, MFA, payments, secret generation, and final
|
|
42
|
+
release submissions. Paste secrets directly into the instructed uncommitted
|
|
43
|
+
`.env` file or protected provider field—never into chat.
|
|
13
44
|
|
|
14
|
-
## Create an application
|
|
45
|
+
## Create an application directly
|
|
15
46
|
|
|
16
47
|
Create the complete stack:
|
|
17
48
|
|
|
18
49
|
```sh
|
|
19
50
|
pnpm dlx anhedral@latest new my-product
|
|
20
51
|
cd my-product
|
|
21
|
-
pnpm dev
|
|
22
52
|
```
|
|
23
53
|
|
|
54
|
+
The generated `README.md` contains the exact next steps for the selected stack.
|
|
55
|
+
For the complete stack, copy the package-local environment examples, configure
|
|
56
|
+
the selected managed providers—including a Neon `DATABASE_URL`—and create the
|
|
57
|
+
reviewed initial migration before running `pnpm dev`. Anhedral intentionally
|
|
58
|
+
does not generate a local Postgres substitute or pretend that production
|
|
59
|
+
provider credentials already exist.
|
|
60
|
+
|
|
24
61
|
With no module flags, `new` includes every supported application surface and backend capability. Generate a focused stack by naming only what the product needs:
|
|
25
62
|
|
|
26
63
|
```sh
|
|
@@ -45,10 +82,11 @@ my-product/
|
|
|
45
82
|
├── apps/
|
|
46
83
|
│ ├── web/ # Next.js App Router + source-owned shadcn/ui
|
|
47
84
|
│ ├── mobile/ # Expo Router + React Native Reusables
|
|
48
|
-
│ ├── api/ # Fastify routes,
|
|
85
|
+
│ ├── api/ # Fastify routes, backend modules, auth, providers
|
|
49
86
|
│ ├── desktop/ # Electron + React
|
|
50
87
|
│ ├── extension/ # WXT browser extension
|
|
51
|
-
│
|
|
88
|
+
│ ├── assets-private-proxy/ # Cloudflare Worker for private asset delivery
|
|
89
|
+
│ └── desktop-updater-worker/ # private R2 Electron update delivery
|
|
52
90
|
├── packages/
|
|
53
91
|
│ ├── contracts/ # shared Zod network contracts
|
|
54
92
|
│ ├── api-client/ # typed client used by every frontend
|
|
@@ -80,7 +118,7 @@ export default function ProjectsPage() {
|
|
|
80
118
|
```
|
|
81
119
|
|
|
82
120
|
```ts
|
|
83
|
-
// packages/contracts/src/
|
|
121
|
+
// packages/contracts/src/app.ts
|
|
84
122
|
import { z } from 'zod';
|
|
85
123
|
|
|
86
124
|
export const ProjectSchema = z.object({ id: z.string(), name: z.string() });
|
|
@@ -88,13 +126,24 @@ export const ProjectListSchema = z.array(ProjectSchema);
|
|
|
88
126
|
```
|
|
89
127
|
|
|
90
128
|
```ts
|
|
91
|
-
//
|
|
129
|
+
// packages/db/src/app-schema.ts
|
|
130
|
+
import { pgTable, text } from 'drizzle-orm/pg-core';
|
|
131
|
+
|
|
132
|
+
export const projects = pgTable('projects', {
|
|
133
|
+
id: text('id').primaryKey(),
|
|
134
|
+
name: text('name').notNull(),
|
|
135
|
+
});
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
// apps/api/src/routes/app.ts
|
|
140
|
+
import type { FastifyPluginAsync } from 'fastify';
|
|
92
141
|
import { db } from '@shared/db';
|
|
93
142
|
import { projects } from '@shared/db/schema';
|
|
94
143
|
|
|
95
|
-
export async
|
|
96
|
-
|
|
97
|
-
}
|
|
144
|
+
export const appRoutes: FastifyPluginAsync = async (app) => {
|
|
145
|
+
app.get('/projects', async () => db.select().from(projects));
|
|
146
|
+
};
|
|
98
147
|
```
|
|
99
148
|
|
|
100
149
|
The convention is a conventional vertical flow, not an Anhedral DSL:
|
|
@@ -105,8 +154,8 @@ contracts -> database/service -> Fastify route -> typed API client -> frontend
|
|
|
105
154
|
|
|
106
155
|
- Write web product code under `apps/web` using Next.js conventions.
|
|
107
156
|
- Write mobile product code under `apps/mobile` using Expo Router conventions.
|
|
108
|
-
-
|
|
109
|
-
- Write tables and queries under `packages/db` using Drizzle conventions.
|
|
157
|
+
- Register product routes in `apps/api/src/routes/app.ts` and add server-only feature modules under `apps/api/src` using Fastify conventions.
|
|
158
|
+
- Write product tables in `packages/db/src/app-schema.ts` and queries under `packages/db` using Drizzle conventions.
|
|
110
159
|
- Share only network contracts and client-safe packages with frontends.
|
|
111
160
|
- Import the underlying framework directly whenever its API is the right tool.
|
|
112
161
|
|
|
@@ -121,8 +170,9 @@ contracts -> database/service -> Fastify route -> typed API client -> frontend
|
|
|
121
170
|
| Authentication | Clerk | Connected frontend and backend identity/session flows |
|
|
122
171
|
| UI | shadcn/ui + React Native Reusables | Accessible source code the application owns |
|
|
123
172
|
| Storage | private Cloudflare R2 | Signed uploads and controlled asset delivery |
|
|
124
|
-
| Billing/realtime | RevenueCat + Ably |
|
|
173
|
+
| Billing/realtime | RevenueCat + Stripe + Ably | Unified billing entitlements and realtime invalidation |
|
|
125
174
|
| Desktop | Electron | Predictable cross-platform TypeScript desktop runtime |
|
|
175
|
+
| Desktop updates | electron-updater + private R2 + Worker | Signed automatic updates through a product-owned custom domain |
|
|
126
176
|
| Extension | WXT | Browser-extension entrypoints, builds, and packaging |
|
|
127
177
|
| Workspace | pnpm + Turborepo | Strict dependencies and dependency-aware tasks |
|
|
128
178
|
|
|
@@ -135,6 +185,7 @@ anhedral new <directory> [modules...] Generate a new readable workspace
|
|
|
135
185
|
anhedral init [modules...] Generate in the current empty directory
|
|
136
186
|
anhedral add <module...> Add connected stack capabilities
|
|
137
187
|
anhedral ui add <component...> Add source-owned UI components
|
|
188
|
+
anhedral upgrade Transactionally upgrade a supported project
|
|
138
189
|
anhedral doctor Check ownership and generator drift
|
|
139
190
|
```
|
|
140
191
|
|
|
@@ -143,8 +194,10 @@ Useful examples:
|
|
|
143
194
|
```sh
|
|
144
195
|
anhedral add storage --dry-run
|
|
145
196
|
anhedral add desktop extension
|
|
197
|
+
anhedral add electron-updater
|
|
146
198
|
anhedral ui add button dialog
|
|
147
199
|
anhedral ui add data-table --target web --dry-run
|
|
200
|
+
anhedral upgrade --dry-run
|
|
148
201
|
anhedral doctor --json
|
|
149
202
|
```
|
|
150
203
|
|
|
@@ -154,6 +207,7 @@ Application lifecycle commands remain visible in the generated root `package.jso
|
|
|
154
207
|
|
|
155
208
|
```sh
|
|
156
209
|
pnpm dev
|
|
210
|
+
pnpm dev:all
|
|
157
211
|
pnpm dev:web
|
|
158
212
|
pnpm dev:api
|
|
159
213
|
pnpm typecheck
|
|
@@ -163,7 +217,11 @@ pnpm db:generate
|
|
|
163
217
|
pnpm db:migrate
|
|
164
218
|
```
|
|
165
219
|
|
|
166
|
-
|
|
220
|
+
`pnpm dev` starts the primary product loop: the first selected client plus the
|
|
221
|
+
API when present, or the API by itself for backend-only projects. In the full
|
|
222
|
+
stack that means web plus API. `pnpm dev:all` appears only when the project has
|
|
223
|
+
additional surfaces and intentionally starts all of them. Only commands
|
|
224
|
+
relevant to selected modules are generated.
|
|
167
225
|
|
|
168
226
|
## Extensibility and ownership
|
|
169
227
|
|
|
@@ -182,6 +240,8 @@ anhedral doctor
|
|
|
182
240
|
anhedral add <module> --dry-run
|
|
183
241
|
```
|
|
184
242
|
|
|
243
|
+
When `doctor` reports that a project was generated by a supported older release, run `anhedral upgrade --dry-run`, inspect the plan, and then run `anhedral upgrade`. Version 0.4 supports transactional upgrades from 0.3 projects while preserving user-owned extension seams. If a 0.3 project changed a file that was generator-managed, the upgrade stops instead of overwriting it. Preserve the change in source control, restore that managed file to its recorded 0.3 content, run the upgrade, and then move the product behavior into the new user-owned `app.ts`, `app-schema.ts`, page, component, or `app-window.ts` seam.
|
|
244
|
+
|
|
185
245
|
## Documentation contract
|
|
186
246
|
|
|
187
247
|
Every generated project teaches both humans and coding agents how to work in it:
|
|
@@ -194,6 +254,9 @@ Every generated project teaches both humans and coding agents how to work in it:
|
|
|
194
254
|
|
|
195
255
|
The generator's exact output contract is documented in [docs/output-tree-contract.md](docs/output-tree-contract.md). Contributor architecture remains available in the [source repository](https://github.com/anhedral/anhedral-init/tree/main/docs/architecture).
|
|
196
256
|
|
|
257
|
+
The complete lifecycle, runtime, cloud, command, and coding-agent topology is in
|
|
258
|
+
the [Anhedral master stack map](docs/master-stack-map.md).
|
|
259
|
+
|
|
197
260
|
## Module dependency rules
|
|
198
261
|
|
|
199
262
|
Anhedral resolves integrations as a deterministic graph:
|
|
@@ -203,6 +266,7 @@ auth -> api + db
|
|
|
203
266
|
billing -> auth
|
|
204
267
|
storage -> auth
|
|
205
268
|
native-subscriptions -> mobile + billing
|
|
269
|
+
electron-updater -> desktop
|
|
206
270
|
```
|
|
207
271
|
|
|
208
272
|
Adding a capability brings the infrastructure it actually requires. Unselected providers do not leave dead source files or environment placeholders behind.
|
package/SECURITY.md
CHANGED
|
@@ -15,7 +15,7 @@ Include the affected version, reproduction steps, impact, and any suggested miti
|
|
|
15
15
|
- Release artifacts are built and tested in a read-only job.
|
|
16
16
|
- The exact tarball uploaded by CI is the artifact submitted to npm.
|
|
17
17
|
- npm integrity is checked before and after publication.
|
|
18
|
-
- npm
|
|
18
|
+
- npm publication uses Trusted Publishing: GitHub exchanges an OIDC identity for a short-lived credential only in the publish step of the protected `npm` environment. No npm write token is stored in GitHub.
|
|
19
19
|
- A Git tag and GitHub release are created only after npm confirms the expected artifact integrity.
|
|
20
20
|
- GitHub Actions are pinned to reviewed commit SHAs, and the release Node.js/npm packer is pinned to an exact version.
|
|
21
21
|
- CI queries OSV for every exact package version in `pnpm-lock.yaml` and every dependency version shipped by the generator; it fails closed if the service remains unavailable after bounded retries or reports a finding.
|
|
@@ -32,4 +32,6 @@ UI component installation is an explicit networked supply-chain operation. Anhed
|
|
|
32
32
|
|
|
33
33
|
If a secret-shaped finding is real, do not merely remove it from the latest commit. Revoke or rotate the credential first, identify every log, artifact, cache, fork, and package version that may contain it, and coordinate history or artifact cleanup with the security responder. Treat false positives by changing the example to an unmistakable placeholder; do not add broad path exclusions.
|
|
34
34
|
|
|
35
|
-
Anhedral is
|
|
35
|
+
Anhedral is licensed under the Apache License 2.0. Security research must still
|
|
36
|
+
comply with applicable law and the systems owner's authorization; the software
|
|
37
|
+
license does not authorize testing infrastructure or accounts you do not own.
|