@treeseed/core 0.6.3 → 0.6.4

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.
@@ -1,6 +1,5 @@
1
1
  ---
2
2
  import {
3
- TREESEED_PUBLIC_FORMS_LOCAL_BYPASS_TURNSTILE,
4
3
  TREESEED_PUBLIC_TURNSTILE_SITE_KEY,
5
4
  } from 'astro:env/client';
6
5
  import { CONTACT_TYPE_LABELS } from '../../utils/forms/constants';
@@ -25,7 +24,7 @@ const messages: Record<string, string> = {
25
24
  };
26
25
 
27
26
  const statusMessage = code ? messages[code] ?? null : null;
28
- const shouldBypassTurnstile = TREESEED_PUBLIC_FORMS_LOCAL_BYPASS_TURNSTILE ?? import.meta.env.DEV;
27
+ const shouldBypassTurnstile = import.meta.env.DEV;
29
28
  const formsApiBaseUrl = SITE_FORMS?.apiBaseUrl ?? '/api/form/submit';
30
29
  ---
31
30
 
@@ -1,6 +1,5 @@
1
1
  ---
2
2
  import {
3
- TREESEED_PUBLIC_FORMS_LOCAL_BYPASS_TURNSTILE,
4
3
  TREESEED_PUBLIC_TURNSTILE_SITE_KEY,
5
4
  } from 'astro:env/client';
6
5
  import { FORM_CODE_PARAM, FORM_SUCCESS_PARAM, SUBSCRIBE_ANCHOR_ID } from '../../utils/forms/constants';
@@ -8,7 +7,7 @@ import { SITE_FORMS } from '../../utils/site-config';
8
7
 
9
8
  const { currentPath = '/' } = Astro.props as { currentPath?: string };
10
9
  const redirectTarget = `${currentPath}#${SUBSCRIBE_ANCHOR_ID}`;
11
- const shouldBypassTurnstile = TREESEED_PUBLIC_FORMS_LOCAL_BYPASS_TURNSTILE ?? import.meta.env.DEV;
10
+ const shouldBypassTurnstile = import.meta.env.DEV;
12
11
  const formsApiBaseUrl = SITE_FORMS?.apiBaseUrl ?? '/api/form/submit';
13
12
  ---
14
13
 
package/dist/env.yaml CHANGED
@@ -22,6 +22,70 @@ entries:
22
22
  sourcePriority:
23
23
  - machine-config
24
24
  - process-env
25
+ TREESEED_GITHUB_OWNER:
26
+ label: GitHub repository owner
27
+ group: github
28
+ description: GitHub user or organization that owns the Treeseed repository used for bootstrap, CI/CD, and environment sync.
29
+ howToGet: Treeseed suggests this from the origin remote when available. Otherwise enter the GitHub user or organization that should own the repository.
30
+ sensitivity: plain
31
+ targets:
32
+ - local-runtime
33
+ scopes:
34
+ - local
35
+ storage: scoped
36
+ requirement: required
37
+ purposes:
38
+ - config
39
+ validation:
40
+ kind: nonempty
41
+ sourcePriority:
42
+ - machine-config
43
+ - process-env
44
+ defaultValueRef: githubOwnerDefault
45
+ TREESEED_GITHUB_REPOSITORY_NAME:
46
+ label: GitHub repository name
47
+ group: github
48
+ description: GitHub repository name Treeseed should verify or create before GitHub bootstrap.
49
+ howToGet: Treeseed suggests this from the origin remote when available and otherwise defaults it from the site slug.
50
+ sensitivity: plain
51
+ targets:
52
+ - local-runtime
53
+ scopes:
54
+ - local
55
+ storage: scoped
56
+ requirement: required
57
+ purposes:
58
+ - config
59
+ validation:
60
+ kind: nonempty
61
+ sourcePriority:
62
+ - machine-config
63
+ - process-env
64
+ defaultValueRef: githubRepositoryNameDefault
65
+ TREESEED_GITHUB_REPOSITORY_VISIBILITY:
66
+ label: GitHub repository visibility
67
+ group: github
68
+ description: Visibility to use if Treeseed needs to create the GitHub repository during bootstrap.
69
+ howToGet: Choose private, public, or internal. Treeseed defaults new repositories to private.
70
+ sensitivity: plain
71
+ targets:
72
+ - local-runtime
73
+ scopes:
74
+ - local
75
+ storage: scoped
76
+ requirement: optional
77
+ purposes:
78
+ - config
79
+ validation:
80
+ kind: enum
81
+ values:
82
+ - private
83
+ - public
84
+ - internal
85
+ sourcePriority:
86
+ - machine-config
87
+ - process-env
88
+ defaultValueRef: githubRepositoryVisibilityDefault
25
89
  CLOUDFLARE_API_TOKEN:
26
90
  label: Cloudflare API token
27
91
  group: auth
@@ -32,7 +96,6 @@ entries:
32
96
  - local-runtime
33
97
  - github-secret
34
98
  scopes:
35
- - local
36
99
  - staging
37
100
  - prod
38
101
  requirement: required
@@ -51,13 +114,12 @@ entries:
51
114
  label: Railway API token
52
115
  group: auth
53
116
  description: Primary Railway token for user or workspace scoped access, including project creation and most Treeseed-managed Railway flows.
54
- howToGet: In Railway, create a user or workspace API token that can create and manage the target project, then paste it here. Treeseed also accepts the legacy alias RAILWAY_API_KEY from process env.
117
+ howToGet: In Railway, create a user or workspace API token that can create and manage the target project, then paste it here.
55
118
  sensitivity: secret
56
119
  targets:
57
120
  - local-runtime
58
121
  - railway-secret
59
122
  scopes:
60
- - local
61
123
  - staging
62
124
  - prod
63
125
  requirement: conditional
@@ -80,10 +142,8 @@ entries:
80
142
  howToGet: In Railway, use the workspace slug or name shown in the workspace switcher. Treeseed defaults this repository to knowledge-coop unless you override it here.
81
143
  sensitivity: plain
82
144
  targets:
83
- - local-runtime
84
145
  - railway-var
85
146
  scopes:
86
- - local
87
147
  - staging
88
148
  - prod
89
149
  storage: shared
@@ -161,18 +221,14 @@ entries:
161
221
  howToGet: Create a Turnstile widget in Cloudflare Turnstile and copy the site key.
162
222
  sensitivity: plain
163
223
  targets:
164
- - local-runtime
165
- - local-cloudflare
166
224
  - github-variable
167
225
  - cloudflare-var
168
226
  scopes:
169
- - local
170
227
  - staging
171
228
  - prod
172
229
  storage: shared
173
230
  requirement: conditional
174
231
  purposes:
175
- - dev
176
232
  - save
177
233
  - deploy
178
234
  - config
@@ -190,18 +246,14 @@ entries:
190
246
  howToGet: Create a Turnstile widget in Cloudflare Turnstile and copy the secret key.
191
247
  sensitivity: secret
192
248
  targets:
193
- - local-runtime
194
- - local-cloudflare
195
249
  - github-secret
196
250
  - cloudflare-secret
197
251
  scopes:
198
- - local
199
252
  - staging
200
253
  - prod
201
254
  storage: shared
202
255
  requirement: conditional
203
256
  purposes:
204
- - dev
205
257
  - save
206
258
  - deploy
207
259
  - config
@@ -212,27 +264,6 @@ entries:
212
264
  - process-env
213
265
  relevanceRef: turnstileEnabled
214
266
  requiredWhenRef: turnstileNonLocal
215
- TREESEED_PUBLIC_FORMS_LOCAL_BYPASS_TURNSTILE:
216
- label: Local Turnstile bypass
217
- group: local-development
218
- description: Lets contributors edit content and exercise forms locally without a live Turnstile widget.
219
- howToGet: Treeseed defaults this to true for local development. You can switch it off if you want to test with real Turnstile keys locally.
220
- sensitivity: plain
221
- targets:
222
- - local-runtime
223
- - local-cloudflare
224
- scopes:
225
- - local
226
- requirement: optional
227
- purposes:
228
- - dev
229
- - config
230
- validation:
231
- kind: boolean
232
- sourcePriority:
233
- - machine-config
234
- - process-env
235
- localDefaultValueRef: localFormsBypassDefault
236
267
  TREESEED_SMTP_HOST:
237
268
  label: SMTP host
238
269
  group: smtp
@@ -46,8 +46,6 @@ export function isWorkspaceRoot(root = process.cwd()) {
46
46
  export function createProductionBuildEnv(extraEnv = {}) {
47
47
  return {
48
48
  TREESEED_LOCAL_DEV_MODE: 'cloudflare',
49
- TREESEED_PUBLIC_FORMS_LOCAL_BYPASS_TURNSTILE: '',
50
- TREESEED_FORMS_LOCAL_BYPASS_TURNSTILE: '',
51
49
  TREESEED_FORMS_LOCAL_BYPASS_CLOUDFLARE_GUARDS: '',
52
50
  TREESEED_PUBLIC_DEV_WATCH_RELOAD: '',
53
51
  ...extraEnv,
package/dist/site.js CHANGED
@@ -275,7 +275,6 @@ function createTreeseedSite(tenantConfig, { starlight }) {
275
275
  env: {
276
276
  schema: {
277
277
  TREESEED_PUBLIC_TURNSTILE_SITE_KEY: envField.string({ context: "client", access: "public", optional: true }),
278
- TREESEED_PUBLIC_FORMS_LOCAL_BYPASS_TURNSTILE: envField.boolean({ context: "client", access: "public", optional: true }),
279
278
  TREESEED_PUBLIC_DEV_WATCH_RELOAD: envField.boolean({ context: "client", access: "public", optional: true }),
280
279
  TREESEED_TURNSTILE_SECRET_KEY: envField.string({ context: "server", access: "secret", optional: true }),
281
280
  TREESEED_SMTP_HOST: envField.string({ context: "server", access: "secret", optional: true }),
@@ -293,7 +292,6 @@ function createTreeseedSite(tenantConfig, { starlight }) {
293
292
  TREESEED_CONTENT_MANIFEST_KEY_TEMPLATE: envField.string({ context: "server", access: "secret", optional: true }),
294
293
  TREESEED_CONTENT_PREVIEW_ROOT_TEMPLATE: envField.string({ context: "server", access: "secret", optional: true }),
295
294
  TREESEED_LOCAL_DEV_MODE: envField.enum({ values: ["cloudflare"], context: "server", access: "secret", optional: true }),
296
- TREESEED_FORMS_LOCAL_BYPASS_TURNSTILE: envField.boolean({ context: "server", access: "secret", optional: true }),
297
295
  TREESEED_FORMS_LOCAL_BYPASS_CLOUDFLARE_GUARDS: envField.boolean({ context: "server", access: "secret", optional: true }),
298
296
  TREESEED_FORMS_LOCAL_USE_MAILPIT: envField.boolean({ context: "server", access: "secret", optional: true }),
299
297
  TREESEED_MAILPIT_SMTP_HOST: envField.string({ context: "server", access: "secret", optional: true }),
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  TREESEED_FORM_TOKEN_SECRET,
3
3
  TREESEED_FORMS_LOCAL_BYPASS_CLOUDFLARE_GUARDS,
4
- TREESEED_FORMS_LOCAL_BYPASS_TURNSTILE,
5
4
  TREESEED_FORMS_LOCAL_USE_MAILPIT,
6
5
  TREESEED_LOCAL_DEV_MODE,
7
6
  TREESEED_MAILPIT_SMTP_HOST,
@@ -52,9 +51,6 @@ function getLocalDevMode() {
52
51
  }
53
52
  return null;
54
53
  }
55
- function shouldBypassTurnstileByEnv() {
56
- return TREESEED_FORMS_LOCAL_BYPASS_TURNSTILE;
57
- }
58
54
  function shouldBypassCloudflareGuardsByEnv() {
59
55
  return TREESEED_FORMS_LOCAL_BYPASS_CLOUDFLARE_GUARDS;
60
56
  }
@@ -86,6 +82,5 @@ export {
86
82
  isSmtpEnabled,
87
83
  isTurnstileEnabled,
88
84
  shouldBypassCloudflareGuardsByEnv,
89
- shouldBypassTurnstileByEnv,
90
85
  shouldUseMailpit
91
86
  };
@@ -4,12 +4,12 @@ function deriveFormRuntimeCapabilities(input) {
4
4
  isCloudflareRuntime: input.isCloudflareRuntime,
5
5
  isLocalMode,
6
6
  localDevMode: input.localDevMode ?? "production",
7
- bypassTurnstile: isLocalMode ? input.bypassTurnstile ?? false : false,
7
+ bypassTurnstile: isLocalMode ? true : false,
8
8
  bypassCloudflareGuards: isLocalMode ? input.bypassCloudflareGuards ?? false : false,
9
9
  useMailpit: isLocalMode ? input.useMailpit : false,
10
10
  formsMode: input.formsMode,
11
11
  smtpEnabled: input.smtpEnabled || (isLocalMode ? input.useMailpit : false),
12
- turnstileEnabled: input.turnstileEnabled
12
+ turnstileEnabled: isLocalMode ? false : input.turnstileEnabled
13
13
  };
14
14
  }
15
15
  export {
@@ -4,7 +4,6 @@ import {
4
4
  isSmtpEnabled,
5
5
  isTurnstileEnabled,
6
6
  shouldBypassCloudflareGuardsByEnv,
7
- shouldBypassTurnstileByEnv,
8
7
  shouldUseMailpit
9
8
  } from "./config.js";
10
9
  import { deriveFormRuntimeCapabilities } from "./runtime-core.js";
@@ -14,7 +13,6 @@ function resolveFormRuntimeCapabilities(locals) {
14
13
  isCloudflareRuntime: Boolean(runtime?.env?.FORM_GUARD_KV && runtime?.env?.SITE_DATA_DB),
15
14
  localDevMode: getLocalDevMode(),
16
15
  isDevServer: import.meta.env.DEV,
17
- bypassTurnstile: shouldBypassTurnstileByEnv(),
18
16
  bypassCloudflareGuards: shouldBypassCloudflareGuardsByEnv(),
19
17
  useMailpit: shouldUseMailpit(),
20
18
  formsMode: getFormsMode(),
@@ -67,7 +67,6 @@ function buildRuntime(env) {
67
67
  isCloudflareRuntime: true,
68
68
  localDevMode: env.TREESEED_LOCAL_DEV_MODE === "cloudflare" ? "cloudflare" : null,
69
69
  isDevServer: false,
70
- bypassTurnstile: envBoolean(env.TREESEED_FORMS_LOCAL_BYPASS_TURNSTILE),
71
70
  bypassCloudflareGuards: envBoolean(env.TREESEED_FORMS_LOCAL_BYPASS_CLOUDFLARE_GUARDS),
72
71
  useMailpit: envBoolean(env.TREESEED_FORMS_LOCAL_USE_MAILPIT),
73
72
  formsMode: __TREESEED_DEPLOY_CONFIG__.providers?.forms ?? "store_only",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treeseed/core",
3
- "version": "0.6.3",
3
+ "version": "0.6.4",
4
4
  "description": "Treeseed integrated platform starter for Astro/Starlight web runtimes and Hono API runtimes.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {
@@ -75,7 +75,7 @@
75
75
  "@astrojs/sitemap": "3.7.0",
76
76
  "@astrojs/starlight": "0.37.6",
77
77
  "@tailwindcss/vite": "^4.1.4",
78
- "@treeseed/sdk": "^0.6.1",
78
+ "@treeseed/sdk": "^0.6.2",
79
79
  "astro": "^5.6.1",
80
80
  "esbuild": "^0.28.0",
81
81
  "hono": "^4.8.2",
@@ -188,12 +188,12 @@ __WORKING_DIRECTORY_BLOCK__
188
188
  TREESEED_EDITORIAL_PREVIEW_SECRET: ${{ secrets.TREESEED_EDITORIAL_PREVIEW_SECRET }}
189
189
  TREESEED_PUBLIC_TURNSTILE_SITE_KEY: ${{ vars.TREESEED_PUBLIC_TURNSTILE_SITE_KEY }}
190
190
  TREESEED_TURNSTILE_SECRET_KEY: ${{ secrets.TREESEED_TURNSTILE_SECRET_KEY }}
191
- TREESEED_SMTP_HOST: ${{ secrets.TREESEED_SMTP_HOST }}
192
- TREESEED_SMTP_PORT: ${{ secrets.TREESEED_SMTP_PORT }}
193
- TREESEED_SMTP_USERNAME: ${{ secrets.TREESEED_SMTP_USERNAME }}
191
+ TREESEED_SMTP_HOST: ${{ vars.TREESEED_SMTP_HOST }}
192
+ TREESEED_SMTP_PORT: ${{ vars.TREESEED_SMTP_PORT }}
193
+ TREESEED_SMTP_USERNAME: ${{ vars.TREESEED_SMTP_USERNAME }}
194
194
  TREESEED_SMTP_PASSWORD: ${{ secrets.TREESEED_SMTP_PASSWORD }}
195
- TREESEED_SMTP_FROM: ${{ secrets.TREESEED_SMTP_FROM }}
196
- TREESEED_SMTP_REPLY_TO: ${{ secrets.TREESEED_SMTP_REPLY_TO }}
195
+ TREESEED_SMTP_FROM: ${{ vars.TREESEED_SMTP_FROM }}
196
+ TREESEED_SMTP_REPLY_TO: ${{ vars.TREESEED_SMTP_REPLY_TO }}
197
197
  RAILWAY_API_TOKEN: ${{ secrets.RAILWAY_API_TOKEN }}
198
198
  TREESEED_MARKET_API_BASE_URL: ${{ vars.TREESEED_MARKET_API_BASE_URL }}
199
199
  TREESEED_PROJECT_ID: ${{ inputs.project_id || vars.TREESEED_PROJECT_ID }}
@@ -262,12 +262,12 @@ __WORKING_DIRECTORY_BLOCK__
262
262
  TREESEED_EDITORIAL_PREVIEW_SECRET: ${{ secrets.TREESEED_EDITORIAL_PREVIEW_SECRET }}
263
263
  TREESEED_PUBLIC_TURNSTILE_SITE_KEY: ${{ vars.TREESEED_PUBLIC_TURNSTILE_SITE_KEY }}
264
264
  TREESEED_TURNSTILE_SECRET_KEY: ${{ secrets.TREESEED_TURNSTILE_SECRET_KEY }}
265
- TREESEED_SMTP_HOST: ${{ secrets.TREESEED_SMTP_HOST }}
266
- TREESEED_SMTP_PORT: ${{ secrets.TREESEED_SMTP_PORT }}
267
- TREESEED_SMTP_USERNAME: ${{ secrets.TREESEED_SMTP_USERNAME }}
265
+ TREESEED_SMTP_HOST: ${{ vars.TREESEED_SMTP_HOST }}
266
+ TREESEED_SMTP_PORT: ${{ vars.TREESEED_SMTP_PORT }}
267
+ TREESEED_SMTP_USERNAME: ${{ vars.TREESEED_SMTP_USERNAME }}
268
268
  TREESEED_SMTP_PASSWORD: ${{ secrets.TREESEED_SMTP_PASSWORD }}
269
- TREESEED_SMTP_FROM: ${{ secrets.TREESEED_SMTP_FROM }}
270
- TREESEED_SMTP_REPLY_TO: ${{ secrets.TREESEED_SMTP_REPLY_TO }}
269
+ TREESEED_SMTP_FROM: ${{ vars.TREESEED_SMTP_FROM }}
270
+ TREESEED_SMTP_REPLY_TO: ${{ vars.TREESEED_SMTP_REPLY_TO }}
271
271
  RAILWAY_API_TOKEN: ${{ secrets.RAILWAY_API_TOKEN }}
272
272
  TREESEED_MARKET_API_BASE_URL: ${{ vars.TREESEED_MARKET_API_BASE_URL }}
273
273
  TREESEED_PROJECT_ID: ${{ inputs.project_id || vars.TREESEED_PROJECT_ID }}
@@ -347,12 +347,12 @@ __WORKING_DIRECTORY_BLOCK__
347
347
  TREESEED_EDITORIAL_PREVIEW_SECRET: ${{ secrets.TREESEED_EDITORIAL_PREVIEW_SECRET }}
348
348
  TREESEED_PUBLIC_TURNSTILE_SITE_KEY: ${{ vars.TREESEED_PUBLIC_TURNSTILE_SITE_KEY }}
349
349
  TREESEED_TURNSTILE_SECRET_KEY: ${{ secrets.TREESEED_TURNSTILE_SECRET_KEY }}
350
- TREESEED_SMTP_HOST: ${{ secrets.TREESEED_SMTP_HOST }}
351
- TREESEED_SMTP_PORT: ${{ secrets.TREESEED_SMTP_PORT }}
352
- TREESEED_SMTP_USERNAME: ${{ secrets.TREESEED_SMTP_USERNAME }}
350
+ TREESEED_SMTP_HOST: ${{ vars.TREESEED_SMTP_HOST }}
351
+ TREESEED_SMTP_PORT: ${{ vars.TREESEED_SMTP_PORT }}
352
+ TREESEED_SMTP_USERNAME: ${{ vars.TREESEED_SMTP_USERNAME }}
353
353
  TREESEED_SMTP_PASSWORD: ${{ secrets.TREESEED_SMTP_PASSWORD }}
354
- TREESEED_SMTP_FROM: ${{ secrets.TREESEED_SMTP_FROM }}
355
- TREESEED_SMTP_REPLY_TO: ${{ secrets.TREESEED_SMTP_REPLY_TO }}
354
+ TREESEED_SMTP_FROM: ${{ vars.TREESEED_SMTP_FROM }}
355
+ TREESEED_SMTP_REPLY_TO: ${{ vars.TREESEED_SMTP_REPLY_TO }}
356
356
  RAILWAY_API_TOKEN: ${{ secrets.RAILWAY_API_TOKEN }}
357
357
  TREESEED_MARKET_API_BASE_URL: ${{ vars.TREESEED_MARKET_API_BASE_URL }}
358
358
  TREESEED_PROJECT_ID: ${{ inputs.project_id || vars.TREESEED_PROJECT_ID }}