@proteinjs/db 1.47.1 → 1.47.2
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/CHANGELOG.md +8 -0
- package/dist/generated/test/index.js +1 -1
- package/dist/test/SearchTokenizer.test.js +2 -2
- package/dist/test/SourceRecordLoader.test.js +6 -6
- package/dist/test/reusable/CrudTests.js +1 -1
- package/dist/test/reusable/CrudTests.js.map +1 -1
- package/dist/test/reusable/SourceRecordSyncTests.js +5 -5
- package/dist/test/reusable/SourceRecordSyncTests.js.map +1 -1
- package/generated/test/index.ts +1 -1
- package/package.json +2 -2
- package/test/SearchTokenizer.test.ts +2 -2
- package/test/SourceRecordLoader.test.ts +6 -6
- package/test/reusable/CrudTests.ts +1 -1
- package/test/reusable/SourceRecordSyncTests.ts +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proteinjs/db",
|
|
3
|
-
"version": "1.47.
|
|
3
|
+
"version": "1.47.2",
|
|
4
4
|
"main": "./dist/generated/index.js",
|
|
5
5
|
"types": "./dist/generated/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"ts-jest": "29.1.1",
|
|
67
67
|
"typescript": "5.2.2"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "5811ffac3d235bce810460223eaa567b9f36a3a6"
|
|
70
70
|
}
|
|
@@ -24,8 +24,8 @@ describe('SearchTokenizer', () => {
|
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
test('normalization: case folds, punctuation splits words, numbers are word characters', () => {
|
|
27
|
-
const tokens = tokenizer.tokensForValue('
|
|
28
|
-
expect(tokens).toContain('w:
|
|
27
|
+
const tokens = tokenizer.tokensForValue('Utf8-Dev NOTES');
|
|
28
|
+
expect(tokens).toContain('w:utf8');
|
|
29
29
|
expect(tokens).toContain('w:dev');
|
|
30
30
|
expect(tokens).toContain('w:notes');
|
|
31
31
|
});
|
|
@@ -173,7 +173,7 @@ describe('SourceRecordLoader.hasChanges — stamp hygiene on the migration ledge
|
|
|
173
173
|
description: 'Marks every existing account onboarded',
|
|
174
174
|
run: async () => undefined,
|
|
175
175
|
isLoadedFromSource: true,
|
|
176
|
-
sourcePackage: '@
|
|
176
|
+
sourcePackage: '@acme/app-server',
|
|
177
177
|
sourcePackageVersion: '1.24.0',
|
|
178
178
|
...overrides,
|
|
179
179
|
});
|
|
@@ -183,7 +183,7 @@ describe('SourceRecordLoader.hasChanges — stamp hygiene on the migration ledge
|
|
|
183
183
|
id: 'bee7a15c-369f-4e77-abf7-ccd5dc3ae60c',
|
|
184
184
|
description: 'Marks every existing account onboarded',
|
|
185
185
|
isLoadedFromSource: true,
|
|
186
|
-
sourcePackage: '@
|
|
186
|
+
sourcePackage: '@acme/app-server',
|
|
187
187
|
sourcePackageVersion: '1.23.0',
|
|
188
188
|
status: 'success',
|
|
189
189
|
startTime: moment('2026-08-30T10:00:00Z'),
|
|
@@ -228,16 +228,16 @@ describe('getSourceRecordLoaders — declaration identity', () => {
|
|
|
228
228
|
it("carries the declaration's own name (the loader class) beside its package and qualified name", () => {
|
|
229
229
|
namedObjectCache()['@proteinjs/db/SourceRecordLoader'] = [
|
|
230
230
|
{
|
|
231
|
-
qualifiedName: '@
|
|
232
|
-
packageName: '@
|
|
231
|
+
qualifiedName: '@acme/app-server/BackfillOnboardingStateForExistingAccounts',
|
|
232
|
+
packageName: '@acme/app-server',
|
|
233
233
|
object: { table: {}, record: {} },
|
|
234
234
|
},
|
|
235
235
|
];
|
|
236
236
|
|
|
237
237
|
const [declaration] = getSourceRecordLoaders() as any[];
|
|
238
238
|
expect(declaration).toMatchObject({
|
|
239
|
-
source: '@
|
|
240
|
-
qualifiedName: '@
|
|
239
|
+
source: '@acme/app-server',
|
|
240
|
+
qualifiedName: '@acme/app-server/BackfillOnboardingStateForExistingAccounts',
|
|
241
241
|
name: 'BackfillOnboardingStateForExistingAccounts',
|
|
242
242
|
});
|
|
243
243
|
});
|
|
@@ -34,7 +34,7 @@ export const crudTests = (
|
|
|
34
34
|
name: 'Veronican',
|
|
35
35
|
department: 'Cake Factory',
|
|
36
36
|
object:
|
|
37
|
-
'{"cookie":{"originalMaxAge":5184000000,"expires":"2024-07-08T06:16:07.134Z","httpOnly":true,"path":"/"},"passport":{"user":"
|
|
37
|
+
'{"cookie":{"originalMaxAge":5184000000,"expires":"2024-07-08T06:16:07.134Z","httpOnly":true,"path":"/"},"passport":{"user":"someone@example.com"}}',
|
|
38
38
|
},
|
|
39
39
|
{ id: insertedEmployee.id }
|
|
40
40
|
);
|
|
@@ -612,9 +612,9 @@ export const sourceRecordSyncTests = (
|
|
|
612
612
|
|
|
613
613
|
/**
|
|
614
614
|
* Version-scoped pruning WITHIN one package: two servers running different VERSIONS of the
|
|
615
|
-
* same package against one shared database (
|
|
616
|
-
*
|
|
617
|
-
* older build deleted on every boot). Every row carries the declaring package's version;
|
|
615
|
+
* same package against one shared database (a real incident — the main application at one
|
|
616
|
+
* version of a shared package and a feature worktree at a later one, whose added declarations
|
|
617
|
+
* the older build deleted on every boot). Every row carries the declaring package's version;
|
|
618
618
|
* a boot never prunes (or flags) a row stamped by a NEWER version of the same package.
|
|
619
619
|
* Within the same or an older stamped version, the package stays authoritative:
|
|
620
620
|
* removals still land, and equal-version skew is last-writer-wins by design.
|
|
@@ -625,7 +625,7 @@ export const sourceRecordSyncTests = (
|
|
|
625
625
|
test('an older build of a package never prunes rows a newer build of the same package declared (the incident)', async () => {
|
|
626
626
|
const db = getDbAsSystem();
|
|
627
627
|
|
|
628
|
-
// The newer build (
|
|
628
|
+
// The newer build (3.32.0) declares an added type k-2.
|
|
629
629
|
await bootAsSource('@test/pkg-a', [decl('k-1', 'k1@test.local'), decl('k-2', 'k2@test.local')], '3.32.0');
|
|
630
630
|
// The older build (3.29.0) boots without k-2 — pre-fix this deleted k-2 every boot.
|
|
631
631
|
await bootAsSource('@test/pkg-a', [decl('k-1', 'k1@test.local')], '3.29.0');
|