@astroscope/i18n 0.4.1 → 0.4.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.
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
|
|
9
9
|
// src/extraction/vite-plugin.ts
|
|
10
10
|
import fs2 from "fs";
|
|
11
|
-
import
|
|
11
|
+
import path2 from "path";
|
|
12
12
|
import MagicString from "magic-string";
|
|
13
13
|
|
|
14
14
|
// src/extraction/extract.ts
|
|
@@ -249,7 +249,7 @@ var KeyStore = class {
|
|
|
249
249
|
|
|
250
250
|
// src/extraction/scan.ts
|
|
251
251
|
import fs from "fs";
|
|
252
|
-
import
|
|
252
|
+
import path from "path";
|
|
253
253
|
var GLOB_PATTERN = `src/**/*.{${ALL_EXTENSIONS.map((e) => e.slice(1)).join(",")}}`;
|
|
254
254
|
async function compileAstro(code, filename) {
|
|
255
255
|
try {
|
|
@@ -263,11 +263,13 @@ async function compileAstro(code, filename) {
|
|
|
263
263
|
async function scan(options) {
|
|
264
264
|
const { projectRoot, logger, consistency } = options;
|
|
265
265
|
const store = new KeyStore(logger, consistency);
|
|
266
|
-
const files =
|
|
266
|
+
const files = [];
|
|
267
|
+
for await (const entry of fs.promises.glob(GLOB_PATTERN, {
|
|
267
268
|
cwd: projectRoot,
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
exclude: (name) => name === "node_modules"
|
|
270
|
+
})) {
|
|
271
|
+
files.push(path.resolve(projectRoot, entry));
|
|
272
|
+
}
|
|
271
273
|
const results = await Promise.all(
|
|
272
274
|
files.map(async (file) => {
|
|
273
275
|
let code = await fs.promises.readFile(file, "utf-8");
|
|
@@ -458,8 +460,8 @@ export function getManifest() { return _getManifest(); }
|
|
|
458
460
|
},
|
|
459
461
|
writeBundle(outputOptions) {
|
|
460
462
|
if (this.environment.name === "client" && outputOptions.dir) {
|
|
461
|
-
const chunksDir =
|
|
462
|
-
const manifestPath =
|
|
463
|
+
const chunksDir = path2.resolve(outputOptions.dir, "..", "server", "chunks");
|
|
464
|
+
const manifestPath = path2.join(chunksDir, MANIFEST_FILE_NAME);
|
|
463
465
|
if (fs2.existsSync(chunksDir)) {
|
|
464
466
|
fs2.writeFileSync(manifestPath, JSON.stringify(getManifest()));
|
|
465
467
|
} else {
|
package/dist/extraction/index.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astroscope/i18n",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "i18n for Astro + React islands — MessageFormat 2, automatic tree-shaking, parallel loading, any translation source",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -86,7 +86,6 @@
|
|
|
86
86
|
"@babel/core": "^7.29.0",
|
|
87
87
|
"@babel/preset-typescript": "^7.28.5",
|
|
88
88
|
"messageformat": "^4.0.0",
|
|
89
|
-
"glob": "^13.0.6",
|
|
90
89
|
"magic-string": "^0.30.21"
|
|
91
90
|
},
|
|
92
91
|
"devDependencies": {
|