@powersync/cli-plugin-docker 0.0.0-dev-20260305082615
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/LICENSE +67 -0
- package/README.md +75 -0
- package/dist/DockerCommand.d.ts +7 -0
- package/dist/DockerCommand.js +7 -0
- package/dist/api/docker.d.ts +47 -0
- package/dist/api/docker.js +109 -0
- package/dist/commands/docker/configure.d.ts +13 -0
- package/dist/commands/docker/configure.js +182 -0
- package/dist/commands/docker/index.d.ts +12 -0
- package/dist/commands/docker/index.js +13 -0
- package/dist/commands/docker/reset.d.ts +11 -0
- package/dist/commands/docker/reset.js +37 -0
- package/dist/commands/docker/start.d.ts +11 -0
- package/dist/commands/docker/start.js +26 -0
- package/dist/commands/docker/stop.d.ts +14 -0
- package/dist/commands/docker/stop.js +44 -0
- package/dist/constants.d.ts +4 -0
- package/dist/constants.js +4 -0
- package/dist/docker.d.ts +1 -0
- package/dist/docker.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/templates/bucket-storage/external/ExternalBucketStorageModule.d.ts +3 -0
- package/dist/templates/bucket-storage/external/ExternalBucketStorageModule.js +24 -0
- package/dist/templates/bucket-storage/postgres/PostgresBucketStorageModule.d.ts +3 -0
- package/dist/templates/bucket-storage/postgres/PostgresBucketStorageModule.js +58 -0
- package/dist/templates/bucket-storage/postgres/resources/init-scripts/01-storage-db.sql +2 -0
- package/dist/templates/bucket-storage/postgres/resources/postgres.storage.compose.yaml +26 -0
- package/dist/templates/main-compose.yaml +32 -0
- package/dist/templates/source-database/external/ExternalSourceDatabaseModule.d.ts +3 -0
- package/dist/templates/source-database/external/ExternalSourceDatabaseModule.js +30 -0
- package/dist/templates/source-database/postgres/PostgresSourceDatabaseModule.d.ts +3 -0
- package/dist/templates/source-database/postgres/PostgresSourceDatabaseModule.js +73 -0
- package/dist/templates/source-database/postgres/resources/init-scripts/.gitkeep +0 -0
- package/dist/templates/source-database/postgres/resources/init-scripts/01-powersync-publication.sql +15 -0
- package/dist/templates/source-database/postgres/resources/postgres.database.compose.yaml +27 -0
- package/dist/templates/templates-index.d.ts +2 -0
- package/dist/templates/templates-index.js +10 -0
- package/dist/types.d.ts +26 -0
- package/dist/types.js +6 -0
- package/oclif.manifest.json +278 -0
- package/package.json +56 -0
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
{
|
|
2
|
+
"commands": {
|
|
3
|
+
"docker:configure": {
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"args": {},
|
|
6
|
+
"description": "Configures a self hosted project with Docker Compose services.\nDocker configuration is located in ./powersync/docker/.\nConfigured projects can be started with \"powersync docker start\".",
|
|
7
|
+
"examples": [
|
|
8
|
+
"<%= config.bin %> <%= command.id %>",
|
|
9
|
+
"<%= config.bin %> <%= command.id %> --database=postgres --storage=postgres"
|
|
10
|
+
],
|
|
11
|
+
"flags": {
|
|
12
|
+
"directory": {
|
|
13
|
+
"description": "Directory containing PowerSync config. Defaults to \"powersync\". This is required if multiple powersync config files are present in subdirectories of the current working directory.",
|
|
14
|
+
"helpGroup": "PROJECT",
|
|
15
|
+
"name": "directory",
|
|
16
|
+
"default": "powersync",
|
|
17
|
+
"hasDynamicHelp": false,
|
|
18
|
+
"multiple": false,
|
|
19
|
+
"type": "option"
|
|
20
|
+
},
|
|
21
|
+
"api-url": {
|
|
22
|
+
"description": "PowerSync API URL. Resolved: flag → cli.yaml → API_URL environment variable.",
|
|
23
|
+
"helpGroup": "SELF_HOSTED_PROJECT",
|
|
24
|
+
"name": "api-url",
|
|
25
|
+
"required": false,
|
|
26
|
+
"hasDynamicHelp": false,
|
|
27
|
+
"multiple": false,
|
|
28
|
+
"type": "option"
|
|
29
|
+
},
|
|
30
|
+
"database": {
|
|
31
|
+
"description": "Database module for replication source. Omit to be prompted.",
|
|
32
|
+
"name": "database",
|
|
33
|
+
"required": false,
|
|
34
|
+
"hasDynamicHelp": false,
|
|
35
|
+
"multiple": false,
|
|
36
|
+
"options": [
|
|
37
|
+
"postgres",
|
|
38
|
+
"external",
|
|
39
|
+
"none"
|
|
40
|
+
],
|
|
41
|
+
"type": "option"
|
|
42
|
+
},
|
|
43
|
+
"storage": {
|
|
44
|
+
"description": "Storage module for PowerSync bucket metadata. Omit to be prompted.",
|
|
45
|
+
"name": "storage",
|
|
46
|
+
"required": false,
|
|
47
|
+
"hasDynamicHelp": false,
|
|
48
|
+
"multiple": false,
|
|
49
|
+
"options": [
|
|
50
|
+
"postgres",
|
|
51
|
+
"external",
|
|
52
|
+
"none"
|
|
53
|
+
],
|
|
54
|
+
"type": "option"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"hasDynamicHelp": false,
|
|
58
|
+
"hiddenAliases": [],
|
|
59
|
+
"id": "docker:configure",
|
|
60
|
+
"pluginAlias": "@powersync/cli-plugin-docker",
|
|
61
|
+
"pluginName": "@powersync/cli-plugin-docker",
|
|
62
|
+
"pluginType": "core",
|
|
63
|
+
"strict": true,
|
|
64
|
+
"summary": "Configures a self hosted project with Docker Compose services.",
|
|
65
|
+
"enableJsonFlag": false,
|
|
66
|
+
"commandHelpGroup": "LOCAL DEVELOPMENT",
|
|
67
|
+
"isESM": true,
|
|
68
|
+
"relativePath": [
|
|
69
|
+
"dist",
|
|
70
|
+
"commands",
|
|
71
|
+
"docker",
|
|
72
|
+
"configure.js"
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
"docker": {
|
|
76
|
+
"aliases": [],
|
|
77
|
+
"args": {},
|
|
78
|
+
"description": "Scaffold and run a self-hosted PowerSync stack via Docker. Use `docker configure` to create powersync/docker/, then `docker reset` (stop+remove then start) or `docker start` / `docker stop`.",
|
|
79
|
+
"examples": [
|
|
80
|
+
"<%= config.bin %> <%= command.id %>"
|
|
81
|
+
],
|
|
82
|
+
"flags": {
|
|
83
|
+
"directory": {
|
|
84
|
+
"description": "Directory containing PowerSync config. Defaults to \"powersync\". This is required if multiple powersync config files are present in subdirectories of the current working directory.",
|
|
85
|
+
"helpGroup": "PROJECT",
|
|
86
|
+
"name": "directory",
|
|
87
|
+
"default": "powersync",
|
|
88
|
+
"hasDynamicHelp": false,
|
|
89
|
+
"multiple": false,
|
|
90
|
+
"type": "option"
|
|
91
|
+
},
|
|
92
|
+
"api-url": {
|
|
93
|
+
"description": "PowerSync API URL. Resolved: flag → cli.yaml → API_URL environment variable.",
|
|
94
|
+
"helpGroup": "SELF_HOSTED_PROJECT",
|
|
95
|
+
"name": "api-url",
|
|
96
|
+
"required": false,
|
|
97
|
+
"hasDynamicHelp": false,
|
|
98
|
+
"multiple": false,
|
|
99
|
+
"type": "option"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"hasDynamicHelp": false,
|
|
103
|
+
"hidden": true,
|
|
104
|
+
"hiddenAliases": [],
|
|
105
|
+
"id": "docker",
|
|
106
|
+
"pluginAlias": "@powersync/cli-plugin-docker",
|
|
107
|
+
"pluginName": "@powersync/cli-plugin-docker",
|
|
108
|
+
"pluginType": "core",
|
|
109
|
+
"strict": true,
|
|
110
|
+
"summary": "[Self-hosted only] Manage self-hosted PowerSync with Docker Compose (configure, reset, start, stop).",
|
|
111
|
+
"enableJsonFlag": false,
|
|
112
|
+
"commandHelpGroup": "LOCAL DEVELOPMENT",
|
|
113
|
+
"isESM": true,
|
|
114
|
+
"relativePath": [
|
|
115
|
+
"dist",
|
|
116
|
+
"commands",
|
|
117
|
+
"docker",
|
|
118
|
+
"index.js"
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
"docker:reset": {
|
|
122
|
+
"aliases": [],
|
|
123
|
+
"args": {},
|
|
124
|
+
"description": "Run `docker compose down` then `docker compose up -d --wait`: stops and removes containers, then starts the stack and waits for services (including PowerSync) to be healthy. Use when you want a clean bring-up (e.g. after config changes). Use `powersync status` to debug running instances.",
|
|
125
|
+
"examples": [
|
|
126
|
+
"<%= config.bin %> <%= command.id %>"
|
|
127
|
+
],
|
|
128
|
+
"flags": {
|
|
129
|
+
"directory": {
|
|
130
|
+
"description": "Directory containing PowerSync config. Defaults to \"powersync\". This is required if multiple powersync config files are present in subdirectories of the current working directory.",
|
|
131
|
+
"helpGroup": "PROJECT",
|
|
132
|
+
"name": "directory",
|
|
133
|
+
"default": "powersync",
|
|
134
|
+
"hasDynamicHelp": false,
|
|
135
|
+
"multiple": false,
|
|
136
|
+
"type": "option"
|
|
137
|
+
},
|
|
138
|
+
"api-url": {
|
|
139
|
+
"description": "PowerSync API URL. Resolved: flag → cli.yaml → API_URL environment variable.",
|
|
140
|
+
"helpGroup": "SELF_HOSTED_PROJECT",
|
|
141
|
+
"name": "api-url",
|
|
142
|
+
"required": false,
|
|
143
|
+
"hasDynamicHelp": false,
|
|
144
|
+
"multiple": false,
|
|
145
|
+
"type": "option"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"hasDynamicHelp": false,
|
|
149
|
+
"hiddenAliases": [],
|
|
150
|
+
"id": "docker:reset",
|
|
151
|
+
"pluginAlias": "@powersync/cli-plugin-docker",
|
|
152
|
+
"pluginName": "@powersync/cli-plugin-docker",
|
|
153
|
+
"pluginType": "core",
|
|
154
|
+
"strict": true,
|
|
155
|
+
"summary": "Reset the self-hosted PowerSync stack (stop and remove, then start).",
|
|
156
|
+
"enableJsonFlag": false,
|
|
157
|
+
"commandHelpGroup": "LOCAL DEVELOPMENT",
|
|
158
|
+
"isESM": true,
|
|
159
|
+
"relativePath": [
|
|
160
|
+
"dist",
|
|
161
|
+
"commands",
|
|
162
|
+
"docker",
|
|
163
|
+
"reset.js"
|
|
164
|
+
]
|
|
165
|
+
},
|
|
166
|
+
"docker:start": {
|
|
167
|
+
"aliases": [],
|
|
168
|
+
"args": {},
|
|
169
|
+
"description": "Runs `docker compose up -d --wait` for the project docker/ compose file; waits for services (including PowerSync) to be healthy. Use `powersync status` to debug running instances.",
|
|
170
|
+
"examples": [
|
|
171
|
+
"<%= config.bin %> <%= command.id %>"
|
|
172
|
+
],
|
|
173
|
+
"flags": {
|
|
174
|
+
"directory": {
|
|
175
|
+
"description": "Directory containing PowerSync config. Defaults to \"powersync\". This is required if multiple powersync config files are present in subdirectories of the current working directory.",
|
|
176
|
+
"helpGroup": "PROJECT",
|
|
177
|
+
"name": "directory",
|
|
178
|
+
"default": "powersync",
|
|
179
|
+
"hasDynamicHelp": false,
|
|
180
|
+
"multiple": false,
|
|
181
|
+
"type": "option"
|
|
182
|
+
},
|
|
183
|
+
"api-url": {
|
|
184
|
+
"description": "PowerSync API URL. Resolved: flag → cli.yaml → API_URL environment variable.",
|
|
185
|
+
"helpGroup": "SELF_HOSTED_PROJECT",
|
|
186
|
+
"name": "api-url",
|
|
187
|
+
"required": false,
|
|
188
|
+
"hasDynamicHelp": false,
|
|
189
|
+
"multiple": false,
|
|
190
|
+
"type": "option"
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
"hasDynamicHelp": false,
|
|
194
|
+
"hiddenAliases": [],
|
|
195
|
+
"id": "docker:start",
|
|
196
|
+
"pluginAlias": "@powersync/cli-plugin-docker",
|
|
197
|
+
"pluginName": "@powersync/cli-plugin-docker",
|
|
198
|
+
"pluginType": "core",
|
|
199
|
+
"strict": true,
|
|
200
|
+
"summary": "Start the self-hosted PowerSync stack via Docker Compose.",
|
|
201
|
+
"enableJsonFlag": false,
|
|
202
|
+
"commandHelpGroup": "LOCAL DEVELOPMENT",
|
|
203
|
+
"isESM": true,
|
|
204
|
+
"relativePath": [
|
|
205
|
+
"dist",
|
|
206
|
+
"commands",
|
|
207
|
+
"docker",
|
|
208
|
+
"start.js"
|
|
209
|
+
]
|
|
210
|
+
},
|
|
211
|
+
"docker:stop": {
|
|
212
|
+
"aliases": [],
|
|
213
|
+
"args": {},
|
|
214
|
+
"description": "Run `docker compose -p <project-name> stop` (containers are not removed by default). Does not require the project directory or a compose file, so you can run it from anywhere (e.g. after a reset conflict). Use --project-name or run from a project with cli.yaml to choose which project to stop. Use --remove to also remove the containers. Use --remove-volumes to also remove volumes (e.g. to re-run DB init scripts on next reset).",
|
|
215
|
+
"examples": [
|
|
216
|
+
"<%= config.bin %> <%= command.id %>",
|
|
217
|
+
"<%= config.bin %> <%= command.id %> --project-name=powersync_myapp --remove"
|
|
218
|
+
],
|
|
219
|
+
"flags": {
|
|
220
|
+
"directory": {
|
|
221
|
+
"description": "Directory containing PowerSync config. Defaults to \"powersync\". This is required if multiple powersync config files are present in subdirectories of the current working directory.",
|
|
222
|
+
"helpGroup": "PROJECT",
|
|
223
|
+
"name": "directory",
|
|
224
|
+
"default": "powersync",
|
|
225
|
+
"hasDynamicHelp": false,
|
|
226
|
+
"multiple": false,
|
|
227
|
+
"type": "option"
|
|
228
|
+
},
|
|
229
|
+
"api-url": {
|
|
230
|
+
"description": "PowerSync API URL. Resolved: flag → cli.yaml → API_URL environment variable.",
|
|
231
|
+
"helpGroup": "SELF_HOSTED_PROJECT",
|
|
232
|
+
"name": "api-url",
|
|
233
|
+
"required": false,
|
|
234
|
+
"hasDynamicHelp": false,
|
|
235
|
+
"multiple": false,
|
|
236
|
+
"type": "option"
|
|
237
|
+
},
|
|
238
|
+
"project-name": {
|
|
239
|
+
"description": "Docker Compose project name to stop (e.g. powersync_myapp). If omitted and run from a project directory, uses plugins.docker.project_name from cli.yaml. Pass this to stop from any directory without loading the project.",
|
|
240
|
+
"name": "project-name",
|
|
241
|
+
"hasDynamicHelp": false,
|
|
242
|
+
"multiple": false,
|
|
243
|
+
"type": "option"
|
|
244
|
+
},
|
|
245
|
+
"remove": {
|
|
246
|
+
"description": "Remove containers after stopping (docker compose down). By default only stop (docker compose stop).",
|
|
247
|
+
"name": "remove",
|
|
248
|
+
"allowNo": false,
|
|
249
|
+
"type": "boolean"
|
|
250
|
+
},
|
|
251
|
+
"remove-volumes": {
|
|
252
|
+
"description": "Remove named volumes (docker compose down -v). Use to reset database/storage so init scripts run again on next reset. Implies --remove.",
|
|
253
|
+
"name": "remove-volumes",
|
|
254
|
+
"allowNo": false,
|
|
255
|
+
"type": "boolean"
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
"hasDynamicHelp": false,
|
|
259
|
+
"hiddenAliases": [],
|
|
260
|
+
"id": "docker:stop",
|
|
261
|
+
"pluginAlias": "@powersync/cli-plugin-docker",
|
|
262
|
+
"pluginName": "@powersync/cli-plugin-docker",
|
|
263
|
+
"pluginType": "core",
|
|
264
|
+
"strict": true,
|
|
265
|
+
"summary": "Stop a PowerSync Docker Compose project by name.",
|
|
266
|
+
"enableJsonFlag": false,
|
|
267
|
+
"commandHelpGroup": "LOCAL DEVELOPMENT",
|
|
268
|
+
"isESM": true,
|
|
269
|
+
"relativePath": [
|
|
270
|
+
"dist",
|
|
271
|
+
"commands",
|
|
272
|
+
"docker",
|
|
273
|
+
"stop.js"
|
|
274
|
+
]
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
"version": "0.0.0-dev-20260305082615"
|
|
278
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@powersync/cli-plugin-docker",
|
|
3
|
+
"description": "PowerSync CLI plugin: reset, start, and stop self-hosted instances using Docker Compose",
|
|
4
|
+
"version": "0.0.0-dev-20260305082615",
|
|
5
|
+
"author": "POWERSYNC",
|
|
6
|
+
"license": "FSL-1.1-ALv2",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"templates",
|
|
13
|
+
"oclif.manifest.json"
|
|
14
|
+
],
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/powersync-ja/powersync-cli"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public",
|
|
21
|
+
"registry": "https://registry.npmjs.org/"
|
|
22
|
+
},
|
|
23
|
+
"bugs": "https://github.com/powersync-ja/powersync-cli/issues",
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@inquirer/prompts": "^7.2.0",
|
|
26
|
+
"@oclif/core": "^4",
|
|
27
|
+
"@powersync/service-types": "^0.15.0",
|
|
28
|
+
"@powersync/service-schema": "^1.20.0",
|
|
29
|
+
"yaml": "^2",
|
|
30
|
+
"@powersync/cli-core": "0.0.0-dev-20260305082615",
|
|
31
|
+
"@powersync/cli-schemas": "0.0.0-dev-20260305082615"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/node": "^24",
|
|
35
|
+
"eslint": "^9",
|
|
36
|
+
"oclif": "^4",
|
|
37
|
+
"typescript": "^5"
|
|
38
|
+
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=18.0.0"
|
|
41
|
+
},
|
|
42
|
+
"oclif": {
|
|
43
|
+
"commands": "./dist/commands",
|
|
44
|
+
"topicSeparator": " ",
|
|
45
|
+
"topics": {
|
|
46
|
+
"docker": {
|
|
47
|
+
"description": "[Self-hosted only] Manage self-hosted PowerSync with Docker Compose (configure, reset, start, stop). Run \"powersync docker --help\" to list subcommands."
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"build": "tsc -b && node scripts/copy-template-resources.mjs",
|
|
53
|
+
"clean": "rm -rf dist tsconfig.tsbuildinfo",
|
|
54
|
+
"lint": "eslint ."
|
|
55
|
+
}
|
|
56
|
+
}
|