signet-auth 1.2.1 → 1.2.3
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/bin/sig.js +2 -2
- package/dist/sync/sync-engine.js +33 -2
- package/package.json +1 -1
package/bin/sig.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { readFileSync, existsSync } from 'node:fs';
|
|
4
|
-
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
5
5
|
import { dirname, join } from 'node:path';
|
|
6
6
|
import { execSync } from 'node:child_process';
|
|
7
7
|
|
|
@@ -50,7 +50,7 @@ async function main() {
|
|
|
50
50
|
|
|
51
51
|
buildIfNeeded();
|
|
52
52
|
|
|
53
|
-
const { run } = await import(join(rootDir, 'dist', 'cli', 'main.js'));
|
|
53
|
+
const { run } = await import(pathToFileURL(join(rootDir, 'dist', 'cli', 'main.js')).href);
|
|
54
54
|
await run(args);
|
|
55
55
|
}
|
|
56
56
|
|
package/dist/sync/sync-engine.js
CHANGED
|
@@ -132,8 +132,21 @@ export class SyncEngine {
|
|
|
132
132
|
const remoteYaml = await this.transport.readRemoteConfig(this.remote);
|
|
133
133
|
let doc;
|
|
134
134
|
if (remoteYaml === null) {
|
|
135
|
-
// Create a
|
|
136
|
-
doc = new YAML.Document({
|
|
135
|
+
// Create a full config so the remote passes validation
|
|
136
|
+
doc = new YAML.Document({
|
|
137
|
+
mode: 'browserless',
|
|
138
|
+
browser: {
|
|
139
|
+
browserDataDir: '~/.signet/browser-data',
|
|
140
|
+
channel: 'chrome',
|
|
141
|
+
headlessTimeout: 30000,
|
|
142
|
+
visibleTimeout: 120000,
|
|
143
|
+
waitUntil: 'load',
|
|
144
|
+
},
|
|
145
|
+
storage: {
|
|
146
|
+
credentialsDir: '~/.signet/credentials',
|
|
147
|
+
},
|
|
148
|
+
providers: localProviders,
|
|
149
|
+
});
|
|
137
150
|
}
|
|
138
151
|
else {
|
|
139
152
|
// Parse with Document to preserve comments
|
|
@@ -142,6 +155,24 @@ export class SyncEngine {
|
|
|
142
155
|
// Merge: local wins on push
|
|
143
156
|
const merged = { ...remoteProviders, ...localProviders };
|
|
144
157
|
doc.setIn(['providers'], doc.createNode(merged));
|
|
158
|
+
// Ensure required sections exist so remote passes validation
|
|
159
|
+
if (!doc.getIn(['mode'])) {
|
|
160
|
+
doc.setIn(['mode'], 'browserless');
|
|
161
|
+
}
|
|
162
|
+
if (!doc.getIn(['browser'])) {
|
|
163
|
+
doc.setIn(['browser'], doc.createNode({
|
|
164
|
+
browserDataDir: '~/.signet/browser-data',
|
|
165
|
+
channel: 'chrome',
|
|
166
|
+
headlessTimeout: 30000,
|
|
167
|
+
visibleTimeout: 120000,
|
|
168
|
+
waitUntil: 'load',
|
|
169
|
+
}));
|
|
170
|
+
}
|
|
171
|
+
if (!doc.getIn(['storage'])) {
|
|
172
|
+
doc.setIn(['storage'], doc.createNode({
|
|
173
|
+
credentialsDir: '~/.signet/credentials',
|
|
174
|
+
}));
|
|
175
|
+
}
|
|
145
176
|
}
|
|
146
177
|
await this.transport.writeRemoteConfig(this.remote, doc.toString());
|
|
147
178
|
return { providers: Object.keys(localProviders) };
|