@intlayer/engine 9.4.4 → 9.5.0
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/README.md +0 -2
- package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs +1 -2
- package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs.map +1 -1
- package/dist/cjs/init/index.cjs +14 -11
- package/dist/cjs/init/index.cjs.map +1 -1
- package/dist/cjs/init/utils/devScript.cjs +57 -0
- package/dist/cjs/init/utils/devScript.cjs.map +1 -0
- package/dist/cjs/init/utils/index.cjs +3 -0
- package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs +1 -1
- package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadMarkdownContentDeclaration.cjs +6 -5
- package/dist/cjs/loadDictionaries/loadMarkdownContentDeclaration.cjs.map +1 -1
- package/dist/cjs/syncPluginKit/createSyncPlugin.cjs +51 -3
- package/dist/cjs/syncPluginKit/createSyncPlugin.cjs.map +1 -1
- package/dist/cjs/utils/contentWatcherLock.cjs +173 -0
- package/dist/cjs/utils/contentWatcherLock.cjs.map +1 -0
- package/dist/cjs/utils/index.cjs +13 -1
- package/dist/cjs/utils/parseContentDeclarationFileName.cjs +35 -0
- package/dist/cjs/utils/parseContentDeclarationFileName.cjs.map +1 -0
- package/dist/cjs/utils/withFileLock.cjs +133 -0
- package/dist/cjs/utils/withFileLock.cjs.map +1 -0
- package/dist/cjs/watcher.cjs +7 -3
- package/dist/cjs/watcher.cjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs +1 -2
- package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs.map +1 -1
- package/dist/esm/init/index.mjs +14 -11
- package/dist/esm/init/index.mjs.map +1 -1
- package/dist/esm/init/utils/devScript.mjs +55 -0
- package/dist/esm/init/utils/devScript.mjs.map +1 -0
- package/dist/esm/init/utils/index.mjs +2 -1
- package/dist/esm/loadDictionaries/loadContentDeclaration.mjs +1 -1
- package/dist/esm/loadDictionaries/loadContentDeclaration.mjs.map +1 -1
- package/dist/esm/loadDictionaries/loadMarkdownContentDeclaration.mjs +6 -5
- package/dist/esm/loadDictionaries/loadMarkdownContentDeclaration.mjs.map +1 -1
- package/dist/esm/syncPluginKit/createSyncPlugin.mjs +51 -3
- package/dist/esm/syncPluginKit/createSyncPlugin.mjs.map +1 -1
- package/dist/esm/utils/contentWatcherLock.mjs +164 -0
- package/dist/esm/utils/contentWatcherLock.mjs.map +1 -0
- package/dist/esm/utils/index.mjs +4 -1
- package/dist/esm/utils/parseContentDeclarationFileName.mjs +34 -0
- package/dist/esm/utils/parseContentDeclarationFileName.mjs.map +1 -0
- package/dist/esm/utils/withFileLock.mjs +132 -0
- package/dist/esm/utils/withFileLock.mjs.map +1 -0
- package/dist/esm/watcher.mjs +8 -4
- package/dist/esm/watcher.mjs.map +1 -1
- package/dist/types/formatDictionary.d.ts +2 -3
- package/dist/types/formatDictionary.d.ts.map +1 -1
- package/dist/types/init/index.d.ts.map +1 -1
- package/dist/types/init/utils/devScript.d.ts +49 -0
- package/dist/types/init/utils/devScript.d.ts.map +1 -0
- package/dist/types/init/utils/index.d.ts +2 -1
- package/dist/types/loadDictionaries/loadMarkdownContentDeclaration.d.ts +2 -1
- package/dist/types/loadDictionaries/loadMarkdownContentDeclaration.d.ts.map +1 -1
- package/dist/types/syncPluginKit/createSyncPlugin.d.ts.map +1 -1
- package/dist/types/syncPluginKit/index.d.ts +2 -2
- package/dist/types/syncPluginKit/types.d.ts +20 -6
- package/dist/types/syncPluginKit/types.d.ts.map +1 -1
- package/dist/types/utils/contentWatcherLock.d.ts +113 -0
- package/dist/types/utils/contentWatcherLock.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +4 -1
- package/dist/types/utils/parseContentDeclarationFileName.d.ts +23 -0
- package/dist/types/utils/parseContentDeclarationFileName.d.ts.map +1 -0
- package/dist/types/utils/withFileLock.d.ts +44 -0
- package/dist/types/utils/withFileLock.d.ts.map +1 -0
- package/dist/types/watcher.d.ts.map +1 -1
- package/package.json +10 -10
- package/dist/types/intlayer/dist/types/index.d.ts +0 -14
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IntlayerConfig } from "@intlayer/types/config";
|
|
2
|
+
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
3
|
+
//#region src/utils/parseContentDeclarationFileName.d.ts
|
|
4
|
+
export type ContentDeclarationFileName = {
|
|
5
|
+
/** Dictionary key derived from the file name, locale suffix excluded */
|
|
6
|
+
key: string;
|
|
7
|
+
/** Locale declared as a file name suffix, e.g. `about.fr.content.md` -> `fr` */
|
|
8
|
+
locale?: LocalesValues;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Splits a content declaration file name into its dictionary key and its
|
|
12
|
+
* optional locale suffix.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* parseContentDeclarationFileName('src/about.content.ts', configuration)
|
|
16
|
+
* // { key: 'about' }
|
|
17
|
+
*
|
|
18
|
+
* parseContentDeclarationFileName('src/about.fr.content.md', configuration)
|
|
19
|
+
* // { key: 'about', locale: 'fr' }
|
|
20
|
+
*/
|
|
21
|
+
export declare const parseContentDeclarationFileName: (filePath: string, configuration: IntlayerConfig) => ContentDeclarationFileName;
|
|
22
|
+
//#endregion
|
|
23
|
+
//# sourceMappingURL=parseContentDeclarationFileName.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseContentDeclarationFileName.d.ts","names":[],"sources":["../../../src/utils/parseContentDeclarationFileName.ts"],"mappings":";;;YAIY;;EAEV;;EAEA,SAAS;;;;;;;;;;;;;qBAiBE,kCAA+B,kBAC1B,eACD,mBACd"}
|
|
@@ -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":";;;
|
|
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.
|
|
3
|
+
"version": "9.5.0",
|
|
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.
|
|
145
|
-
"@intlayer/config": "9.
|
|
146
|
-
"@intlayer/core": "9.
|
|
147
|
-
"@intlayer/dictionaries-entry": "9.
|
|
148
|
-
"@intlayer/remote-dictionaries-entry": "9.
|
|
149
|
-
"@intlayer/types": "9.
|
|
150
|
-
"@intlayer/unmerged-dictionaries-entry": "9.
|
|
144
|
+
"@intlayer/api": "9.5.0",
|
|
145
|
+
"@intlayer/config": "9.5.0",
|
|
146
|
+
"@intlayer/core": "9.5.0",
|
|
147
|
+
"@intlayer/dictionaries-entry": "9.5.0",
|
|
148
|
+
"@intlayer/remote-dictionaries-entry": "9.5.0",
|
|
149
|
+
"@intlayer/types": "9.5.0",
|
|
150
|
+
"@intlayer/unmerged-dictionaries-entry": "9.5.0",
|
|
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.
|
|
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.
|
|
170
|
+
"@intlayer/babel": "9.5.0"
|
|
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 };
|