@symbo.ls/cli 2.33.36 → 2.33.37
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/push.js +7 -4
- package/bin/sync.js +5 -3
- package/package.json +5 -5
package/bin/push.js
CHANGED
|
@@ -16,6 +16,7 @@ import { loadSymbolsConfig, resolveDistDir } from '../helpers/symbolsConfig.js'
|
|
|
16
16
|
import { loadCliConfig, readLock, writeLock, updateLegacySymbolsJson } from '../helpers/config.js'
|
|
17
17
|
import { stripOrderFields } from '../helpers/orderUtils.js'
|
|
18
18
|
import { augmentProjectWithLocalPackageDependencies, findNearestPackageJson } from '../helpers/dependenciesUtils.js'
|
|
19
|
+
import { stringifyFunctionsForTransport } from '../helpers/transportUtils.js'
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
async function buildLocalProject (distDir) {
|
|
@@ -153,8 +154,10 @@ export async function pushProjectChanges(options) {
|
|
|
153
154
|
console.log(chalk.gray('Server state fetched successfully'))
|
|
154
155
|
|
|
155
156
|
// Calculate coarse local changes vs server snapshot (or base)
|
|
156
|
-
|
|
157
|
-
const
|
|
157
|
+
// Prepare safe, JSON-serialisable snapshots for diffing & transport (stringify functions)
|
|
158
|
+
const base = normalizeKeys(stringifyFunctionsForTransport(stripOrderFields(serverProject || {})))
|
|
159
|
+
const local = normalizeKeys(stringifyFunctionsForTransport(stripOrderFields(localProject)))
|
|
160
|
+
const changes = computeCoarseChanges(base, local)
|
|
158
161
|
|
|
159
162
|
if (!changes.length) {
|
|
160
163
|
console.log(chalk.bold.yellow('\nNo changes to push'))
|
|
@@ -169,7 +172,7 @@ export async function pushProjectChanges(options) {
|
|
|
169
172
|
})
|
|
170
173
|
|
|
171
174
|
// Confirm push
|
|
172
|
-
const shouldProceed = await confirmChanges(changes, base,
|
|
175
|
+
const shouldProceed = await confirmChanges(changes, base, local)
|
|
173
176
|
if (!shouldProceed) {
|
|
174
177
|
console.log(chalk.yellow('Push cancelled'))
|
|
175
178
|
return
|
|
@@ -185,7 +188,7 @@ export async function pushProjectChanges(options) {
|
|
|
185
188
|
const operationId = `cli-${Date.now()}`
|
|
186
189
|
// Derive granular changes against server base and compute orders using local for pending children
|
|
187
190
|
const { granularChanges } = preprocessChanges(base, changes)
|
|
188
|
-
const orders = computeOrdersForTuples(
|
|
191
|
+
const orders = computeOrdersForTuples(local, granularChanges)
|
|
189
192
|
const result = await postProjectChanges(projectId, authToken, {
|
|
190
193
|
branch,
|
|
191
194
|
type,
|
package/bin/sync.js
CHANGED
|
@@ -17,6 +17,7 @@ import { showAuthRequiredMessages, showBuildErrorMessages } from '../helpers/bui
|
|
|
17
17
|
import { loadSymbolsConfig, resolveDistDir } from '../helpers/symbolsConfig.js'
|
|
18
18
|
import { loadCliConfig, readLock, writeLock, getConfigPaths, updateLegacySymbolsJson } from '../helpers/config.js'
|
|
19
19
|
import { stripOrderFields } from '../helpers/orderUtils.js'
|
|
20
|
+
import { stringifyFunctionsForTransport } from '../helpers/transportUtils.js'
|
|
20
21
|
import {
|
|
21
22
|
augmentProjectWithLocalPackageDependencies,
|
|
22
23
|
ensureSchemaDependencies,
|
|
@@ -227,9 +228,10 @@ export async function syncProjectChanges(options) {
|
|
|
227
228
|
ensureSchemaDependencies(localProject)
|
|
228
229
|
|
|
229
230
|
// Generate coarse local and remote changes via simple three-way rebase
|
|
230
|
-
|
|
231
|
-
const
|
|
232
|
-
const
|
|
231
|
+
// Prepare safe, JSON-serialisable snapshots for diffing & transport (stringify functions)
|
|
232
|
+
const base = normalizeKeys(stringifyFunctionsForTransport(stripOrderFields(baseSnapshot || {})))
|
|
233
|
+
const local = normalizeKeys(stringifyFunctionsForTransport(stripOrderFields(localProject || {})))
|
|
234
|
+
const remote = normalizeKeys(stringifyFunctionsForTransport(stripOrderFields(serverProject || {})))
|
|
233
235
|
const { ours, theirs, conflicts, finalChanges } = threeWayRebase(base, local, remote)
|
|
234
236
|
|
|
235
237
|
const localChanges = ours
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/cli",
|
|
3
|
-
"version": "2.33.
|
|
3
|
+
"version": "2.33.37",
|
|
4
4
|
"description": "Fetch your Symbols configuration",
|
|
5
5
|
"main": "bin/fetch.js",
|
|
6
6
|
"author": "Symbols",
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"vpatch": "npm version patch && npm publish"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@symbo.ls/fetch": "^2.33.
|
|
19
|
-
"@symbo.ls/init": "^2.33.
|
|
20
|
-
"@symbo.ls/socket": "^2.33.
|
|
18
|
+
"@symbo.ls/fetch": "^2.33.37",
|
|
19
|
+
"@symbo.ls/init": "^2.33.37",
|
|
20
|
+
"@symbo.ls/socket": "^2.33.37",
|
|
21
21
|
"chalk": "^5.4.1",
|
|
22
22
|
"chokidar": "^4.0.3",
|
|
23
23
|
"commander": "^13.1.0",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"socket.io-client": "^4.8.1",
|
|
29
29
|
"v8-compile-cache": "^2.4.0"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "383eb71ccab284ca3b27477941b24d7152d51e67"
|
|
32
32
|
}
|