@lvce-editor/shared-process 0.44.7 → 0.45.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/shared-process",
3
- "version": "0.44.7",
3
+ "version": "0.45.0",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@lvce-editor/assert": "1.3.0",
21
- "@lvce-editor/extension-host-helper-process": "0.44.7",
21
+ "@lvce-editor/extension-host-helper-process": "0.45.0",
22
22
  "@lvce-editor/ipc": "13.7.0",
23
23
  "@lvce-editor/json-rpc": "5.4.0",
24
24
  "@lvce-editor/jsonc-parser": "1.5.0",
@@ -32,10 +32,10 @@
32
32
  "@lvce-editor/embeds-process": "1.6.0",
33
33
  "@lvce-editor/network-process": "2.2.0",
34
34
  "@lvce-editor/preload": "1.4.0",
35
- "@lvce-editor/preview-process": "7.21.0",
35
+ "@lvce-editor/preview-process": "7.22.0",
36
36
  "@lvce-editor/pty-host": "3.1.0",
37
37
  "@lvce-editor/search-process": "4.1.0",
38
- "@lvce-editor/typescript-compile-process": "2.2.0",
38
+ "@lvce-editor/typescript-compile-process": "2.3.0",
39
39
  "open": "^10.1.0",
40
40
  "tail": "^2.2.6",
41
41
  "tmp-promise": "^3.0.3",
@@ -2,6 +2,6 @@ import { join } from 'path';
2
2
  import { fileURLToPath } from 'url';
3
3
  export const getBuiltinExtensionsPath = () => {
4
4
  const staticServerPath = fileURLToPath(import.meta.resolve('@lvce-editor/static-server'));
5
- const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', '824bfc9', 'extensions');
5
+ const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', '4e323a6', 'extensions');
6
6
  return builtinExtensionsPath;
7
7
  };
@@ -4,6 +4,7 @@ import * as FileSystem from '../FileSystem/FileSystem.js';
4
4
  import * as GetContentSecurityPolicy from '../GetContentSecurityPolicy/GetContentSecurityPolicy.js';
5
5
  import * as JsonFile from '../JsonFile/JsonFile.js';
6
6
  import * as Path from '../Path/Path.js';
7
+ import { readdir, readFile, rm, writeFile } from 'node:fs/promises';
7
8
  const staticContentSecurityPolicy = GetContentSecurityPolicy.getContentSecurityPolicy([
8
9
  `default-src 'none'`,
9
10
  `font-src 'self'`,
@@ -266,6 +267,9 @@ const updateExtensionsJson = async ({ root, commitHash, pathPrefix, extraExtensi
266
267
  path: webExtensionPath,
267
268
  };
268
269
  }));
270
+ for (const extension of extraExtensions) {
271
+ extension.path = `${pathPrefix}/${commitHash}/extensions/${extension.id}`;
272
+ }
269
273
  const newExtensions = [...manifests, ...extraExtensions];
270
274
  await JsonFile.writeJson(Path.join(root, 'dist', commitHash, 'config', 'extensions.json'), newExtensions);
271
275
  };
@@ -359,9 +363,35 @@ const isTestFile = (file) => {
359
363
  const getTestFiles = (testFilesRaw) => {
360
364
  return testFilesRaw.map(getName).filter(isTestFile);
361
365
  };
366
+ const transpileFile = (typescript, content) => {
367
+ const result = typescript.transpileModule(content, {
368
+ compilerOptions: {
369
+ target: 'esnext',
370
+ },
371
+ });
372
+ return result.outputText;
373
+ };
374
+ const transpileFiles = async (folder) => {
375
+ const typescript = await import('typescript');
376
+ const dirents = await readdir(folder);
377
+ for (const dirent of dirents) {
378
+ if (dirent.endsWith('.ts')) {
379
+ const content = await readFile(join(folder, dirent), 'utf-8');
380
+ const js = transpileFile(typescript, content);
381
+ await writeFile(join(folder, dirent.slice(0, -2) + 'js'), js);
382
+ }
383
+ }
384
+ for (const dirent of dirents) {
385
+ if (dirent.endsWith('.ts')) {
386
+ await rm(join(folder, dirent));
387
+ }
388
+ }
389
+ };
362
390
  const addTestFiles = async ({ testPath, commitHash, root, pathPrefix }) => {
363
391
  const testRoot = isAbsolute(testPath) ? testPath : join(root, testPath);
364
392
  await FileSystem.copy(`${testRoot}/src`, `${root}/dist/${commitHash}/packages/extension-host-worker-tests/src`);
393
+ const distDirentsPath = `${root}/dist/${commitHash}/packages/extension-host-worker-tests/src`;
394
+ await transpileFiles(distDirentsPath);
365
395
  const testFilesRaw = await FileSystem.readDir(`${testRoot}/src`);
366
396
  const testFiles = getTestFiles(testFilesRaw);
367
397
  await FileSystem.mkdir(`${root}/dist/${commitHash}/tests`);
@@ -41,9 +41,9 @@ export const getAppImageName = () => {
41
41
  export const getSetupName = () => {
42
42
  return 'Lvce-Setup';
43
43
  };
44
- export const version = '0.44.7';
45
- export const commit = '824bfc9';
46
- export const date = '2025-01-12T17:44:09.000Z';
44
+ export const version = '0.45.0';
45
+ export const commit = '4e323a6';
46
+ export const date = '2025-01-18T10:06:29.000Z';
47
47
  export const getVersion = () => {
48
48
  return version;
49
49
  };