@inlang/paraglide-js 2.3.2 → 2.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/dist/cli/steps/update-ts-config.d.ts +13 -0
- package/dist/cli/steps/update-ts-config.d.ts.map +1 -1
- package/dist/cli/steps/update-ts-config.js +131 -16
- package/dist/cli/steps/update-ts-config.test.d.ts +2 -0
- package/dist/cli/steps/update-ts-config.test.d.ts.map +1 -0
- package/dist/cli/steps/update-ts-config.test.js +59 -0
- package/dist/compiler/compile-project.js +1 -1
- package/dist/compiler/compile-project.test.js +13 -13
- package/dist/compiler/compile.test.js +20 -7
- package/dist/compiler/output-file.d.ts +6 -0
- package/dist/compiler/output-file.d.ts.map +1 -0
- package/dist/compiler/output-file.js +1 -0
- package/dist/compiler/output-structure/message-modules.d.ts.map +1 -1
- package/dist/compiler/output-structure/message-modules.js +26 -4
- package/dist/compiler/output-structure/message-modules.test.js +42 -0
- package/dist/compiler/runtime/assert-is-locale.d.ts.map +1 -1
- package/dist/compiler/runtime/assert-is-locale.js +7 -3
- package/dist/compiler/runtime/assert-is-locale.test.js +33 -2
- package/dist/compiler/runtime/create-runtime.d.ts.map +1 -1
- package/dist/compiler/runtime/create-runtime.js +2 -0
- package/dist/compiler/runtime/is-locale.d.ts.map +1 -1
- package/dist/compiler/runtime/is-locale.js +5 -1
- package/dist/compiler/runtime/is-locale.test.d.ts +2 -0
- package/dist/compiler/runtime/is-locale.test.d.ts.map +1 -0
- package/dist/compiler/runtime/is-locale.test.js +31 -0
- package/dist/compiler/runtime/set-locale.d.ts +8 -4
- package/dist/compiler/runtime/set-locale.d.ts.map +1 -1
- package/dist/compiler/runtime/set-locale.js +19 -18
- package/dist/compiler/runtime/set-locale.test.js +25 -0
- package/dist/compiler/runtime/should-redirect.d.ts +80 -0
- package/dist/compiler/runtime/should-redirect.d.ts.map +1 -0
- package/dist/compiler/runtime/should-redirect.js +119 -0
- package/dist/compiler/runtime/should-redirect.test.d.ts +2 -0
- package/dist/compiler/runtime/should-redirect.test.d.ts.map +1 -0
- package/dist/compiler/runtime/should-redirect.test.js +119 -0
- package/dist/compiler/runtime/type.d.ts +1 -0
- package/dist/compiler/runtime/type.d.ts.map +1 -1
- package/dist/compiler/server/middleware.d.ts.map +1 -1
- package/dist/compiler/server/middleware.js +18 -31
- package/dist/services/env-variables/index.js +1 -1
- package/dist/services/file-handling/write-output.test.js +7 -10
- package/package.json +9 -11
|
@@ -45,8 +45,7 @@ test("should create any missing directories", async () => {
|
|
|
45
45
|
test("should only write once if the output hasn't changed", async () => {
|
|
46
46
|
const { writeOutput } = await import("./write-output.js");
|
|
47
47
|
const fs = mockFs({});
|
|
48
|
-
|
|
49
|
-
fs.writeFile = vi.spyOn(fs, "writeFile");
|
|
48
|
+
const writeFileSpy = vi.spyOn(fs, "writeFile");
|
|
50
49
|
const hashes = await writeOutput({
|
|
51
50
|
directory: "/output",
|
|
52
51
|
output: { "test.txt": "test" },
|
|
@@ -60,13 +59,12 @@ test("should only write once if the output hasn't changed", async () => {
|
|
|
60
59
|
});
|
|
61
60
|
expect(hashes).toEqual(hashes2);
|
|
62
61
|
expect(await fs.readFile("/output/test.txt", { encoding: "utf-8" })).toBe("test");
|
|
63
|
-
expect(
|
|
62
|
+
expect(writeFileSpy).toHaveBeenCalledTimes(1);
|
|
64
63
|
});
|
|
65
64
|
test("should write again if the output has changed", async () => {
|
|
66
65
|
const { writeOutput } = await import("./write-output.js");
|
|
67
66
|
const fs = mockFs({});
|
|
68
|
-
|
|
69
|
-
fs.writeFile = vi.spyOn(fs, "writeFile");
|
|
67
|
+
const writeFileSpy = vi.spyOn(fs, "writeFile");
|
|
70
68
|
const hashes = await writeOutput({
|
|
71
69
|
directory: "/output",
|
|
72
70
|
output: { "test.txt": "test" },
|
|
@@ -79,13 +77,12 @@ test("should write again if the output has changed", async () => {
|
|
|
79
77
|
previousOutputHashes: hashes,
|
|
80
78
|
});
|
|
81
79
|
expect(await fs.readFile("/output/test.txt", { encoding: "utf-8" })).toBe("test2");
|
|
82
|
-
expect(
|
|
80
|
+
expect(writeFileSpy).toHaveBeenCalledTimes(2);
|
|
83
81
|
});
|
|
84
82
|
test("should write files if output has partially changed", async () => {
|
|
85
83
|
const { writeOutput } = await import("./write-output.js");
|
|
86
84
|
const fs = mockFs({});
|
|
87
|
-
|
|
88
|
-
fs.writeFile = vi.spyOn(fs, "writeFile");
|
|
85
|
+
const writeFileSpy = vi.spyOn(fs, "writeFile");
|
|
89
86
|
const hashes = await writeOutput({
|
|
90
87
|
directory: "/output",
|
|
91
88
|
output: { "file1.txt": "test", "file2.txt": "test" },
|
|
@@ -97,8 +94,8 @@ test("should write files if output has partially changed", async () => {
|
|
|
97
94
|
fs,
|
|
98
95
|
previousOutputHashes: hashes,
|
|
99
96
|
});
|
|
100
|
-
expect(
|
|
101
|
-
expect(
|
|
97
|
+
expect(writeFileSpy).toHaveBeenCalledWith("/output/file2.txt", "test2");
|
|
98
|
+
expect(writeFileSpy).toHaveBeenCalledTimes(3);
|
|
102
99
|
});
|
|
103
100
|
test("should delete files that have been removed from the output", async () => {
|
|
104
101
|
const { writeOutput } = await import("./write-output.js");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inlang/paraglide-js",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.5.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public",
|
|
@@ -26,32 +26,30 @@
|
|
|
26
26
|
"./urlpattern-polyfill": "./dist/urlpattern-polyfill/index.js"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@inlang/sdk": "2.4.9",
|
|
30
29
|
"commander": "11.1.0",
|
|
31
30
|
"consola": "3.4.0",
|
|
32
31
|
"json5": "2.2.3",
|
|
33
32
|
"unplugin": "^2.1.2",
|
|
34
33
|
"urlpattern-polyfill": "^10.0.0",
|
|
35
|
-
"@inlang/recommend-sherlock": "0.2.1"
|
|
34
|
+
"@inlang/recommend-sherlock": "0.2.1",
|
|
35
|
+
"@inlang/sdk": "2.4.9"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@eslint/js": "^9.18.0",
|
|
39
38
|
"@rollup/plugin-virtual": "3.0.2",
|
|
40
39
|
"@ts-morph/bootstrap": "0.26.0",
|
|
41
40
|
"@types/node": "^22.10.6",
|
|
42
|
-
"@vitest/coverage-v8": "
|
|
43
|
-
"eslint": "^9.18.0",
|
|
41
|
+
"@vitest/coverage-v8": "3.1.4",
|
|
44
42
|
"memfs": "4.17.0",
|
|
43
|
+
"oxlint": "^1.14.0",
|
|
45
44
|
"prettier": "^3.4.2",
|
|
46
45
|
"rolldown": "1.0.0-beta.1",
|
|
47
46
|
"typedoc": "0.28.12",
|
|
48
47
|
"typedoc-plugin-markdown": "4.7.0",
|
|
49
48
|
"typedoc-plugin-missing-exports": "4.0.0",
|
|
50
49
|
"typescript": "5.8.3",
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"@inlang/plugin-message-format": "4.0.0"
|
|
54
|
-
"@opral/tsconfig": "1.1.0"
|
|
50
|
+
"vitest": "3.1.4",
|
|
51
|
+
"@opral/tsconfig": "1.1.0",
|
|
52
|
+
"@inlang/plugin-message-format": "4.0.0"
|
|
55
53
|
},
|
|
56
54
|
"keywords": [
|
|
57
55
|
"inlang",
|
|
@@ -85,7 +83,7 @@
|
|
|
85
83
|
"test": "npm run env-variables && tsc --noEmit && vitest run --coverage ./src/**/*",
|
|
86
84
|
"test:watch": "npm run env-variables && vitest --watch ./src/**/*",
|
|
87
85
|
"env-variables": "node ./src/services/env-variables/create-index-file.js",
|
|
88
|
-
"lint": "
|
|
86
|
+
"lint": "oxlint --config .oxlintrc.json --fix",
|
|
89
87
|
"format": "prettier ./src --write",
|
|
90
88
|
"clean": "rm -rf ./dist ./node_modules"
|
|
91
89
|
}
|