@intlayer/engine 9.4.4 → 9.5.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.
Files changed (67) hide show
  1. package/README.md +0 -2
  2. package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs +1 -2
  3. package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs.map +1 -1
  4. package/dist/cjs/init/index.cjs +14 -11
  5. package/dist/cjs/init/index.cjs.map +1 -1
  6. package/dist/cjs/init/utils/devScript.cjs +56 -0
  7. package/dist/cjs/init/utils/devScript.cjs.map +1 -0
  8. package/dist/cjs/init/utils/index.cjs +3 -0
  9. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs +1 -1
  10. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs.map +1 -1
  11. package/dist/cjs/loadDictionaries/loadMarkdownContentDeclaration.cjs +6 -5
  12. package/dist/cjs/loadDictionaries/loadMarkdownContentDeclaration.cjs.map +1 -1
  13. package/dist/cjs/syncPluginKit/createSyncPlugin.cjs +51 -3
  14. package/dist/cjs/syncPluginKit/createSyncPlugin.cjs.map +1 -1
  15. package/dist/cjs/utils/contentWatcherLock.cjs +172 -0
  16. package/dist/cjs/utils/contentWatcherLock.cjs.map +1 -0
  17. package/dist/cjs/utils/index.cjs +13 -1
  18. package/dist/cjs/utils/parseContentDeclarationFileName.cjs +35 -0
  19. package/dist/cjs/utils/parseContentDeclarationFileName.cjs.map +1 -0
  20. package/dist/cjs/utils/withFileLock.cjs +133 -0
  21. package/dist/cjs/utils/withFileLock.cjs.map +1 -0
  22. package/dist/cjs/watcher.cjs +7 -3
  23. package/dist/cjs/watcher.cjs.map +1 -1
  24. package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs +1 -2
  25. package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs.map +1 -1
  26. package/dist/esm/init/index.mjs +14 -11
  27. package/dist/esm/init/index.mjs.map +1 -1
  28. package/dist/esm/init/utils/devScript.mjs +54 -0
  29. package/dist/esm/init/utils/devScript.mjs.map +1 -0
  30. package/dist/esm/init/utils/index.mjs +2 -1
  31. package/dist/esm/loadDictionaries/loadContentDeclaration.mjs +1 -1
  32. package/dist/esm/loadDictionaries/loadContentDeclaration.mjs.map +1 -1
  33. package/dist/esm/loadDictionaries/loadMarkdownContentDeclaration.mjs +6 -5
  34. package/dist/esm/loadDictionaries/loadMarkdownContentDeclaration.mjs.map +1 -1
  35. package/dist/esm/syncPluginKit/createSyncPlugin.mjs +51 -3
  36. package/dist/esm/syncPluginKit/createSyncPlugin.mjs.map +1 -1
  37. package/dist/esm/utils/contentWatcherLock.mjs +163 -0
  38. package/dist/esm/utils/contentWatcherLock.mjs.map +1 -0
  39. package/dist/esm/utils/index.mjs +4 -1
  40. package/dist/esm/utils/parseContentDeclarationFileName.mjs +34 -0
  41. package/dist/esm/utils/parseContentDeclarationFileName.mjs.map +1 -0
  42. package/dist/esm/utils/withFileLock.mjs +132 -0
  43. package/dist/esm/utils/withFileLock.mjs.map +1 -0
  44. package/dist/esm/watcher.mjs +8 -4
  45. package/dist/esm/watcher.mjs.map +1 -1
  46. package/dist/types/formatDictionary.d.ts +2 -3
  47. package/dist/types/formatDictionary.d.ts.map +1 -1
  48. package/dist/types/init/index.d.ts.map +1 -1
  49. package/dist/types/init/utils/devScript.d.ts +48 -0
  50. package/dist/types/init/utils/devScript.d.ts.map +1 -0
  51. package/dist/types/init/utils/index.d.ts +2 -1
  52. package/dist/types/loadDictionaries/loadMarkdownContentDeclaration.d.ts +2 -1
  53. package/dist/types/loadDictionaries/loadMarkdownContentDeclaration.d.ts.map +1 -1
  54. package/dist/types/syncPluginKit/createSyncPlugin.d.ts.map +1 -1
  55. package/dist/types/syncPluginKit/index.d.ts +2 -2
  56. package/dist/types/syncPluginKit/types.d.ts +20 -6
  57. package/dist/types/syncPluginKit/types.d.ts.map +1 -1
  58. package/dist/types/utils/contentWatcherLock.d.ts +102 -0
  59. package/dist/types/utils/contentWatcherLock.d.ts.map +1 -0
  60. package/dist/types/utils/index.d.ts +4 -1
  61. package/dist/types/utils/parseContentDeclarationFileName.d.ts +23 -0
  62. package/dist/types/utils/parseContentDeclarationFileName.d.ts.map +1 -0
  63. package/dist/types/utils/withFileLock.d.ts +44 -0
  64. package/dist/types/utils/withFileLock.d.ts.map +1 -0
  65. package/dist/types/watcher.d.ts.map +1 -1
  66. package/package.json +10 -10
  67. package/dist/types/intlayer/dist/types/index.d.ts +0 -14
@@ -0,0 +1,44 @@
1
+ //#region src/utils/withFileLock.d.ts
2
+ type WithFileLockOptions = {
3
+ /**
4
+ * How long a lock may be held before it is considered abandoned and taken
5
+ * over, in milliseconds.
6
+ *
7
+ * @default 30000 = 30 seconds
8
+ */
9
+ staleTimeoutMs?: number;
10
+ /**
11
+ * How long to wait for the lock before running the callback anyway, in
12
+ * milliseconds. Giving up serialises nothing, but it is strictly better than
13
+ * deadlocking a build behind a lock that never clears.
14
+ *
15
+ * @default 60000 = 1 minute
16
+ */
17
+ acquireTimeoutMs?: number;
18
+ };
19
+ /**
20
+ * Runs `callback` under a cross-process mutex materialised by a lock file.
21
+ *
22
+ * Unlike `runOnce`, which lets one process do the work and the others skip it,
23
+ * every caller here runs the callback — just never at the same time. This is
24
+ * what shared, read-modify-write outputs need (e.g. building the `.intlayer`
25
+ * dictionaries, which merges every dictionary on disk): concurrent runs would
26
+ * each read a half-written state.
27
+ *
28
+ * The lock is released even when the callback throws, and its error is
29
+ * re-thrown to the caller unchanged.
30
+ *
31
+ * @param lockFilePath - Path of the lock file coordinating the callers.
32
+ * @param callback - The critical section.
33
+ * @param options - Staleness and acquisition timeouts.
34
+ *
35
+ * @example
36
+ * ```typescript
37
+ * await withFileLock(join(cacheDir, 'build-dictionary.lock'), () =>
38
+ * buildDictionary([dictionary], configuration)
39
+ * );
40
+ * ```
41
+ */
42
+ export declare const withFileLock: <T>(lockFilePath: string, callback: () => T | Promise<T>, options?: WithFileLockOptions) => Promise<T>;
43
+ //#endregion
44
+ //# sourceMappingURL=withFileLock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withFileLock.d.ts","names":[],"sources":["../../../src/utils/withFileLock.ts"],"mappings":";KAYK;;;;;;;EAOH;;;;;;;;EAQA;;;;;;;;;;;;;;;;;;;;;;;;;qBA0HW,eAAsB,GAAC,sBACd,gBACJ,IAAI,QAAQ,IAAE,UACpB,wBACT,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"watcher.d.ts","names":[],"sources":["../../src/watcher.ts"],"mappings":";;;KAuDK;EACH,gBAAgB;EAChB,gBAAgB;EAChB;EACA;;qBAsBW,QAAK,UAAoB,iBAAY;EAkDZ,mBAAM;;qBA+P/B,wBAAqB,UAAoB,iBAAY"}
1
+ {"version":3,"file":"watcher.d.ts","names":[],"sources":["../../src/watcher.ts"],"mappings":";;;KA2DK;EACH,gBAAgB;EAChB,gBAAgB;EAChB;EACA;;qBAsBW,QAAK,UAAoB,iBAAY;EAkDZ,mBAAM;;qBA2Q/B,wBAAqB,UAAoB,iBAAY"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/engine",
3
- "version": "9.4.4",
3
+ "version": "9.5.1",
4
4
  "private": false,
5
5
  "description": "Scans and builds Intlayer declaration files into dictionaries based on Intlayer configuration.",
6
6
  "keywords": [
@@ -141,13 +141,13 @@
141
141
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
142
142
  },
143
143
  "dependencies": {
144
- "@intlayer/api": "9.4.4",
145
- "@intlayer/config": "9.4.4",
146
- "@intlayer/core": "9.4.4",
147
- "@intlayer/dictionaries-entry": "9.4.4",
148
- "@intlayer/remote-dictionaries-entry": "9.4.4",
149
- "@intlayer/types": "9.4.4",
150
- "@intlayer/unmerged-dictionaries-entry": "9.4.4",
144
+ "@intlayer/api": "9.5.1",
145
+ "@intlayer/config": "9.5.1",
146
+ "@intlayer/core": "9.5.1",
147
+ "@intlayer/dictionaries-entry": "9.5.1",
148
+ "@intlayer/remote-dictionaries-entry": "9.5.1",
149
+ "@intlayer/types": "9.5.1",
150
+ "@intlayer/unmerged-dictionaries-entry": "9.5.1",
151
151
  "@parcel/watcher": "2.6.0",
152
152
  "defu": "6.1.7",
153
153
  "fast-glob": "3.3.3",
@@ -156,7 +156,7 @@
156
156
  "zod-to-ts": "2.1.0"
157
157
  },
158
158
  "devDependencies": {
159
- "@types/node": "26.4.1",
159
+ "@types/node": "26.5.0",
160
160
  "@utils/ts-config": "1.0.4",
161
161
  "@utils/ts-config-types": "1.0.4",
162
162
  "@utils/tsdown-config": "1.0.4",
@@ -167,7 +167,7 @@
167
167
  "zod": "4.5.4"
168
168
  },
169
169
  "peerDependencies": {
170
- "@intlayer/babel": "9.4.4"
170
+ "@intlayer/babel": "9.5.1"
171
171
  },
172
172
  "peerDependenciesMeta": {
173
173
  "@intlayer/babel": {
@@ -1,14 +0,0 @@
1
- import { IntlayerConfig } from "@intlayer/types/config";
2
- import { Dictionary } from "@intlayer/types/dictionary";
3
- import "@intlayer/types/allLocales";
4
- import { LocalesValues as LocalesValues$1 } from "@intlayer/types/module_augmentation";
5
- import "@intlayer/types/locales";
6
- import "@intlayer/config/built";
7
- import "@intlayer/core/file";
8
- import "@intlayer/core/formatters";
9
- import "@intlayer/core/interpreter";
10
- import "@intlayer/core/localization";
11
- import "@intlayer/core/markdown";
12
- import "@intlayer/core/transpiler";
13
- import "@intlayer/core/utils";
14
- export type { LocalesValues$1 as LocalesValues };