@helloleo/plugins 0.2.9 → 0.2.11

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/index.js CHANGED
@@ -24906,7 +24906,7 @@ var SCAFFOLD_TEMPLATES = {
24906
24906
  };
24907
24907
  var SCAFFOLD_VERSION = SCAFFOLD_TEMPLATES["tanstack-start"];
24908
24908
  function resolveTemplateId() {
24909
- const version3 = process.env.SCAFFOLD_VERSION;
24909
+ const version3 = process.env.PLUGINS_SCAFFOLD_VERSION;
24910
24910
  const known = Object.values(SCAFFOLD_TEMPLATES);
24911
24911
  if (version3 && known.includes(version3))
24912
24912
  return version3;
@@ -24915,6 +24915,10 @@ function resolveTemplateId() {
24915
24915
  function projectUuidFromDir(dir) {
24916
24916
  return path3.basename(dir);
24917
24917
  }
24918
+ function integrationProxyUrl(projectUuid) {
24919
+ const base = (process.env.PLUGINS_INTEGRATION_PROXY_URL || "https://api.app.helloleo.dev").replace(/\/+$/, "");
24920
+ return `${base}/api/integration-proxy/${projectUuid}`;
24921
+ }
24918
24922
  var scaffoldOptionsSchema = exports_external2.object({
24919
24923
  name: exports_external2.string().describe("Human-readable name for SEO, e.g. 'Shipping Platform'"),
24920
24924
  description: exports_external2.string().describe("One sentence describing the app. Used as the meta description.")
@@ -24924,11 +24928,13 @@ function slugify(name) {
24924
24928
  }
24925
24929
  async function writeBaseScaffold({ name, description }, dir) {
24926
24930
  const templateId = resolveTemplateId();
24931
+ const projectUuid = projectUuidFromDir(dir);
24927
24932
  const created = await renderTemplate(templateId, {
24928
24933
  LEO_NAME: name,
24929
24934
  LEO_SLUG: slugify(name),
24930
24935
  LEO_DESCRIPTION: description,
24931
- LEO_PROJECT_UUID: projectUuidFromDir(dir)
24936
+ LEO_PROJECT_UUID: projectUuid,
24937
+ LEO_INTEGRATION_PROXY_URL: integrationProxyUrl(projectUuid)
24932
24938
  }, dir);
24933
24939
  await mkdir(path3.join(dir, ".leo"), { recursive: true });
24934
24940
  const leoPath = path3.join(".leo", "project.json");
@@ -39,8 +39,10 @@
39
39
  * from a Worker. Never embed secrets in frontend code.
40
40
  */
41
41
 
42
- export const INTEGRATION_PROXY_URL =
43
- 'https://api.app.helloleo.dev/api/integration-proxy/{{LEO_PROJECT_UUID}}';
42
+
43
+ export const INTEGRATION_PROXY_URL = '{{LEO_INTEGRATION_PROXY_URL}}';
44
+
45
+ export const BACKEND_URL = (import.meta.env.VITE_WORKER_URL as string | undefined) ?? '';
44
46
 
45
47
  export interface ProxyRequest {
46
48
  integration: string;
@@ -39,8 +39,7 @@
39
39
  * from a Worker. Never embed secrets in frontend code.
40
40
  */
41
41
 
42
- export const INTEGRATION_PROXY_URL =
43
- 'https://api.app.helloleo.dev/api/integration-proxy/{{LEO_PROJECT_UUID}}';
42
+ export const INTEGRATION_PROXY_URL = '{{LEO_INTEGRATION_PROXY_URL}}';
44
43
 
45
44
  export interface ProxyRequest {
46
45
  integration: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helloleo/plugins",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "OpenCode plugins for HelloLeo",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -39,8 +39,10 @@
39
39
  * from a Worker. Never embed secrets in frontend code.
40
40
  */
41
41
 
42
- export const INTEGRATION_PROXY_URL =
43
- 'https://api.app.helloleo.dev/api/integration-proxy/{{LEO_PROJECT_UUID}}';
42
+
43
+ export const INTEGRATION_PROXY_URL = '{{LEO_INTEGRATION_PROXY_URL}}';
44
+
45
+ export const BACKEND_URL = (import.meta.env.VITE_WORKER_URL as string | undefined) ?? '';
44
46
 
45
47
  export interface ProxyRequest {
46
48
  integration: string;
@@ -39,8 +39,7 @@
39
39
  * from a Worker. Never embed secrets in frontend code.
40
40
  */
41
41
 
42
- export const INTEGRATION_PROXY_URL =
43
- 'https://api.app.helloleo.dev/api/integration-proxy/{{LEO_PROJECT_UUID}}';
42
+ export const INTEGRATION_PROXY_URL = '{{LEO_INTEGRATION_PROXY_URL}}';
44
43
 
45
44
  export interface ProxyRequest {
46
45
  integration: string;
@@ -28,13 +28,13 @@ export type ScaffoldType = keyof typeof SCAFFOLD_TEMPLATES;
28
28
  export const SCAFFOLD_VERSION = SCAFFOLD_TEMPLATES["tanstack-start"];
29
29
 
30
30
  /**
31
- * The container can pin the template via SCAFFOLD_VERSION (a versioned
31
+ * The container can pin the template via PLUGINS_SCAFFOLD_VERSION (a versioned
32
32
  * template id, e.g. "tanstack-start-2026-06-18"). Unset or unknown values
33
33
  * fall back to the tanstack-router template, so a stale env var can never
34
34
  * reproduce the ENOENT-on-missing-template failure.
35
35
  */
36
36
  export function resolveTemplateId(): string {
37
- const version = process.env.SCAFFOLD_VERSION;
37
+ const version = process.env.PLUGINS_SCAFFOLD_VERSION;
38
38
  const known: string[] = Object.values(SCAFFOLD_TEMPLATES);
39
39
  if (version && known.includes(version)) return version;
40
40
  return SCAFFOLD_TEMPLATES["tanstack-router"];
@@ -51,6 +51,21 @@ export function projectUuidFromDir(dir: string): string {
51
51
  return path.basename(dir);
52
52
  }
53
53
 
54
+ /**
55
+ * Integration-proxy base URL, provided by the opencode container via
56
+ * PLUGINS_INTEGRATION_PROXY_URL (like PLUGINS_SCAFFOLD_VERSION) so each deployment
57
+ * (dev | preprod | prod) bakes its own proxy host into proxy.ts at scaffold
58
+ * time -- previews and published apps use the same value. Unset falls back
59
+ * to prod so a missing env var can never break production scaffolds.
60
+ */
61
+ export function integrationProxyUrl(projectUuid: string): string {
62
+ const base = (
63
+ process.env.PLUGINS_INTEGRATION_PROXY_URL || "https://api.app.helloleo.dev"
64
+ ).replace(/\/+$/, "");
65
+
66
+ return `${base}/api/integration-proxy/${projectUuid}`;
67
+ }
68
+
54
69
  const scaffoldOptionsSchema = z.object({
55
70
  name: z
56
71
  .string()
@@ -92,13 +107,15 @@ export async function writeBaseScaffold(
92
107
  dir: string,
93
108
  ): Promise<string[]> {
94
109
  const templateId = resolveTemplateId();
110
+ const projectUuid = projectUuidFromDir(dir);
95
111
  const created = await renderTemplate(
96
112
  templateId,
97
113
  {
98
114
  LEO_NAME: name,
99
115
  LEO_SLUG: slugify(name),
100
116
  LEO_DESCRIPTION: description,
101
- LEO_PROJECT_UUID: projectUuidFromDir(dir),
117
+ LEO_PROJECT_UUID: projectUuid,
118
+ LEO_INTEGRATION_PROXY_URL: integrationProxyUrl(projectUuid),
102
119
  },
103
120
  dir,
104
121
  );