@rebasepro/cli 0.13.0 → 0.13.1-canary.g06dbe5b

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 (36) hide show
  1. package/dist/bundle.d.ts +4 -3
  2. package/dist/commands/api-keys.d.ts +51 -0
  3. package/dist/commands/auth.d.ts +62 -0
  4. package/dist/commands/cloud/context.d.ts +56 -7
  5. package/dist/commands/cloud/databases.d.ts +39 -0
  6. package/dist/commands/cloud/debug.d.ts +1 -0
  7. package/dist/commands/cloud/deployments.d.ts +22 -0
  8. package/dist/commands/cloud/domains.d.ts +10 -0
  9. package/dist/commands/cloud/env.d.ts +51 -0
  10. package/dist/commands/cloud/extensions.d.ts +21 -0
  11. package/dist/commands/cloud/orgs.d.ts +1 -0
  12. package/dist/commands/cloud/projects.d.ts +29 -0
  13. package/dist/commands/cloud/resources.d.ts +14 -0
  14. package/dist/commands/cloud/settings.d.ts +1 -0
  15. package/dist/commands/dev.d.ts +17 -6
  16. package/dist/commands/eject.d.ts +42 -0
  17. package/dist/commands/init.d.ts +67 -0
  18. package/dist/commands/skills.d.ts +81 -0
  19. package/dist/fold-static.d.ts +47 -0
  20. package/dist/index.es.js +1440 -415
  21. package/dist/index.es.js.map +1 -1
  22. package/dist/manifest.d.ts +16 -1
  23. package/dist/telemetry/payload.d.ts +1 -1
  24. package/dist/utils/args.d.ts +76 -0
  25. package/dist/utils/collection-drift.d.ts +27 -0
  26. package/dist/utils/project.d.ts +20 -0
  27. package/package.json +7 -7
  28. package/templates/eject/Dockerfile +29 -4
  29. package/templates/eject/backend/src/index.ts +49 -5
  30. package/templates/eject/docker-compose.custom.yml +13 -5
  31. package/templates/overlays/baas/backend/tsconfig.json +6 -1
  32. package/templates/template/.env.example +13 -4
  33. package/templates/template/backend/functions/hello.ts +8 -4
  34. package/templates/template/backend/tsconfig.json +6 -1
  35. package/templates/template/config/package.json +1 -0
  36. package/templates/template/docker-compose.yml +4 -4
@@ -1 +1,82 @@
1
+ /**
2
+ * Supported agent environments and their target directories.
3
+ *
4
+ * `flatLayout` says where the installed rule file sits relative to the skill's
5
+ * own assets. A subdirectory layout writes `<skill>/SKILL.md`, so a link the
6
+ * skill spells `references/x.md` resolves as written; a flat layout writes
7
+ * `<skill>.md` one level up, so those links have to be re-pointed at the
8
+ * per-skill asset directory. See `rewriteAssetLinks`.
9
+ */
10
+ declare const AGENTS: {
11
+ readonly cursor: {
12
+ readonly label: "Cursor";
13
+ readonly detectDir: ".cursor";
14
+ readonly targetDir: ".cursor/rules";
15
+ readonly flatLayout: true;
16
+ /** Cursor uses .mdc files (Markdown with Context). */
17
+ readonly transformFile: (skillName: string, content: string) => {
18
+ fileName: string;
19
+ content: string;
20
+ };
21
+ };
22
+ readonly claude: {
23
+ readonly label: "Claude Code";
24
+ readonly detectDir: ".claude";
25
+ readonly targetDir: ".claude/skills";
26
+ readonly flatLayout: false;
27
+ /** Claude Code uses the standard SKILL.md format in subdirectories. */
28
+ readonly transformFile: (skillName: string, content: string) => {
29
+ fileName: string;
30
+ content: string;
31
+ };
32
+ };
33
+ readonly windsurf: {
34
+ readonly label: "Windsurf";
35
+ readonly detectDir: ".windsurf";
36
+ readonly targetDir: ".windsurf/rules";
37
+ readonly flatLayout: true;
38
+ /** Windsurf uses plain .md files. */
39
+ readonly transformFile: (skillName: string, content: string) => {
40
+ fileName: string;
41
+ content: string;
42
+ };
43
+ };
44
+ readonly gemini: {
45
+ readonly label: "Gemini CLI / Antigravity";
46
+ readonly detectDir: ".agents";
47
+ readonly targetDir: ".agents/skills";
48
+ readonly flatLayout: false;
49
+ /** Gemini uses the standard SKILL.md format in subdirectories. */
50
+ readonly transformFile: (skillName: string, content: string) => {
51
+ fileName: string;
52
+ content: string;
53
+ };
54
+ };
55
+ };
56
+ type AgentKey = keyof typeof AGENTS;
57
+ export interface LoadedSkill {
58
+ name: string;
59
+ /** Absolute path of the skill's source directory. */
60
+ dir: string;
61
+ content: string;
62
+ /** Every file the skill ships besides SKILL.md, relative to `dir`. */
63
+ assets: string[];
64
+ }
65
+ /** Read all skill directories and return their names, content and assets. */
66
+ export declare function loadSkills(skillsDir: string): LoadedSkill[];
67
+ /**
68
+ * Re-point a skill's own asset links at the per-skill subdirectory, for the
69
+ * agents whose rule file does not live in it.
70
+ *
71
+ * Only paths that name a file the skill actually ships are rewritten, and only
72
+ * where they start a path segment — so prose that happens to contain the same
73
+ * words is left alone.
74
+ */
75
+ export declare function rewriteAssetLinks(content: string, assets: string[], skillName: string): string;
76
+ /** Install skills for a specific agent into the project directory. */
77
+ export declare function installForAgent(agentKey: AgentKey, skills: LoadedSkill[], projectDir: string): {
78
+ skills: number;
79
+ assets: number;
80
+ };
1
81
  export declare function skillsCommand(subcommand: string | undefined, rawArgs: string[]): Promise<void>;
82
+ export {};
@@ -62,6 +62,53 @@ export declare function foldableApps(manifest: FoldableManifest): {
62
62
  * evidence of a misbuild.
63
63
  */
64
64
  export declare function assertBuiltForPath(indexHtml: string, basePath: string, appName: string): void;
65
+ /**
66
+ * The environment every static app is built with, wherever that build is driven from.
67
+ *
68
+ * Shared because there are two drivers — `foldFrontendIntoBundle` here, and
69
+ * `buildAssetApp` in `build.ts` for a standalone `type: "static"` app — and they
70
+ * had already drifted: the path variables were duplicated into both, so a fix
71
+ * applied to one shipped a bundle built the old way from the other. One function
72
+ * makes that impossible rather than merely unlikely.
73
+ *
74
+ * ## REBASE_APP_*
75
+ *
76
+ * The declared path is a build-time input, not only a serving concern: Vite
77
+ * reads `base` from REBASE_APP_BASE, and the trailing slash is that field's
78
+ * convention. See `assertBuiltForPath`.
79
+ *
80
+ * ## NODE_ENV
81
+ *
82
+ * A built app is a production artifact by construction, so build it as one. Not
83
+ * a formality: the scaffold's `.env` carries `NODE_ENV=development` for the dev
84
+ * backend, and Vite's `loadEnv` promotes a `NODE_ENV` found in an env file into
85
+ * the build unless the environment already sets one. So `rebase build` and
86
+ * `rebase cloud deploy` shipped a *development* bundle — `import.meta.env.DEV
87
+ * === true`, development React, dev-only branches live — from commands whose
88
+ * whole purpose is to produce something deployable. Setting it here is what
89
+ * closes it: Vite consults the env file's NODE_ENV only when `process.env`
90
+ * has none.
91
+ *
92
+ * ## VITE_API_URL
93
+ *
94
+ * An app served by the backend it talks to has its API on its own origin by
95
+ * construction, so a baked-in absolute URL can only be wrong. It was: that same
96
+ * `.env` carries `VITE_API_URL=http://localhost:3001` and
97
+ * `frontend/vite.config.ts` reads the project root via `envDir: ".."`, so a
98
+ * stock deploy shipped a site whose every request went to whoever ran the build
99
+ * — passing every server-side health check on the way out. Blanking it here
100
+ * fixes the bundle even for a project whose `.env` predates the `init` fix, or
101
+ * was written by hand. Empty is the right value rather than a missing one: the
102
+ * client falls back to `window.location.origin`, which keeps working when a
103
+ * custom domain is added.
104
+ *
105
+ * Vite prioritises `process.env.VITE_*` over `.env` files, so an explicit
106
+ * `VITE_API_URL=https://api.example.com rebase cloud deploy` still wins — the
107
+ * cross-origin escape hatch stays open, it just has to be deliberate. Nothing on
108
+ * this path loads the project `.env` into `process.env`, so a value inherited
109
+ * here really was set by the caller.
110
+ */
111
+ export declare function staticBuildEnv(appPath: string, appName: string): Record<string, string>;
65
112
  /**
66
113
  * Build the project's static apps and fold them into the backend bundle.
67
114
  *