@rebasepro/cli 0.18.0 → 0.19.0
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/commands/normalize-imports.d.ts +38 -0
- package/dist/index.es.js +96 -0
- package/dist/index.es.js.map +1 -1
- package/package.json +7 -7
- package/templates/eject/backend/src/index.ts +5 -5
- package/templates/overlays/baas/backend/package.json +1 -1
- package/templates/overlays/baas/backend/tsconfig.json +7 -3
- package/templates/overlays/baas/config/index.ts +1 -1
- package/templates/overlays/baas/config/package.json +1 -1
- package/templates/template/backend/package.json +1 -1
- package/templates/template/backend/tsconfig.json +6 -0
- package/templates/template/config/collections/index.ts +4 -4
- package/templates/template/config/collections/posts.ts +2 -2
- package/templates/template/config/collections/presets/blank/index.ts +1 -1
- package/templates/template/config/collections/presets/ecommerce/index.ts +4 -4
- package/templates/template/config/collections/presets/ecommerce/products.ts +1 -1
- package/templates/template/config/index.ts +2 -2
- package/templates/template/config/package.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rebasepro/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "Developer tools for Rebase projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"inquirer": "14.0.2",
|
|
44
44
|
"jiti": "^2.7.0",
|
|
45
45
|
"pg": "^8.22.0",
|
|
46
|
-
"@rebasepro/agent-skills": "0.
|
|
47
|
-
"@rebasepro/client": "0.
|
|
48
|
-
"@rebasepro/
|
|
49
|
-
"@rebasepro/
|
|
50
|
-
"@rebasepro/server": "0.
|
|
51
|
-
"@rebasepro/
|
|
46
|
+
"@rebasepro/agent-skills": "0.19.0",
|
|
47
|
+
"@rebasepro/client": "0.19.0",
|
|
48
|
+
"@rebasepro/codegen": "0.19.0",
|
|
49
|
+
"@rebasepro/types": "0.19.0",
|
|
50
|
+
"@rebasepro/server": "0.19.0",
|
|
51
|
+
"@rebasepro/server-postgres": "0.19.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/node": "^26.1.2",
|
|
@@ -23,14 +23,14 @@ import {
|
|
|
23
23
|
import { declaredDataSources, declaredStorageSources } from "@rebasepro/types";
|
|
24
24
|
// Side-effect import: declaring is what registers, so anything that dropped
|
|
25
25
|
// this as "unused" would leave the backend with no buckets — silently.
|
|
26
|
-
import "../../config/resources
|
|
26
|
+
import "../../config/resources";
|
|
27
27
|
// {{#collections}}
|
|
28
|
-
import { enums, relations, tables } from "./schema.generated
|
|
28
|
+
import { enums, relations, tables } from "./schema.generated";
|
|
29
29
|
// {{/collections}}
|
|
30
|
-
import { storageAuthorize } from "../../config/storage
|
|
31
|
-
import { env } from "./env
|
|
30
|
+
import { storageAuthorize } from "../../config/storage";
|
|
31
|
+
import { env } from "./env";
|
|
32
32
|
// {{#collections}}
|
|
33
|
-
import usersCollection from "../../config/collections/users
|
|
33
|
+
import usersCollection from "../../config/collections/users";
|
|
34
34
|
// {{/collections}}
|
|
35
35
|
|
|
36
36
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -12,15 +12,19 @@
|
|
|
12
12
|
"forceConsistentCasingInFileNames": true,
|
|
13
13
|
"resolveJsonModule": true,
|
|
14
14
|
"declaration": true,
|
|
15
|
-
"sourceMap": true
|
|
15
|
+
"sourceMap": true,
|
|
16
|
+
"rootDir": ".."
|
|
16
17
|
},
|
|
17
18
|
// `functions/` as well as `src/`, because this flavour has nothing in src:
|
|
18
19
|
// it declares no collections, so there is no generated schema, and the server
|
|
19
20
|
// entrypoint lives behind `rebase eject`. An include matching only an empty
|
|
20
21
|
// directory is TS18003 — tsc reports "no inputs" as an error, not a no-op.
|
|
21
22
|
//
|
|
22
|
-
//
|
|
23
|
-
//
|
|
23
|
+
// `rootDir` is `..`, not `.`: `rebase eject` writes an entrypoint that imports
|
|
24
|
+
// `../../config/resources`, and tsc emits every file it pulls into the
|
|
25
|
+
// program — so the common source directory is the project root and the emit
|
|
26
|
+
// lands at `dist/backend/src/…`, which is what `scripts.start` runs. Inferring
|
|
27
|
+
// it stopped being an option in TypeScript 6 (TS5011).
|
|
24
28
|
//
|
|
25
29
|
// `crons/` too: `rebase build` compiles it through a generated tsconfig, but
|
|
26
30
|
// an ejected project builds with *this* file, so leaving it out meant an
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"description": "Rebase backend with PostgreSQL",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build": "rebase schema generate --collections ../config/collections && tsc"
|
|
7
|
+
"build": "rebase schema generate --collections ../config/collections && tsc && rebase normalize-imports dist"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"{{PROJECT_NAME}}-config": "*",
|
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
"moduleResolution": "bundler",
|
|
6
6
|
"lib": ["ES2022"],
|
|
7
7
|
"outDir": "./dist",
|
|
8
|
+
// The program includes `../config/**`, so tsc's common source directory is
|
|
9
|
+
// the project root and the emit already lands at `dist/backend/src/…` —
|
|
10
|
+
// which is what `scripts.start` runs. Saying so explicitly is required from
|
|
11
|
+
// TypeScript 6, which refuses to infer it (TS5011), and changes nothing
|
|
12
|
+
// about the layout.
|
|
13
|
+
"rootDir": "..",
|
|
8
14
|
"strict": true,
|
|
9
15
|
"esModuleInterop": true,
|
|
10
16
|
"allowSyntheticDefaultImports": true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import postsCollection from "./posts
|
|
2
|
-
import authorsCollection from "./authors
|
|
3
|
-
import tagsCollection from "./tags
|
|
4
|
-
import usersCollection from "./users
|
|
1
|
+
import postsCollection from "./posts";
|
|
2
|
+
import authorsCollection from "./authors";
|
|
3
|
+
import tagsCollection from "./tags";
|
|
4
|
+
import usersCollection from "./users";
|
|
5
5
|
import type { SecurityRule } from "@rebasepro/types";
|
|
6
6
|
|
|
7
7
|
export const collections = [postsCollection, authorsCollection, tagsCollection, usersCollection];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineCollection } from "@rebasepro/cms-types";
|
|
2
|
-
import authorsCollection from "./authors
|
|
3
|
-
import tagsCollection from "./tags
|
|
2
|
+
import authorsCollection from "./authors";
|
|
3
|
+
import tagsCollection from "./tags";
|
|
4
4
|
|
|
5
5
|
const postsCollection = defineCollection({
|
|
6
6
|
name: "Posts",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Resolves after `rebase init` copies this file into config/collections/,
|
|
2
2
|
// next to the shared users.ts — not from inside presets/, which never runs.
|
|
3
|
-
import usersCollection from "./users
|
|
3
|
+
import usersCollection from "./users";
|
|
4
4
|
|
|
5
5
|
export const collections = [usersCollection];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import productsCollection from "./products
|
|
2
|
-
import categoriesCollection from "./categories
|
|
3
|
-
import ordersCollection from "./orders
|
|
1
|
+
import productsCollection from "./products";
|
|
2
|
+
import categoriesCollection from "./categories";
|
|
3
|
+
import ordersCollection from "./orders";
|
|
4
4
|
// Resolves after `rebase init` copies this file into config/collections/,
|
|
5
5
|
// next to the shared users.ts — not from inside presets/, which never runs.
|
|
6
|
-
import usersCollection from "./users
|
|
6
|
+
import usersCollection from "./users";
|
|
7
7
|
|
|
8
8
|
export const collections = [productsCollection, categoriesCollection, ordersCollection, usersCollection];
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Collections defined here are used by both the frontend and backend
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export { collections } from "./collections/index
|
|
6
|
+
export { collections } from "./collections/index";
|
|
7
7
|
|
|
8
8
|
// Who may read, write, delete and list files in storage. Exported from here
|
|
9
9
|
// because that is where the runtime and `rebase cloud deploy` look for it — the
|
|
10
10
|
// bundle manifest records whether this export exists, so a managed deploy can be
|
|
11
11
|
// refused with a readable message instead of turning into a boot crash-loop.
|
|
12
|
-
export { storageAuthorize } from "./storage
|
|
12
|
+
export { storageAuthorize } from "./storage";
|