Skip to content

Commit a81df21

Browse files
improvement: reduce NPM dependency size (#21)
1 parent ef92f08 commit a81df21

6 files changed

Lines changed: 105 additions & 194 deletions

File tree

.changeset/tricky-eagles-draw.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'powersync': patch
3+
---
4+
5+
Reduce NPM dependency size

cli/src/commands/generate/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default class GenerateSchema extends SharedInstanceCommand {
3737

3838
async getCloudSchema(project: CloudProject): Promise<routes.GetSchemaResponse> {
3939
const { linked } = project;
40-
const client = await createCloudClient();
40+
const client = createCloudClient();
4141
return client.getInstanceSchema({
4242
app_id: linked.project_id,
4343
id: linked.instance_id,

cli/src/commands/pull/instance.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import {
77
getDefaultOrgId,
88
SERVICE_FILENAME,
99
ServiceType,
10-
SYNC_FILENAME
10+
SYNC_FILENAME,
11+
YAML_SYNC_RULES_SCHEMA
1112
} from '@powersync/cli-core';
1213
import { ServiceCloudConfig } from '@powersync/cli-schemas';
1314
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
@@ -145,7 +146,7 @@ export default class PullInstance extends CloudInstanceCommand {
145146
if (typeof fetched.syncRules === 'string') {
146147
const syncOutputName = !overwrite && syncExists ? SYNC_FETCHED_FILENAME : SYNC_FILENAME;
147148
const syncOutputPath = join(projectDir, syncOutputName);
148-
writeFileSync(syncOutputPath, fetched.syncRules, 'utf8');
149+
writeFileSync(syncOutputPath, YAML_SYNC_RULES_SCHEMA + '\n' + fetched.syncRules, 'utf8');
149150
this.log(`Wrote ${ux.colorize('blue', syncOutputName)} with sync config from the cloud.`);
150151
} else if (!fetched.syncRules && !syncExists) {
151152
// If there is no sync config in the cloud and no existing sync config locally, we should still create an empty sync-config.yaml with the correct header and schema reference

packages/cli-core/src/utils/env.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const DEFAULT_PS_MANAGEMENT_SERVICE_URL = 'https://powersync-api.journeyapps.com';
2-
const DEFAULT_PS_ACCOUNTS_HUB_SERVICE_URL = 'https://accounts.journeyapps.com';
2+
const DEFAULT_PS_ACCOUNTS_HUB_SERVICE_URL = 'https://accounts.powersync.com';
33
const DEFAULT_PS_DASHBOARD_URL = 'https://dashboard.powersync.com';
44

55
export type ENV = {

0 commit comments

Comments
 (0)