@supacloud/lite 0.2.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/CHANGELOG.md +29 -0
- package/LICENSE +201 -0
- package/LICENSES/PGLITE-APACHE-2.0.txt +176 -0
- package/LICENSES/TINBASE-MIT.txt +21 -0
- package/README.md +170 -0
- package/RELEASING.md +22 -0
- package/THIRD_PARTY_NOTICES.md +24 -0
- package/dist/cli.js +9018 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8469 -0
- package/dist/project-runtime.d.ts +65 -0
- package/dist/project-runtime.d.ts.map +1 -0
- package/dist/vendor/tinbase/auth/handler.d.ts +140 -0
- package/dist/vendor/tinbase/auth/handler.d.ts.map +1 -0
- package/dist/vendor/tinbase/auth/inbox.d.ts +34 -0
- package/dist/vendor/tinbase/auth/inbox.d.ts.map +1 -0
- package/dist/vendor/tinbase/auth/oauth.d.ts +88 -0
- package/dist/vendor/tinbase/auth/oauth.d.ts.map +1 -0
- package/dist/vendor/tinbase/auth/password.d.ts +9 -0
- package/dist/vendor/tinbase/auth/password.d.ts.map +1 -0
- package/dist/vendor/tinbase/auth/qr.d.ts +9 -0
- package/dist/vendor/tinbase/auth/qr.d.ts.map +1 -0
- package/dist/vendor/tinbase/auth/rate-limit.d.ts +34 -0
- package/dist/vendor/tinbase/auth/rate-limit.d.ts.map +1 -0
- package/dist/vendor/tinbase/auth/redirect.d.ts +21 -0
- package/dist/vendor/tinbase/auth/redirect.d.ts.map +1 -0
- package/dist/vendor/tinbase/auth/settings.d.ts +56 -0
- package/dist/vendor/tinbase/auth/settings.d.ts.map +1 -0
- package/dist/vendor/tinbase/auth/totp.d.ts +20 -0
- package/dist/vendor/tinbase/auth/totp.d.ts.map +1 -0
- package/dist/vendor/tinbase/cron/service.d.ts +47 -0
- package/dist/vendor/tinbase/cron/service.d.ts.map +1 -0
- package/dist/vendor/tinbase/db/bootstrap.d.ts +21 -0
- package/dist/vendor/tinbase/db/bootstrap.d.ts.map +1 -0
- package/dist/vendor/tinbase/db/database.d.ts +168 -0
- package/dist/vendor/tinbase/db/database.d.ts.map +1 -0
- package/dist/vendor/tinbase/db/emulated.d.ts +53 -0
- package/dist/vendor/tinbase/db/emulated.d.ts.map +1 -0
- package/dist/vendor/tinbase/db/engine.d.ts +47 -0
- package/dist/vendor/tinbase/db/engine.d.ts.map +1 -0
- package/dist/vendor/tinbase/db/inspect.d.ts +19 -0
- package/dist/vendor/tinbase/db/inspect.d.ts.map +1 -0
- package/dist/vendor/tinbase/db/pglite-engine.d.ts +9 -0
- package/dist/vendor/tinbase/db/pglite-engine.d.ts.map +1 -0
- package/dist/vendor/tinbase/db/schema-diff.d.ts +32 -0
- package/dist/vendor/tinbase/db/schema-diff.d.ts.map +1 -0
- package/dist/vendor/tinbase/db/sql-compat.d.ts +33 -0
- package/dist/vendor/tinbase/db/sql-compat.d.ts.map +1 -0
- package/dist/vendor/tinbase/functions/deno-shim.d.ts +15 -0
- package/dist/vendor/tinbase/functions/deno-shim.d.ts.map +1 -0
- package/dist/vendor/tinbase/functions/handler.d.ts +36 -0
- package/dist/vendor/tinbase/functions/handler.d.ts.map +1 -0
- package/dist/vendor/tinbase/gen-types.d.ts +23 -0
- package/dist/vendor/tinbase/gen-types.d.ts.map +1 -0
- package/dist/vendor/tinbase/index.d.ts +82 -0
- package/dist/vendor/tinbase/index.d.ts.map +1 -0
- package/dist/vendor/tinbase/jwt.d.ts +31 -0
- package/dist/vendor/tinbase/jwt.d.ts.map +1 -0
- package/dist/vendor/tinbase/log-buffer.d.ts +28 -0
- package/dist/vendor/tinbase/log-buffer.d.ts.map +1 -0
- package/dist/vendor/tinbase/net/service.d.ts +72 -0
- package/dist/vendor/tinbase/net/service.d.ts.map +1 -0
- package/dist/vendor/tinbase/node/bun-server.d.ts +23 -0
- package/dist/vendor/tinbase/node/bun-server.d.ts.map +1 -0
- package/dist/vendor/tinbase/node/bundle-function.d.ts +8 -0
- package/dist/vendor/tinbase/node/bundle-function.d.ts.map +1 -0
- package/dist/vendor/tinbase/node/config-toml.d.ts +34 -0
- package/dist/vendor/tinbase/node/config-toml.d.ts.map +1 -0
- package/dist/vendor/tinbase/node/fs-driver.d.ts +27 -0
- package/dist/vendor/tinbase/node/fs-driver.d.ts.map +1 -0
- package/dist/vendor/tinbase/node/load-config.d.ts +82 -0
- package/dist/vendor/tinbase/node/load-config.d.ts.map +1 -0
- package/dist/vendor/tinbase/node/load-functions.d.ts +24 -0
- package/dist/vendor/tinbase/node/load-functions.d.ts.map +1 -0
- package/dist/vendor/tinbase/node/project.d.ts +21 -0
- package/dist/vendor/tinbase/node/project.d.ts.map +1 -0
- package/dist/vendor/tinbase/node/server-shared.d.ts +10 -0
- package/dist/vendor/tinbase/node/server-shared.d.ts.map +1 -0
- package/dist/vendor/tinbase/realtime/engine.d.ts +82 -0
- package/dist/vendor/tinbase/realtime/engine.d.ts.map +1 -0
- package/dist/vendor/tinbase/rest/build.d.ts +101 -0
- package/dist/vendor/tinbase/rest/build.d.ts.map +1 -0
- package/dist/vendor/tinbase/rest/errors.d.ts +11 -0
- package/dist/vendor/tinbase/rest/errors.d.ts.map +1 -0
- package/dist/vendor/tinbase/rest/handler.d.ts +28 -0
- package/dist/vendor/tinbase/rest/handler.d.ts.map +1 -0
- package/dist/vendor/tinbase/rest/parse.d.ts +95 -0
- package/dist/vendor/tinbase/rest/parse.d.ts.map +1 -0
- package/dist/vendor/tinbase/retention/service.d.ts +41 -0
- package/dist/vendor/tinbase/retention/service.d.ts.map +1 -0
- package/dist/vendor/tinbase/security.d.ts +23 -0
- package/dist/vendor/tinbase/security.d.ts.map +1 -0
- package/dist/vendor/tinbase/storage/driver.d.ts +17 -0
- package/dist/vendor/tinbase/storage/driver.d.ts.map +1 -0
- package/dist/vendor/tinbase/storage/handler.d.ts +76 -0
- package/dist/vendor/tinbase/storage/handler.d.ts.map +1 -0
- package/dist/vendor/tinbase/storage/image-transform.d.ts +38 -0
- package/dist/vendor/tinbase/storage/image-transform.d.ts.map +1 -0
- package/dist/vendor/tinbase/storage/s3-driver.d.ts +36 -0
- package/dist/vendor/tinbase/storage/s3-driver.d.ts.map +1 -0
- package/dist/vendor/tinbase/types.d.ts +171 -0
- package/dist/vendor/tinbase/types.d.ts.map +1 -0
- package/dist/vendor/tinbase/webhooks/service.d.ts +71 -0
- package/dist/vendor/tinbase/webhooks/service.d.ts.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/package.json +64 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.2.0](https://github.com/zuohuadong/supacloud/compare/supacloud-lite-v0.1.0...supacloud-lite-v0.2.0) (2026-07-28)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **lite:** support image transforms and S3 storage ([7dbe7c7](https://github.com/zuohuadong/supacloud/commit/7dbe7c7d2972be5dac1e6c6597eafdcc6234a92a))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **lite:** preserve npm cli bin entry ([c208fee](https://github.com/zuohuadong/supacloud/commit/c208fee7b052377fd378bae99211dd55cdeea0f2))
|
|
14
|
+
|
|
15
|
+
## 0.1.0 (2026-07-27)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* **lite:** add SupaCloud Lite single-project PGlite runtime ([#602](https://github.com/zuohuadong/supacloud/issues/602)) ([a98ae0d](https://github.com/zuohuadong/supacloud/commit/a98ae0dfb31060348db4752b92ad39da13bc6793))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* **management-api:** support Pigsty 4.4 production compatibility ([d8f6959](https://github.com/zuohuadong/supacloud/commit/d8f6959623e6f09e0e665e3353d56fd7fdbab6de))
|
|
26
|
+
|
|
27
|
+
## 0.1.0
|
|
28
|
+
|
|
29
|
+
- Initial Bun-native single-project SupaCloud Lite implementation using PGlite.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2025 SupaCloud Contributors
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sanket Sahu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# SupaCloud Lite
|
|
2
|
+
|
|
3
|
+
SupaCloud Lite 是一个面向单项目部署的 Bun 原生 Supabase 兼容后端。它使用 PGlite 在进程内运行 PostgreSQL,并实现 Supabase 客户端依赖的 REST、Auth、Storage、Realtime 和 Edge Functions 协议。
|
|
4
|
+
|
|
5
|
+
V1 的目标不是复刻完整 Supabase 平台控制面,而是让现有应用在尽量少改代码的前提下,使用官方 `@supabase/supabase-js` 连接一个轻量、本地、无 Docker 的后端。
|
|
6
|
+
|
|
7
|
+
## 状态
|
|
8
|
+
|
|
9
|
+
- 运行时:Bun 1.3+
|
|
10
|
+
- 数据库:PGlite 0.5.4
|
|
11
|
+
- 项目模型:单进程、单项目,内部 project ref 固定为 `local`
|
|
12
|
+
- 客户端:直接使用官方 `@supabase/supabase-js`
|
|
13
|
+
- 数据目录:`.supacloud-lite/db`
|
|
14
|
+
- 对象存储:默认使用 `.supacloud-lite/storage`,也可切换为内存或远端 S3
|
|
15
|
+
- 密钥文件:`.supacloud-lite/secrets.json`,权限为 `0600`
|
|
16
|
+
|
|
17
|
+
## 快速开始
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
bun add @supacloud/lite
|
|
21
|
+
bunx supacloud-lite start
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
获取匿名 key:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
bunx supacloud-lite keys
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
仅在服务端确实需要绕过 RLS 时打印 `service_role` key:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
bunx supacloud-lite keys --service-role
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
客户端代码无需切换到专有 SDK:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import { createClient } from '@supabase/supabase-js'
|
|
40
|
+
|
|
41
|
+
const supabase = createClient('http://127.0.0.1:54321', process.env.SUPACLOUD_LITE_ANON_KEY!)
|
|
42
|
+
|
|
43
|
+
const { data, error } = await supabase.from('todos').select('*')
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## 项目约定
|
|
47
|
+
|
|
48
|
+
SupaCloud Lite 直接读取现有 Supabase CLI 目录:
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
supabase/
|
|
52
|
+
config.toml
|
|
53
|
+
migrations/*.sql
|
|
54
|
+
seed.sql
|
|
55
|
+
functions/<name>/index.ts
|
|
56
|
+
functions/.env
|
|
57
|
+
webhooks.json
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
`config.toml` 当前支持 Auth、API schema/max rows、Storage bucket/size limit、seed 和 function entrypoint 等常用配置。
|
|
61
|
+
|
|
62
|
+
## CLI
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
supacloud-lite start
|
|
66
|
+
supacloud-lite migrate
|
|
67
|
+
supacloud-lite status
|
|
68
|
+
supacloud-lite keys [--service-role]
|
|
69
|
+
supacloud-lite gen types [-o database.types.ts]
|
|
70
|
+
supacloud-lite db reset
|
|
71
|
+
supacloud-lite db diff [-f migration_name]
|
|
72
|
+
supacloud-lite db pull [migration_name]
|
|
73
|
+
supacloud-lite inspect
|
|
74
|
+
supacloud-lite version
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
通用参数:
|
|
78
|
+
|
|
79
|
+
- `--project-dir`:包含 `supabase/` 的项目目录
|
|
80
|
+
- `--host` / `--port`:监听地址和端口
|
|
81
|
+
- `--api-url`:对外 API URL,用于 Auth issuer、OAuth callback、邮件链接和 Functions 环境
|
|
82
|
+
- `--site-url`:前端站点 URL,用作 Auth 默认跳转目标
|
|
83
|
+
- `--state-dir`:Lite 状态根目录
|
|
84
|
+
- `--data-dir`:PGlite 数据目录
|
|
85
|
+
- `--storage-dir`:对象存储目录
|
|
86
|
+
- `--storage-backend`:`fs`、`memory` 或 `s3`
|
|
87
|
+
- `--s3-prefix`:远端 S3 对象 key 前缀
|
|
88
|
+
- `--memory`:使用内存数据库
|
|
89
|
+
|
|
90
|
+
环境变量:
|
|
91
|
+
|
|
92
|
+
- `SUPACLOUD_LITE_HOST`
|
|
93
|
+
- `SUPACLOUD_LITE_PORT`
|
|
94
|
+
- `SUPACLOUD_LITE_API_URL`
|
|
95
|
+
- `SUPACLOUD_LITE_SITE_URL`
|
|
96
|
+
- `SUPACLOUD_LITE_STATE_DIR`
|
|
97
|
+
- `SUPACLOUD_LITE_DATA_DIR`
|
|
98
|
+
- `SUPACLOUD_LITE_STORAGE_DIR`
|
|
99
|
+
- `SUPACLOUD_LITE_STORAGE_BACKEND`:`fs`(默认)、`memory` 或 `s3`
|
|
100
|
+
- `SUPACLOUD_LITE_S3_PREFIX`:S3 对象 key 前缀,可被 `--s3-prefix` 覆盖
|
|
101
|
+
- `SUPACLOUD_LITE_JWT_SECRET`
|
|
102
|
+
- `SUPACLOUD_LITE_VAULT_KEY`
|
|
103
|
+
|
|
104
|
+
使用远端 S3 时,启动前设置 `SUPACLOUD_LITE_STORAGE_BACKEND=s3`,并按 Bun S3 约定提供 `S3_BUCKET`、`S3_ACCESS_KEY_ID`、`S3_SECRET_ACCESS_KEY`、`S3_ENDPOINT`、`S3_REGION` 等变量;也支持对应的 `AWS_*` 变量。CLI 不接受密钥参数,避免凭据出现在进程列表中。
|
|
105
|
+
|
|
106
|
+
S3 模式下 `db reset` 会被拒绝,因为 Lite 不能把数据库元数据清理与远端对象删除做成原子操作;需要先明确处理远端 bucket/prefix,再切回本地或内存存储执行重置。
|
|
107
|
+
|
|
108
|
+
网络暴露时必须提供足够强的 JWT secret 和独立 vault key。默认生成的密钥适合单机项目;不要把 `.supacloud-lite/secrets.json` 提交到版本库。
|
|
109
|
+
|
|
110
|
+
## 兼容范围
|
|
111
|
+
|
|
112
|
+
| 能力 | V1 状态 | 说明 |
|
|
113
|
+
| --- | --- | --- |
|
|
114
|
+
| `supabase.from()` | 已验证核心 | 自动测试覆盖 CRUD、过滤、RLS;嵌套关系、RPC 和高级 PostgREST 语法属于实验性兼容 |
|
|
115
|
+
| `supabase.auth` | 已验证核心 | 自动测试覆盖邮箱密码、会话和 bcrypt;OTP/Magic Link、匿名用户、OAuth、MFA 属于实验性兼容 |
|
|
116
|
+
| `supabase.storage` | 已验证核心 | 覆盖上传下载、列表、删除、TUS/RLS、远端 S3 驱动,以及 Bun.Image 的 `contain`/`fill`、格式和质量变换子集;`cover` 明确不支持 |
|
|
117
|
+
| `supabase.channel()` | 已验证核心 | 自动测试覆盖 `postgres_changes`、DELETE RLS 隔离和事件快照校验;Broadcast、Presence 属于实验性兼容 |
|
|
118
|
+
| `supabase.functions.invoke()` | 已验证核心 | 自动测试覆盖 Bun.build、`Deno.serve()`、公开函数和同进程重启 |
|
|
119
|
+
| Supabase migrations | 支持 | 按文件名排序,记录到 `supabase_migrations` |
|
|
120
|
+
| PostgreSQL RLS | 支持 | 使用 `anon`、`authenticated`、`service_role` 数据库角色执行 |
|
|
121
|
+
| PostgREST 完整线协议 | 部分支持 | 目标是常用 `supabase-js` 行为,不承诺所有 PostgREST 边角行为 |
|
|
122
|
+
| PostgreSQL 扩展 | 部分支持 | 仅支持 PGlite 内置或 Lite 模拟的扩展能力 |
|
|
123
|
+
| Supabase Studio | 不支持 | V1 不提供管理 UI |
|
|
124
|
+
| 多项目控制面 | 不支持 | V1 每个进程只运行一个项目,可通过多个进程部署多个项目 |
|
|
125
|
+
|
|
126
|
+
RLS 表的 Realtime DELETE 无法在行删除后安全重放 SELECT policy,因此 V1 只向 `service_role` 订阅者发送这类 DELETE 事件。普通用户仍可收到通过逐行 RLS 校验的 INSERT/UPDATE 事件。
|
|
127
|
+
|
|
128
|
+
## 从 Supabase 迁移
|
|
129
|
+
|
|
130
|
+
应用代码、SQL migrations、RLS policy、Storage 调用和 Realtime 订阅可以保持原来的 Supabase 形状。迁移时仍需验证以下边界:
|
|
131
|
+
|
|
132
|
+
1. 把现有 `supabase/migrations`、`config.toml`、Functions 和 seed 文件带到 Lite 项目。
|
|
133
|
+
2. 用 `supacloud-lite db reset` 在空库重放 schema,再导入业务数据。
|
|
134
|
+
3. 对使用 PGlite 未提供扩展或 PostgREST 高级语法的 SQL/API 做替代处理。
|
|
135
|
+
4. 通过真实 `@supabase/supabase-js` 集成测试验证关键查询、RLS、Storage 和 Realtime。
|
|
136
|
+
|
|
137
|
+
Lite 使用 Bun 原生 bcrypt,并兼容验证常见 GoTrue bcrypt 密码散列,因此经过映射的 `auth.users` 用户可保留密码。Auth 表结构、identity、refresh token 和 provider metadata 仍需通过受控迁移脚本转换;不要直接覆盖整个 `auth` schema。迁移后必须抽样验证登录,并为无法识别的散列准备密码重置流程。
|
|
138
|
+
|
|
139
|
+
## 多项目
|
|
140
|
+
|
|
141
|
+
V1 不在一个进程内复用多个 PGlite 项目。需要多个项目时,为每个项目配置独立的工作目录、端口和 `.supacloud-lite` 状态目录,并用进程管理器分别启动。这样可保持数据库、JWT、Storage 和 Realtime 的故障域隔离。
|
|
142
|
+
|
|
143
|
+
## 资源边界
|
|
144
|
+
|
|
145
|
+
PGlite 是 WebAssembly PostgreSQL,不是 SQLite。它换来了 PostgreSQL SQL、角色、RLS 和 Supabase 迁移兼容性,但内存占用通常高于 PocketBase/SQLite。生产部署前应按真实 schema、并发和 Realtime 负载做容量测试。
|
|
146
|
+
|
|
147
|
+
当前 npm 包依赖 PGlite 的 WASM 资源,不承诺 Bun `--compile` 单文件二进制可直接携带全部资源。V1 推荐通过 Bun + npm 包部署。
|
|
148
|
+
|
|
149
|
+
## API
|
|
150
|
+
|
|
151
|
+
```ts
|
|
152
|
+
import { createProjectBackend, startProjectServer } from '@supacloud/lite'
|
|
153
|
+
|
|
154
|
+
const running = await startProjectServer({
|
|
155
|
+
projectDir: process.cwd(),
|
|
156
|
+
host: '127.0.0.1',
|
|
157
|
+
port: 54321,
|
|
158
|
+
storageBackend: 's3',
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
await running.close()
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
图片变换目前提供 Bun.Image 的兼容子集:`width`、`height`、`resize=fill|contain`,以及 `format=origin|jpeg|png|webp` 和 JPEG/WebP `quality`。`resize=cover` 需要裁剪能力,当前 Bun 运行时没有对应 API,因此会明确返回不支持错误,不会错误地把图片拉伸成 `cover`。
|
|
165
|
+
|
|
166
|
+
也可以使用 `createLiteBackend()` 直接创建内存或自定义目录的嵌入式后端,并把它的 `fetch` 传给自定义宿主。
|
|
167
|
+
|
|
168
|
+
## 来源与许可
|
|
169
|
+
|
|
170
|
+
协议实现派生并精简自 Tinbase,保留其 MIT 许可;PGlite 使用 Apache-2.0。完整说明见 `THIRD_PARTY_NOTICES.md` 和 `LICENSES/`。
|
package/RELEASING.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Releasing SupaCloud Lite
|
|
2
|
+
|
|
3
|
+
## First npm release
|
|
4
|
+
|
|
5
|
+
`@supacloud/lite` 在 npm 上尚不存在时,先完成一次受控 bootstrap publish:
|
|
6
|
+
|
|
7
|
+
1. 在合并 Release Please 创建的 `supacloud-lite-v0.1.0` release 前,在 GitHub `npm-publish` environment 中临时配置 `NPM_BOOTSTRAP_TOKEN`;token 必须要求 2FA 并限制到该包。
|
|
8
|
+
2. 合并 release,让同一次 `Release Please` workflow 运行使用该 token 完成首次发布;如果发布 job 失败,使用该次 workflow 的 **Re-run failed jobs**,不要等待下一次 release。
|
|
9
|
+
3. 在 npm 包设置中配置 Trusted Publisher:user `zuohuadong`、repository `supacloud`、workflow `release-please.yml`、environment `npm-publish`,并将 allowed action 限制为 `npm publish`。
|
|
10
|
+
4. 删除 `NPM_BOOTSTRAP_TOKEN`。后续发布由 npm OIDC Trusted Publishing 完成。
|
|
11
|
+
|
|
12
|
+
## Verification
|
|
13
|
+
|
|
14
|
+
发布前运行:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
bun install --frozen-lockfile
|
|
18
|
+
bun run check
|
|
19
|
+
bun audit --audit-level high
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`bun run check` 会构建包、执行真实 `supabase-js` 集成测试、生成 npm tarball、在临时消费者项目中安装 tarball,并验证 CLI、公开 API、PGlite WASM 和版本一致性。
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Third-Party Notices
|
|
2
|
+
|
|
3
|
+
## Tinbase
|
|
4
|
+
|
|
5
|
+
SupaCloud Lite 的 Supabase 兼容协议实现包含从 Tinbase 0.10.0 派生并修改的源代码。
|
|
6
|
+
|
|
7
|
+
- Copyright: 2026 Sanket Sahu
|
|
8
|
+
- License: MIT
|
|
9
|
+
- Upstream: `https://github.com/sanketmysore/tinbase`
|
|
10
|
+
- Local license copy: `LICENSES/TINBASE-MIT.txt`
|
|
11
|
+
|
|
12
|
+
主要修改包括:删除 Admin UI、Node HTTP server、native PostgreSQL 和 pg-mem 路径;固定为单项目 PGlite;改用 Bun.serve 和 Bun.build;增加 SupaCloud Lite 密钥、CLI、测试、文档和发布集成。
|
|
13
|
+
|
|
14
|
+
## PGlite
|
|
15
|
+
|
|
16
|
+
SupaCloud Lite 使用 ElectricSQL PGlite 作为嵌入式 PostgreSQL 引擎。
|
|
17
|
+
|
|
18
|
+
- License: Apache-2.0
|
|
19
|
+
- Upstream: `https://github.com/electric-sql/pglite`
|
|
20
|
+
- Local license copy: `LICENSES/PGLITE-APACHE-2.0.txt`
|
|
21
|
+
|
|
22
|
+
## Supabase JavaScript SDK
|
|
23
|
+
|
|
24
|
+
`@supabase/supabase-js` 仅作为开发和兼容性测试依赖使用,没有 vendored 到发布产物中。
|