@treeseed/sdk 0.6.21 → 0.6.22
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/dist/operations/services/config-runtime.d.ts +1 -0
- package/dist/operations/services/config-runtime.js +44 -0
- package/dist/operations/services/deploy.js +2 -4
- package/dist/operations/services/local-dev.js +2 -2
- package/dist/platform/env.yaml +2 -2
- package/dist/platform/environment.js +4 -4
- package/dist/scripts/test-cloudflare-local.js +2 -3
- package/package.json +1 -1
|
@@ -220,6 +220,7 @@ export declare function resolveTreeseedRemoteConfig(startRoot?: string, env?: No
|
|
|
220
220
|
export declare function resolveTreeseedTemplateCatalogEndpoint(startRoot?: string, env?: NodeJS.ProcessEnv): string;
|
|
221
221
|
export declare function resolveTreeseedTemplateCatalogCachePath(startRoot?: string): string;
|
|
222
222
|
export declare function ensureTreeseedGitignoreEntries(tenantRoot: any): string;
|
|
223
|
+
export declare function ensureTreeseedRailwayIgnoreEntries(tenantRoot: any): string;
|
|
223
224
|
export type TreeseedRepairAction = {
|
|
224
225
|
id: string;
|
|
225
226
|
detail: string;
|
|
@@ -1210,6 +1210,46 @@ function ensureTreeseedGitignoreEntries(tenantRoot) {
|
|
|
1210
1210
|
}
|
|
1211
1211
|
return gitignorePath;
|
|
1212
1212
|
}
|
|
1213
|
+
function ensureTreeseedRailwayIgnoreEntries(tenantRoot) {
|
|
1214
|
+
const railwayIgnorePath = resolve(tenantRoot, ".railwayignore");
|
|
1215
|
+
const requiredEntries = [
|
|
1216
|
+
".astro/",
|
|
1217
|
+
".codex/",
|
|
1218
|
+
".dev.vars",
|
|
1219
|
+
".env.local",
|
|
1220
|
+
".git/",
|
|
1221
|
+
".treeseed/",
|
|
1222
|
+
".wrangler/",
|
|
1223
|
+
"coverage/",
|
|
1224
|
+
"dist/",
|
|
1225
|
+
"node_modules/",
|
|
1226
|
+
"npm-debug.log*",
|
|
1227
|
+
"packages/*/.git/",
|
|
1228
|
+
"packages/*/dist/",
|
|
1229
|
+
"packages/*/node_modules/",
|
|
1230
|
+
"public/__treeseed/*.json",
|
|
1231
|
+
"public/books/*.json",
|
|
1232
|
+
"public/books/*.md",
|
|
1233
|
+
"scripts/.ts-run-*.mjs",
|
|
1234
|
+
"tmp/",
|
|
1235
|
+
"*.log",
|
|
1236
|
+
"*.tgz"
|
|
1237
|
+
];
|
|
1238
|
+
const current = existsSync(railwayIgnorePath) ? readFileSync(railwayIgnorePath, "utf8") : "";
|
|
1239
|
+
const lines = current.split(/\r?\n/);
|
|
1240
|
+
let changed = false;
|
|
1241
|
+
for (const entry of requiredEntries) {
|
|
1242
|
+
if (!lines.includes(entry)) {
|
|
1243
|
+
lines.push(entry);
|
|
1244
|
+
changed = true;
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
if (changed || !existsSync(railwayIgnorePath)) {
|
|
1248
|
+
writeFileSync(railwayIgnorePath, `${lines.filter(Boolean).join("\n")}
|
|
1249
|
+
`, "utf8");
|
|
1250
|
+
}
|
|
1251
|
+
return railwayIgnorePath;
|
|
1252
|
+
}
|
|
1213
1253
|
function dedupeRepairActions(actions) {
|
|
1214
1254
|
const seen = /* @__PURE__ */ new Set();
|
|
1215
1255
|
return actions.filter((action) => {
|
|
@@ -1224,6 +1264,8 @@ function applyTreeseedSafeRepairs(tenantRoot) {
|
|
|
1224
1264
|
const actions = [];
|
|
1225
1265
|
ensureTreeseedGitignoreEntries(tenantRoot);
|
|
1226
1266
|
actions.push({ id: "gitignore", detail: "Ensured Treeseed gitignore entries are present." });
|
|
1267
|
+
ensureTreeseedRailwayIgnoreEntries(tenantRoot);
|
|
1268
|
+
actions.push({ id: "railwayignore", detail: "Ensured Railway deploy ignore entries are present." });
|
|
1227
1269
|
const deprecatedFiles = warnDeprecatedTreeseedLocalEnvFiles(tenantRoot);
|
|
1228
1270
|
if (deprecatedFiles.length > 0) {
|
|
1229
1271
|
actions.push({ id: "deprecated-local-env", detail: "Detected deprecated .env.local/.dev.vars files that Treeseed now ignores." });
|
|
@@ -2382,6 +2424,7 @@ function collectTreeseedConfigContext({
|
|
|
2382
2424
|
env = process.env
|
|
2383
2425
|
}) {
|
|
2384
2426
|
ensureTreeseedGitignoreEntries(tenantRoot);
|
|
2427
|
+
ensureTreeseedRailwayIgnoreEntries(tenantRoot);
|
|
2385
2428
|
const registry = collectTreeseedEnvironmentContext(tenantRoot);
|
|
2386
2429
|
const { configPath, keyPath } = getTreeseedMachineConfigPaths(tenantRoot);
|
|
2387
2430
|
const valuesByScope = Object.fromEntries(
|
|
@@ -2843,6 +2886,7 @@ export {
|
|
|
2843
2886
|
createDefaultTreeseedMachineConfig,
|
|
2844
2887
|
ensureTreeseedActVerificationTooling,
|
|
2845
2888
|
ensureTreeseedGitignoreEntries,
|
|
2889
|
+
ensureTreeseedRailwayIgnoreEntries,
|
|
2846
2890
|
ensureTreeseedSecretSessionForConfig,
|
|
2847
2891
|
finalizeTreeseedConfig,
|
|
2848
2892
|
formatTreeseedConfigEnvironmentReport,
|
|
@@ -325,7 +325,6 @@ const LOCAL_RUNTIME_AUTH_ENV_KEYS = [
|
|
|
325
325
|
"TREESEED_AUTH_INTERNAL_SIGNUP",
|
|
326
326
|
"TREESEED_AUTH_EMAIL_LINKING",
|
|
327
327
|
"TREESEED_AUTH_ALLOW_MEMORY_DB",
|
|
328
|
-
"TREESEED_AUTH_LOCAL_USE_MAILPIT",
|
|
329
328
|
"TREESEED_AUTH_EMAIL_FROM",
|
|
330
329
|
"TREESEED_WEB_SESSION_TTL",
|
|
331
330
|
"TREESEED_API_BOOTSTRAP_ADMIN_ALLOWLIST",
|
|
@@ -362,9 +361,8 @@ function buildLocalRuntimeVars(deployConfig, state, target, env) {
|
|
|
362
361
|
TREESEED_BETTER_AUTH_SECRET: envValue(env, "TREESEED_BETTER_AUTH_SECRET") ?? state.generatedSecrets?.TREESEED_BETTER_AUTH_SECRET ?? state.generatedSecrets?.TREESEED_FORM_TOKEN_SECRET ?? "treeseed-local-better-auth-secret-minimum-32-characters",
|
|
363
362
|
TREESEED_EDITORIAL_PREVIEW_SECRET: envValue(env, "TREESEED_EDITORIAL_PREVIEW_SECRET") ?? state.generatedSecrets?.TREESEED_EDITORIAL_PREVIEW_SECRET ?? "treeseed-local-editorial-preview-secret",
|
|
364
363
|
TREESEED_FORMS_LOCAL_BYPASS_CLOUDFLARE_GUARDS: envValue(env, "TREESEED_FORMS_LOCAL_BYPASS_CLOUDFLARE_GUARDS") ?? "",
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
TREESEED_MAILPIT_SMTP_PORT: envValue(env, "TREESEED_MAILPIT_SMTP_PORT") ?? "1025"
|
|
364
|
+
TREESEED_SMTP_HOST: envValue(env, "TREESEED_SMTP_HOST") ?? "127.0.0.1",
|
|
365
|
+
TREESEED_SMTP_PORT: envValue(env, "TREESEED_SMTP_PORT") ?? "1025"
|
|
368
366
|
};
|
|
369
367
|
}
|
|
370
368
|
function buildSecretMap(deployConfig, state) {
|
|
@@ -47,8 +47,8 @@ function runLocalD1Migration(persistTo) {
|
|
|
47
47
|
}
|
|
48
48
|
function prepareCloudflareLocalRuntime({ envOverrides = {}, persistTo, outDir } = {}) {
|
|
49
49
|
const mergedEnvOverrides = {
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
TREESEED_SMTP_HOST: "127.0.0.1",
|
|
51
|
+
TREESEED_SMTP_PORT: "1025",
|
|
52
52
|
...envOverrides
|
|
53
53
|
};
|
|
54
54
|
runNodeScript("./scripts/patch-starlight-content-path.js");
|
package/dist/platform/env.yaml
CHANGED
|
@@ -929,7 +929,7 @@ entries:
|
|
|
929
929
|
sourcePriority:
|
|
930
930
|
- machine-config
|
|
931
931
|
- process-env
|
|
932
|
-
localDefaultValueRef:
|
|
932
|
+
localDefaultValueRef: localSmtpHostDefault
|
|
933
933
|
relevanceRef: smtpEnabled
|
|
934
934
|
requiredWhenRef: smtpNonLocal
|
|
935
935
|
TREESEED_SMTP_PORT:
|
|
@@ -960,7 +960,7 @@ entries:
|
|
|
960
960
|
sourcePriority:
|
|
961
961
|
- machine-config
|
|
962
962
|
- process-env
|
|
963
|
-
localDefaultValueRef:
|
|
963
|
+
localDefaultValueRef: localSmtpPortDefault
|
|
964
964
|
relevanceRef: smtpEnabled
|
|
965
965
|
requiredWhenRef: smtpNonLocal
|
|
966
966
|
TREESEED_SMTP_USERNAME:
|
|
@@ -108,10 +108,10 @@ function generatedSecret(bytes = 24) {
|
|
|
108
108
|
function localTimezoneDefault() {
|
|
109
109
|
return Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function localSmtpHostDefault() {
|
|
112
112
|
return "127.0.0.1";
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function localSmtpPortDefault() {
|
|
115
115
|
return "1025";
|
|
116
116
|
}
|
|
117
117
|
function contactEmailDefault(context) {
|
|
@@ -232,8 +232,8 @@ function resolveGitHubRepositoryNameDefault(context) {
|
|
|
232
232
|
const VALUE_RESOLVERS = {
|
|
233
233
|
generatedSecret: () => generatedSecret(),
|
|
234
234
|
localFormsBypassDefault: () => "true",
|
|
235
|
-
|
|
236
|
-
|
|
235
|
+
localSmtpHostDefault: () => localSmtpHostDefault(),
|
|
236
|
+
localSmtpPortDefault: () => localSmtpPortDefault(),
|
|
237
237
|
contactEmailDefault: (context) => contactEmailDefault(context),
|
|
238
238
|
projectDomainsDefault: (context) => primaryHostFromUrl(context.deployConfig.siteUrl),
|
|
239
239
|
apiBaseUrlDefault: (context, scope, values) => resolveConfiguredApiBaseUrl(context, scope, values),
|
|
@@ -137,9 +137,8 @@ async function main() {
|
|
|
137
137
|
envOverrides: {
|
|
138
138
|
TREESEED_LOCAL_DEV_MODE: 'cloudflare',
|
|
139
139
|
TREESEED_FORMS_LOCAL_BYPASS_CLOUDFLARE_GUARDS: 'false',
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
TREESEED_MAILPIT_SMTP_PORT: '1025',
|
|
140
|
+
TREESEED_SMTP_HOST: '127.0.0.1',
|
|
141
|
+
TREESEED_SMTP_PORT: '1025',
|
|
143
142
|
},
|
|
144
143
|
});
|
|
145
144
|
const worker = startWranglerDev(['--port', String(TEST_PORT), '--persist-to', PERSIST_TO], {
|