powersync 0.5.2 → 0.6.1
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/README.md +14 -14
- package/dist/commands/instance/config.js +2 -2
- package/dist/commands/instance/create.js +2 -2
- package/dist/commands/instance/deploy.js +2 -2
- package/dist/commands/instance/destroy.js +2 -2
- package/dist/commands/instance/generate-dev-token.js +2 -2
- package/dist/commands/instance/schema.js +2 -2
- package/dist/commands/instance/set.js +2 -2
- package/dist/commands/instance/status.js +2 -2
- package/dist/commands/instance/stop.js +2 -2
- package/dist/commands/instance/sync-rules/deploy.js +2 -2
- package/dist/commands/instance/sync-rules/generate-schema.js +2 -2
- package/dist/commands/instance/sync-rules/validate.js +2 -2
- package/dist/commands/instances.js +2 -2
- package/dist/service/accounts.client.js +4 -3
- package/dist/service/powersync.client.js +4 -3
- package/dist/service/utils.js +4 -3
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +8 -4
- package/oclif.manifest.json +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -90,7 +90,7 @@ EXAMPLES
|
|
|
90
90
|
$ npx powersync init
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
_See code: [src/commands/init.ts](https://github.com/powersync-ja/cli/blob/v0.
|
|
93
|
+
_See code: [src/commands/init.ts](https://github.com/powersync-ja/cli/blob/v0.6.1/src/commands/init.ts)_
|
|
94
94
|
|
|
95
95
|
## `powersync instance config`
|
|
96
96
|
|
|
@@ -107,7 +107,7 @@ EXAMPLES
|
|
|
107
107
|
$ npx powersync instance config
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
-
_See code: [src/commands/instance/config.ts](https://github.com/powersync-ja/cli/blob/v0.
|
|
110
|
+
_See code: [src/commands/instance/config.ts](https://github.com/powersync-ja/cli/blob/v0.6.1/src/commands/instance/config.ts)_
|
|
111
111
|
|
|
112
112
|
## `powersync instance create`
|
|
113
113
|
|
|
@@ -136,7 +136,7 @@ EXAMPLES
|
|
|
136
136
|
$ npx powersync instance create
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
-
_See code: [src/commands/instance/create.ts](https://github.com/powersync-ja/cli/blob/v0.
|
|
139
|
+
_See code: [src/commands/instance/create.ts](https://github.com/powersync-ja/cli/blob/v0.6.1/src/commands/instance/create.ts)_
|
|
140
140
|
|
|
141
141
|
## `powersync instance deploy`
|
|
142
142
|
|
|
@@ -162,7 +162,7 @@ EXAMPLES
|
|
|
162
162
|
$ npx powersync instance deploy
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
-
_See code: [src/commands/instance/deploy.ts](https://github.com/powersync-ja/cli/blob/v0.
|
|
165
|
+
_See code: [src/commands/instance/deploy.ts](https://github.com/powersync-ja/cli/blob/v0.6.1/src/commands/instance/deploy.ts)_
|
|
166
166
|
|
|
167
167
|
## `powersync instance destroy`
|
|
168
168
|
|
|
@@ -182,7 +182,7 @@ EXAMPLES
|
|
|
182
182
|
$ npx powersync instance destroy
|
|
183
183
|
```
|
|
184
184
|
|
|
185
|
-
_See code: [src/commands/instance/destroy.ts](https://github.com/powersync-ja/cli/blob/v0.
|
|
185
|
+
_See code: [src/commands/instance/destroy.ts](https://github.com/powersync-ja/cli/blob/v0.6.1/src/commands/instance/destroy.ts)_
|
|
186
186
|
|
|
187
187
|
## `powersync instance generate-dev-token`
|
|
188
188
|
|
|
@@ -203,7 +203,7 @@ EXAMPLES
|
|
|
203
203
|
$ npx powersync instance generate-dev-token
|
|
204
204
|
```
|
|
205
205
|
|
|
206
|
-
_See code: [src/commands/instance/generate-dev-token.ts](https://github.com/powersync-ja/cli/blob/v0.
|
|
206
|
+
_See code: [src/commands/instance/generate-dev-token.ts](https://github.com/powersync-ja/cli/blob/v0.6.1/src/commands/instance/generate-dev-token.ts)_
|
|
207
207
|
|
|
208
208
|
## `powersync instance schema`
|
|
209
209
|
|
|
@@ -220,7 +220,7 @@ EXAMPLES
|
|
|
220
220
|
$ npx powersync instance schema
|
|
221
221
|
```
|
|
222
222
|
|
|
223
|
-
_See code: [src/commands/instance/schema.ts](https://github.com/powersync-ja/cli/blob/v0.
|
|
223
|
+
_See code: [src/commands/instance/schema.ts](https://github.com/powersync-ja/cli/blob/v0.6.1/src/commands/instance/schema.ts)_
|
|
224
224
|
|
|
225
225
|
## `powersync instance set`
|
|
226
226
|
|
|
@@ -242,7 +242,7 @@ EXAMPLES
|
|
|
242
242
|
$ npx powersync instance set --instanceId=1234
|
|
243
243
|
```
|
|
244
244
|
|
|
245
|
-
_See code: [src/commands/instance/set.ts](https://github.com/powersync-ja/cli/blob/v0.
|
|
245
|
+
_See code: [src/commands/instance/set.ts](https://github.com/powersync-ja/cli/blob/v0.6.1/src/commands/instance/set.ts)_
|
|
246
246
|
|
|
247
247
|
## `powersync instance status`
|
|
248
248
|
|
|
@@ -267,7 +267,7 @@ EXAMPLES
|
|
|
267
267
|
$ npx powersync instance status --orgId=1234 --projectId=1234 --instanceId=1234 --authToken=1234
|
|
268
268
|
```
|
|
269
269
|
|
|
270
|
-
_See code: [src/commands/instance/status.ts](https://github.com/powersync-ja/cli/blob/v0.
|
|
270
|
+
_See code: [src/commands/instance/status.ts](https://github.com/powersync-ja/cli/blob/v0.6.1/src/commands/instance/status.ts)_
|
|
271
271
|
|
|
272
272
|
## `powersync instance stop`
|
|
273
273
|
|
|
@@ -287,7 +287,7 @@ EXAMPLES
|
|
|
287
287
|
$ npx powersync instance stop
|
|
288
288
|
```
|
|
289
289
|
|
|
290
|
-
_See code: [src/commands/instance/stop.ts](https://github.com/powersync-ja/cli/blob/v0.
|
|
290
|
+
_See code: [src/commands/instance/stop.ts](https://github.com/powersync-ja/cli/blob/v0.6.1/src/commands/instance/stop.ts)_
|
|
291
291
|
|
|
292
292
|
## `powersync instance sync-rules deploy`
|
|
293
293
|
|
|
@@ -312,7 +312,7 @@ EXAMPLES
|
|
|
312
312
|
$ npx powersync instance sync-rules deploy -f path/to/file
|
|
313
313
|
```
|
|
314
314
|
|
|
315
|
-
_See code: [src/commands/instance/sync-rules/deploy.ts](https://github.com/powersync-ja/cli/blob/v0.
|
|
315
|
+
_See code: [src/commands/instance/sync-rules/deploy.ts](https://github.com/powersync-ja/cli/blob/v0.6.1/src/commands/instance/sync-rules/deploy.ts)_
|
|
316
316
|
|
|
317
317
|
## `powersync instance sync-rules generate-schema`
|
|
318
318
|
|
|
@@ -338,7 +338,7 @@ EXAMPLES
|
|
|
338
338
|
$ npx powersync instance sync-rules generate-schema -f path/to/file
|
|
339
339
|
```
|
|
340
340
|
|
|
341
|
-
_See code: [src/commands/instance/sync-rules/generate-schema.ts](https://github.com/powersync-ja/cli/blob/v0.
|
|
341
|
+
_See code: [src/commands/instance/sync-rules/generate-schema.ts](https://github.com/powersync-ja/cli/blob/v0.6.1/src/commands/instance/sync-rules/generate-schema.ts)_
|
|
342
342
|
|
|
343
343
|
## `powersync instance sync-rules validate`
|
|
344
344
|
|
|
@@ -362,7 +362,7 @@ EXAMPLES
|
|
|
362
362
|
$ npx powersync instance sync-rules validate -f path/to/file
|
|
363
363
|
```
|
|
364
364
|
|
|
365
|
-
_See code: [src/commands/instance/sync-rules/validate.ts](https://github.com/powersync-ja/cli/blob/v0.
|
|
365
|
+
_See code: [src/commands/instance/sync-rules/validate.ts](https://github.com/powersync-ja/cli/blob/v0.6.1/src/commands/instance/sync-rules/validate.ts)_
|
|
366
366
|
|
|
367
367
|
## `powersync instances`
|
|
368
368
|
|
|
@@ -379,5 +379,5 @@ EXAMPLES
|
|
|
379
379
|
$ npx powersync instances
|
|
380
380
|
```
|
|
381
381
|
|
|
382
|
-
_See code: [src/commands/instances.ts](https://github.com/powersync-ja/cli/blob/v0.
|
|
382
|
+
_See code: [src/commands/instances.ts](https://github.com/powersync-ja/cli/blob/v0.6.1/src/commands/instances.ts)_
|
|
383
383
|
<!-- commandsstop -->
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Command, ux } from '@oclif/core';
|
|
2
2
|
import * as PowerSyncClient from '../../service/powersync.client.js';
|
|
3
|
-
import {
|
|
3
|
+
import { checkThatEnvVariablesAreSet, red } from '../../utils.js';
|
|
4
4
|
export default class InstanceConfig extends Command {
|
|
5
5
|
static description = 'Display the instance config.';
|
|
6
6
|
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
7
7
|
async run() {
|
|
8
|
-
|
|
8
|
+
checkThatEnvVariablesAreSet(this.config.bin, true);
|
|
9
9
|
const config = await PowerSyncClient.getInstanceConfig();
|
|
10
10
|
if (!config) {
|
|
11
11
|
return this.log(red('No instance config found.'));
|
|
@@ -4,7 +4,7 @@ import inquirer from 'inquirer';
|
|
|
4
4
|
import ora from 'ora';
|
|
5
5
|
import { generateCommonDeployQuestions } from '../../commands.utils.js';
|
|
6
6
|
import * as PowerSyncClient from '../../service/powersync.client.js';
|
|
7
|
-
import { bold,
|
|
7
|
+
import { bold, checkThatEnvVariablesAreSet, green, red, updateEnvFileVariableValue } from '../../utils.js';
|
|
8
8
|
export default class InstanceCreate extends Command {
|
|
9
9
|
static description = 'Create a new instance.';
|
|
10
10
|
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
@@ -22,7 +22,7 @@ export default class InstanceCreate extends Command {
|
|
|
22
22
|
useSupabaseAuth: Flags.boolean({ allowNo: true, char: 'b', description: 'Use Supabase auth.' })
|
|
23
23
|
};
|
|
24
24
|
async run() {
|
|
25
|
-
|
|
25
|
+
checkThatEnvVariablesAreSet(this.config.bin);
|
|
26
26
|
const { flags } = await this.parse(InstanceCreate);
|
|
27
27
|
const regions = await PowerSyncClient.getRegions();
|
|
28
28
|
let answers = {
|
|
@@ -4,7 +4,7 @@ import inquirer from 'inquirer';
|
|
|
4
4
|
import ora from 'ora';
|
|
5
5
|
import { generateCommonDeployQuestions } from '../../commands.utils.js';
|
|
6
6
|
import * as PowerSyncClient from '../../service/powersync.client.js';
|
|
7
|
-
import { bold,
|
|
7
|
+
import { bold, checkThatEnvVariablesAreSet, green, red } from '../../utils.js';
|
|
8
8
|
export default class InstanceDeploy extends Command {
|
|
9
9
|
static description = 'Deploy changes to an existing instance.';
|
|
10
10
|
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
@@ -20,7 +20,7 @@ export default class InstanceDeploy extends Command {
|
|
|
20
20
|
useSupabaseAuth: Flags.boolean({ allowNo: true, char: 'b', description: 'Use Supabase auth.' })
|
|
21
21
|
};
|
|
22
22
|
async run() {
|
|
23
|
-
|
|
23
|
+
checkThatEnvVariablesAreSet(this.config.bin, true);
|
|
24
24
|
const { flags } = await this.parse(InstanceDeploy);
|
|
25
25
|
let answers = {
|
|
26
26
|
databaseName: undefined,
|
|
@@ -2,7 +2,7 @@ import { Command, Flags, ux } from '@oclif/core';
|
|
|
2
2
|
import inquirer from 'inquirer';
|
|
3
3
|
import ora from 'ora';
|
|
4
4
|
import * as PowerSyncClient from '../../service/powersync.client.js';
|
|
5
|
-
import { bold,
|
|
5
|
+
import { bold, checkThatEnvVariablesAreSet, green, red } from '../../utils.js';
|
|
6
6
|
export default class InstanceDestroy extends Command {
|
|
7
7
|
static description = 'Destroy the current instance - THIS CANNOT BE UNDONE.';
|
|
8
8
|
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
@@ -10,7 +10,7 @@ export default class InstanceDestroy extends Command {
|
|
|
10
10
|
skipConfirmation: Flags.boolean({ char: 's', description: 'Ignore confirmation question.' })
|
|
11
11
|
};
|
|
12
12
|
async run() {
|
|
13
|
-
|
|
13
|
+
checkThatEnvVariablesAreSet(this.config.bin, true);
|
|
14
14
|
const { flags } = await this.parse(InstanceDestroy);
|
|
15
15
|
const config = await PowerSyncClient.getInstanceConfig();
|
|
16
16
|
const questions = [
|
|
@@ -2,7 +2,7 @@ import { Command, Flags, ux } from '@oclif/core';
|
|
|
2
2
|
import clipboard from 'clipboardy';
|
|
3
3
|
import inquirer from 'inquirer';
|
|
4
4
|
import * as PowerSyncClient from '../../service/powersync.client.js';
|
|
5
|
-
import { bold,
|
|
5
|
+
import { bold, checkThatEnvVariablesAreSet, convertSeconds, green } from '../../utils.js';
|
|
6
6
|
export default class InstanceGenerateDevToken extends Command {
|
|
7
7
|
static description = 'Generate a developer token using the Token subject/ User ID.';
|
|
8
8
|
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
@@ -14,7 +14,7 @@ export default class InstanceGenerateDevToken extends Command {
|
|
|
14
14
|
userId: Flags.string({ char: 'u', description: 'The Token subject/User ID for the developer token' })
|
|
15
15
|
};
|
|
16
16
|
async run() {
|
|
17
|
-
|
|
17
|
+
checkThatEnvVariablesAreSet(this.config.bin, true);
|
|
18
18
|
const { flags } = await this.parse(InstanceGenerateDevToken);
|
|
19
19
|
const questions = [
|
|
20
20
|
{
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/* eslint-disable perfectionist/sort-objects */
|
|
2
2
|
import { Command, ux } from '@oclif/core';
|
|
3
3
|
import * as PowerSyncClient from '../../service/powersync.client.js';
|
|
4
|
-
import {
|
|
4
|
+
import { checkThatEnvVariablesAreSet } from '../../utils.js';
|
|
5
5
|
export default class InstanceSchema extends Command {
|
|
6
6
|
static description = 'View the schema of the current instance.';
|
|
7
7
|
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
8
8
|
async run() {
|
|
9
|
-
|
|
9
|
+
checkThatEnvVariablesAreSet(this.config.bin, true);
|
|
10
10
|
const result = await PowerSyncClient.getInstanceSchema();
|
|
11
11
|
result.connections[0].schemas.map((schema) => {
|
|
12
12
|
ux.log(`\nSCHEMA: ${schema.name}\n`);
|
|
@@ -2,7 +2,7 @@ import { Command, Flags, ux } from '@oclif/core';
|
|
|
2
2
|
import inquirer from 'inquirer';
|
|
3
3
|
import * as PowerSyncClient from '../../service/powersync.client.js';
|
|
4
4
|
import { ENV_VARIABLES } from '../../service/powersync.client.js';
|
|
5
|
-
import { bold,
|
|
5
|
+
import { bold, checkThatEnvVariablesAreSet, green, updateEnvFileVariableValue } from '../../utils.js';
|
|
6
6
|
export default class InstanceSet extends Command {
|
|
7
7
|
static description = 'Set the current instance.';
|
|
8
8
|
static examples = ['<%= config.bin %> <%= command.id %>', '<%= config.bin %> <%= command.id %> --instanceId=1234'];
|
|
@@ -10,7 +10,7 @@ export default class InstanceSet extends Command {
|
|
|
10
10
|
instanceId: Flags.string({ char: 'i', description: 'Instance ID to change to.' })
|
|
11
11
|
};
|
|
12
12
|
async run() {
|
|
13
|
-
|
|
13
|
+
checkThatEnvVariablesAreSet(this.config.bin);
|
|
14
14
|
const { flags } = await this.parse(InstanceSet);
|
|
15
15
|
const list = await PowerSyncClient.getInstancesList();
|
|
16
16
|
const instances = list.instances.map((instance) => ({ name: instance.name, value: instance.id }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command, Flags, ux } from '@oclif/core';
|
|
2
2
|
import * as PowerSyncClient from '../../service/powersync.client.js';
|
|
3
|
-
import {
|
|
3
|
+
import { checkThatEnvVariablesAreSet, green, red } from '../../utils.js';
|
|
4
4
|
export default class InstanceStatus extends Command {
|
|
5
5
|
static description = 'View the status of the current instance. View the status of a different instance by using flags.';
|
|
6
6
|
static examples = [
|
|
@@ -28,7 +28,7 @@ export default class InstanceStatus extends Command {
|
|
|
28
28
|
async run() {
|
|
29
29
|
const { flags } = await this.parse(InstanceStatus);
|
|
30
30
|
if (!flags.authToken || !flags.instanceId || !flags.orgId || !flags.projectId) {
|
|
31
|
-
|
|
31
|
+
checkThatEnvVariablesAreSet(this.config.bin, true);
|
|
32
32
|
}
|
|
33
33
|
const diagnostics = await PowerSyncClient.getInstanceDiagnostics({
|
|
34
34
|
authToken: flags.authToken,
|
|
@@ -2,7 +2,7 @@ import { Command, Flags, ux } from '@oclif/core';
|
|
|
2
2
|
import inquirer from 'inquirer';
|
|
3
3
|
import ora from 'ora';
|
|
4
4
|
import * as PowerSyncClient from '../../service/powersync.client.js';
|
|
5
|
-
import { bold,
|
|
5
|
+
import { bold, checkThatEnvVariablesAreSet, red, yellow } from '../../utils.js';
|
|
6
6
|
export default class InstanceDeactivate extends Command {
|
|
7
7
|
static description = 'Stop the current instance.';
|
|
8
8
|
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
@@ -10,7 +10,7 @@ export default class InstanceDeactivate extends Command {
|
|
|
10
10
|
skipConfirmation: Flags.boolean({ char: 's', description: 'Ignore confirmation question.' })
|
|
11
11
|
};
|
|
12
12
|
async run() {
|
|
13
|
-
|
|
13
|
+
checkThatEnvVariablesAreSet(this.config.bin, true);
|
|
14
14
|
const { flags } = await this.parse(InstanceDeactivate);
|
|
15
15
|
const questions = [
|
|
16
16
|
{
|
|
@@ -3,7 +3,7 @@ import inquirer from 'inquirer';
|
|
|
3
3
|
import fs from 'node:fs';
|
|
4
4
|
import ora from 'ora';
|
|
5
5
|
import * as PowerSyncClient from '../../../service/powersync.client.js';
|
|
6
|
-
import { bold,
|
|
6
|
+
import { bold, checkThatEnvVariablesAreSet, green, red } from '../../../utils.js';
|
|
7
7
|
export default class SyncRulesDeploy extends Command {
|
|
8
8
|
static description = 'Deploy sync rules from a local sync rules config file to the current instance.';
|
|
9
9
|
static examples = [
|
|
@@ -16,7 +16,7 @@ export default class SyncRulesDeploy extends Command {
|
|
|
16
16
|
skipConfirmation: Flags.boolean({ char: 's', description: 'Ignore confirmation question.' })
|
|
17
17
|
};
|
|
18
18
|
async run() {
|
|
19
|
-
|
|
19
|
+
checkThatEnvVariablesAreSet(this.config.bin, true);
|
|
20
20
|
const { flags } = await this.parse(SyncRulesDeploy);
|
|
21
21
|
const questions = [
|
|
22
22
|
{
|
|
@@ -3,7 +3,7 @@ import inquirer from 'inquirer';
|
|
|
3
3
|
import fs from 'node:fs';
|
|
4
4
|
import { LANGUAGES } from '../../../constants.js';
|
|
5
5
|
import * as PowerSyncClient from '../../../service/powersync.client.js';
|
|
6
|
-
import {
|
|
6
|
+
import { checkThatEnvVariablesAreSet, green, red } from '../../../utils.js';
|
|
7
7
|
export default class SyncRulesGenerateSchema extends Command {
|
|
8
8
|
static description = 'Generate schema in your language from your sync rules config file.';
|
|
9
9
|
static examples = [
|
|
@@ -20,7 +20,7 @@ export default class SyncRulesGenerateSchema extends Command {
|
|
|
20
20
|
})
|
|
21
21
|
};
|
|
22
22
|
async run() {
|
|
23
|
-
|
|
23
|
+
checkThatEnvVariablesAreSet(this.config.bin, true);
|
|
24
24
|
const { flags } = await this.parse(SyncRulesGenerateSchema);
|
|
25
25
|
const questions = [
|
|
26
26
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command, Flags, ux } from '@oclif/core';
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import * as PowerSyncClient from '../../../service/powersync.client.js';
|
|
4
|
-
import {
|
|
4
|
+
import { checkThatEnvVariablesAreSet, green, red } from '../../../utils.js';
|
|
5
5
|
export default class SyncRulesValidate extends Command {
|
|
6
6
|
static description = 'Validate sync rules from a local sync rules config file.';
|
|
7
7
|
static examples = [
|
|
@@ -13,7 +13,7 @@ export default class SyncRulesValidate extends Command {
|
|
|
13
13
|
filePath: Flags.string({ char: 'f', description: 'Path to the sync rules config file.', required: true })
|
|
14
14
|
};
|
|
15
15
|
async run() {
|
|
16
|
-
|
|
16
|
+
checkThatEnvVariablesAreSet(this.config.bin, true);
|
|
17
17
|
const { flags } = await this.parse(SyncRulesValidate);
|
|
18
18
|
const syncRules = fs.readFileSync(flags.filePath, 'utf8');
|
|
19
19
|
const validation = await PowerSyncClient.validateSyncRules(syncRules);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Command, ux } from '@oclif/core';
|
|
2
2
|
import * as AccountsClient from '../service/accounts.client.js';
|
|
3
3
|
import * as PowerSyncClient from '../service/powersync.client.js';
|
|
4
|
-
import { bold,
|
|
4
|
+
import { bold, checkThatEnvVariablesAreSet, green, red } from '../utils.js';
|
|
5
5
|
export default class InstancesList extends Command {
|
|
6
6
|
static description = 'View list of instances.';
|
|
7
7
|
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
8
8
|
async run() {
|
|
9
|
-
|
|
9
|
+
checkThatEnvVariablesAreSet(this.config.bin, false);
|
|
10
10
|
const project = await AccountsClient.getCurrentPowerSyncProject();
|
|
11
11
|
const list = await PowerSyncClient.getInstancesList();
|
|
12
12
|
const { instances } = list;
|
|
@@ -11142,7 +11142,7 @@ const ENDPOINTS = {
|
|
|
11142
11142
|
|
|
11143
11143
|
var author = "JourneyApps";
|
|
11144
11144
|
var bin = {
|
|
11145
|
-
|
|
11145
|
+
powersync: "./bin/run.js"
|
|
11146
11146
|
};
|
|
11147
11147
|
var publishConfig = {
|
|
11148
11148
|
registry: "https://registry.npmjs.org/",
|
|
@@ -11157,7 +11157,7 @@ var files = [
|
|
|
11157
11157
|
"/dist",
|
|
11158
11158
|
"/oclif.manifest.json"
|
|
11159
11159
|
];
|
|
11160
|
-
var version = "0.
|
|
11160
|
+
var version = "0.6.1";
|
|
11161
11161
|
var bugs = "https://github.com/powersync-ja/cli/issues";
|
|
11162
11162
|
var types = "dist/index.d.ts";
|
|
11163
11163
|
var exports = "./lib/index.js";
|
|
@@ -11199,7 +11199,8 @@ var scripts = {
|
|
|
11199
11199
|
release: "pnpm build && pnpm changeset publish",
|
|
11200
11200
|
prettier: "prettier --write \"**/*.ts\"",
|
|
11201
11201
|
version: "pnpm run readme && git add README.md",
|
|
11202
|
-
"pack:tarballs": "oclif pack tarballs --parallel"
|
|
11202
|
+
"pack:tarballs": "oclif pack tarballs --parallel",
|
|
11203
|
+
"changeset:version": "pnpm changeset version && pnpm readme"
|
|
11203
11204
|
};
|
|
11204
11205
|
var dependencies = {
|
|
11205
11206
|
"@oclif/core": "^3.27.0",
|
|
@@ -17262,7 +17262,7 @@ const ENDPOINTS = {
|
|
|
17262
17262
|
|
|
17263
17263
|
var author = "JourneyApps";
|
|
17264
17264
|
var bin = {
|
|
17265
|
-
|
|
17265
|
+
powersync: "./bin/run.js"
|
|
17266
17266
|
};
|
|
17267
17267
|
var publishConfig = {
|
|
17268
17268
|
registry: "https://registry.npmjs.org/",
|
|
@@ -17277,7 +17277,7 @@ var files = [
|
|
|
17277
17277
|
"/dist",
|
|
17278
17278
|
"/oclif.manifest.json"
|
|
17279
17279
|
];
|
|
17280
|
-
var version = "0.
|
|
17280
|
+
var version = "0.6.1";
|
|
17281
17281
|
var bugs = "https://github.com/powersync-ja/cli/issues";
|
|
17282
17282
|
var types$2 = "dist/index.d.ts";
|
|
17283
17283
|
var exports = "./lib/index.js";
|
|
@@ -17319,7 +17319,8 @@ var scripts = {
|
|
|
17319
17319
|
release: "pnpm build && pnpm changeset publish",
|
|
17320
17320
|
prettier: "prettier --write \"**/*.ts\"",
|
|
17321
17321
|
version: "pnpm run readme && git add README.md",
|
|
17322
|
-
"pack:tarballs": "oclif pack tarballs --parallel"
|
|
17322
|
+
"pack:tarballs": "oclif pack tarballs --parallel",
|
|
17323
|
+
"changeset:version": "pnpm changeset version && pnpm readme"
|
|
17323
17324
|
};
|
|
17324
17325
|
var dependencies$1 = {
|
|
17325
17326
|
"@oclif/core": "^3.27.0",
|
package/dist/service/utils.js
CHANGED
|
@@ -3,7 +3,7 @@ import path from 'node:path';
|
|
|
3
3
|
|
|
4
4
|
var author = "JourneyApps";
|
|
5
5
|
var bin = {
|
|
6
|
-
|
|
6
|
+
powersync: "./bin/run.js"
|
|
7
7
|
};
|
|
8
8
|
var publishConfig = {
|
|
9
9
|
registry: "https://registry.npmjs.org/",
|
|
@@ -18,7 +18,7 @@ var files = [
|
|
|
18
18
|
"/dist",
|
|
19
19
|
"/oclif.manifest.json"
|
|
20
20
|
];
|
|
21
|
-
var version = "0.
|
|
21
|
+
var version = "0.6.1";
|
|
22
22
|
var bugs = "https://github.com/powersync-ja/cli/issues";
|
|
23
23
|
var types = "dist/index.d.ts";
|
|
24
24
|
var exports = "./lib/index.js";
|
|
@@ -60,7 +60,8 @@ var scripts = {
|
|
|
60
60
|
release: "pnpm build && pnpm changeset publish",
|
|
61
61
|
prettier: "prettier --write \"**/*.ts\"",
|
|
62
62
|
version: "pnpm run readme && git add README.md",
|
|
63
|
-
"pack:tarballs": "oclif pack tarballs --parallel"
|
|
63
|
+
"pack:tarballs": "oclif pack tarballs --parallel",
|
|
64
|
+
"changeset:version": "pnpm changeset version && pnpm readme"
|
|
64
65
|
};
|
|
65
66
|
var dependencies = {
|
|
66
67
|
"@oclif/core": "^3.27.0",
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const checkThatEnvVariablesAreSet: (cliName: string, requiresInstanceId?: boolean) => undefined;
|
|
2
2
|
export declare const updateEnvFileVariableValue: (variableName: string, newValue: string) => void;
|
|
3
3
|
export declare const bold: (text: string) => string;
|
|
4
4
|
export declare const green: (text: string) => string;
|
package/dist/utils.js
CHANGED
|
@@ -3,15 +3,19 @@ import fs from 'node:fs';
|
|
|
3
3
|
import { ENV_FILE_PATH } from './constants.js';
|
|
4
4
|
import { ENV_VARIABLES } from './service/powersync.client.js';
|
|
5
5
|
// Add cliName as argument because we don't have access to this.config.bin in this file
|
|
6
|
-
export const
|
|
6
|
+
export const checkThatEnvVariablesAreSet = (cliName, requiresInstanceId = false) => {
|
|
7
7
|
const requiredProperties = [ENV_VARIABLES.PROJECT_ID, ENV_VARIABLES.AUTH_TOKEN, ENV_VARIABLES.ORG_ID];
|
|
8
8
|
const missingProperties = requiredProperties.filter((prop) => !process.env[prop]);
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
const envFileExists = fs.existsSync(ENV_FILE_PATH);
|
|
10
|
+
if (missingProperties.length > 0 && envFileExists) {
|
|
11
|
+
ux.error(red(`CLI has not been initialized correctly. Please run ${green(`"${cliName} init"`)}.`), { exit: 1 });
|
|
12
|
+
}
|
|
13
|
+
if (missingProperties.length > 0 && !envFileExists) {
|
|
14
|
+
ux.error(red(`Please include ${green(missingProperties.join(', '))} when you run the command or run ${green(`"${cliName} init"`)}.`), { exit: 1 });
|
|
11
15
|
}
|
|
12
16
|
const isInstanceIdRequired = requiresInstanceId && !process.env[ENV_VARIABLES.INSTANCE_ID];
|
|
13
17
|
if (isInstanceIdRequired) {
|
|
14
|
-
return ux.error(`This command requires a configured instance. Please set one by running ${green('"powersync instance set"')}
|
|
18
|
+
return ux.error(red(`This command requires a configured instance. Please set one by running ${green('"powersync instance set"')} or include it when you run the command ${green('"INSTANCE_ID=your_instance_id"')}.`), {
|
|
15
19
|
exit: 1
|
|
16
20
|
});
|
|
17
21
|
}
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "JourneyApps",
|
|
3
3
|
"bin": {
|
|
4
|
-
"
|
|
4
|
+
"powersync": "./bin/run.js"
|
|
5
5
|
},
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"/dist",
|
|
17
17
|
"/oclif.manifest.json"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.
|
|
19
|
+
"version": "0.6.1",
|
|
20
20
|
"bugs": "https://github.com/powersync-ja/cli/issues",
|
|
21
21
|
"types": "dist/index.d.ts",
|
|
22
22
|
"exports": "./lib/index.js",
|
|
@@ -96,6 +96,7 @@
|
|
|
96
96
|
"release": "pnpm build && pnpm changeset publish",
|
|
97
97
|
"prettier": "prettier --write \"**/*.ts\"",
|
|
98
98
|
"version": "pnpm run readme && git add README.md",
|
|
99
|
-
"pack:tarballs": "oclif pack tarballs --parallel"
|
|
99
|
+
"pack:tarballs": "oclif pack tarballs --parallel",
|
|
100
|
+
"changeset:version": "pnpm changeset version && pnpm readme"
|
|
100
101
|
}
|
|
101
102
|
}
|