@vocab/vite 0.1.1 → 0.2.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 (26) hide show
  1. package/chunks/dist/vocab-vite-chunks.cjs.d.ts +2 -0
  2. package/{create-vocab-chunks/dist/vocab-vite-create-vocab-chunks.cjs.dev.js → chunks/dist/vocab-vite-chunks.cjs.dev.js} +1 -0
  3. package/chunks/dist/vocab-vite-chunks.cjs.js +7 -0
  4. package/{create-vocab-chunks/dist/vocab-vite-create-vocab-chunks.cjs.prod.js → chunks/dist/vocab-vite-chunks.cjs.prod.js} +1 -0
  5. package/{create-vocab-chunks/dist/vocab-vite-create-vocab-chunks.esm.js → chunks/dist/vocab-vite-chunks.esm.js} +1 -1
  6. package/chunks/package.json +4 -0
  7. package/dist/declarations/src/chunks.d.ts +2 -0
  8. package/dist/declarations/src/create-language.d.ts +0 -1
  9. package/dist/declarations/src/get-chunk-name.d.ts +1 -0
  10. package/dist/declarations/src/runtime.d.ts +2 -0
  11. package/dist/vocab-vite.cjs.dev.js +3 -2
  12. package/dist/vocab-vite.cjs.prod.js +3 -2
  13. package/dist/vocab-vite.esm.js +3 -2
  14. package/package.json +13 -13
  15. package/runtime/dist/vocab-vite-runtime.cjs.d.ts +2 -0
  16. package/runtime/dist/vocab-vite-runtime.cjs.js +7 -0
  17. package/runtime/package.json +4 -0
  18. package/create-language/dist/vocab-vite-create-language.cjs.d.ts +0 -2
  19. package/create-language/dist/vocab-vite-create-language.cjs.js +0 -7
  20. package/create-language/package.json +0 -4
  21. package/create-vocab-chunks/dist/vocab-vite-create-vocab-chunks.cjs.d.ts +0 -2
  22. package/create-vocab-chunks/dist/vocab-vite-create-vocab-chunks.cjs.js +0 -7
  23. package/create-vocab-chunks/package.json +0 -4
  24. package/{create-language/dist/vocab-vite-create-language.cjs.dev.js → runtime/dist/vocab-vite-runtime.cjs.dev.js} +1 -1
  25. package/{create-language/dist/vocab-vite-create-language.cjs.prod.js → runtime/dist/vocab-vite-runtime.cjs.prod.js} +1 -1
  26. package/{create-language/dist/vocab-vite-create-language.esm.js → runtime/dist/vocab-vite-runtime.esm.js} +1 -1
@@ -0,0 +1,2 @@
1
+ export * from "../../dist/declarations/src/chunks.js";
2
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidm9jYWItdml0ZS1jaHVua3MuY2pzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9kaXN0L2RlY2xhcmF0aW9ucy9zcmMvY2h1bmtzLmQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEifQ==
@@ -52,3 +52,4 @@ const createVocabChunks = (id, {
52
52
  };
53
53
 
54
54
  exports.createVocabChunks = createVocabChunks;
55
+ exports.getChunkName = getChunkName;
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ if (process.env.NODE_ENV === "production") {
4
+ module.exports = require("./vocab-vite-chunks.cjs.prod.js");
5
+ } else {
6
+ module.exports = require("./vocab-vite-chunks.cjs.dev.js");
7
+ }
@@ -52,3 +52,4 @@ const createVocabChunks = (id, {
52
52
  };
53
53
 
54
54
  exports.createVocabChunks = createVocabChunks;
55
+ exports.getChunkName = getChunkName;
@@ -47,4 +47,4 @@ const createVocabChunks = (id, {
47
47
  }
48
48
  };
49
49
 
50
- export { createVocabChunks };
50
+ export { createVocabChunks, getChunkName };
@@ -0,0 +1,4 @@
1
+ {
2
+ "main": "dist/vocab-vite-chunks.cjs.js",
3
+ "module": "dist/vocab-vite-chunks.esm.js"
4
+ }
@@ -0,0 +1,2 @@
1
+ export { createVocabChunks } from "./create-vocab-chunks.js";
2
+ export { getChunkName } from "./get-chunk-name.js";
@@ -1,3 +1,2 @@
1
1
  import type { TranslationModule } from '@vocab/core';
2
- export { createTranslationFile } from '@vocab/core/translation-file';
3
2
  export declare const createLanguage: (loadImport: () => Promise<any>) => TranslationModule<any>;
@@ -0,0 +1 @@
1
+ export declare function getChunkName(lang: string): string;
@@ -0,0 +1,2 @@
1
+ export { createTranslationFile } from '@vocab/core/translation-file';
2
+ export { createLanguage } from "./create-language.js";
@@ -65,7 +65,7 @@ const transformVocabFile = async (code, id, config) => {
65
65
  const exportName = esmExports[0];
66
66
  trace(`Found ESM export '${exportName.n}' in ${id}`);
67
67
  result = /* ts */`
68
- import { createLanguage, createTranslationFile } from '@vocab/vite/create-language';
68
+ import { createLanguage, createTranslationFile } from '@vocab/vite/runtime';
69
69
  ${translations}
70
70
  export { translations as ${exportName.n} };
71
71
  `;
@@ -75,7 +75,7 @@ const transformVocabFile = async (code, id, config) => {
75
75
  const exportName = findExportNames(code, 'cjs')[0];
76
76
  trace(`Found CJS export '${exportName}' in ${id}`);
77
77
  result = /* ts */`
78
- import { createLanguage, createTranslationFile } from '@vocab/vite/create-language';
78
+ import { createLanguage, createTranslationFile } from '@vocab/vite/runtime';
79
79
  ${translations}
80
80
  exports.${exportName} = translations;
81
81
  `;
@@ -109,6 +109,7 @@ function vitePluginVocab({
109
109
  return {
110
110
  name: 'vite-plugin-vocab',
111
111
  apply: 'build',
112
+ enforce: 'pre',
112
113
  configResolved(config) {
113
114
  // Check if the build is for SSR. This plugin should not run for SSR builds.
114
115
  isSSR = Boolean(config.build.ssr);
@@ -65,7 +65,7 @@ const transformVocabFile = async (code, id, config) => {
65
65
  const exportName = esmExports[0];
66
66
  trace(`Found ESM export '${exportName.n}' in ${id}`);
67
67
  result = /* ts */`
68
- import { createLanguage, createTranslationFile } from '@vocab/vite/create-language';
68
+ import { createLanguage, createTranslationFile } from '@vocab/vite/runtime';
69
69
  ${translations}
70
70
  export { translations as ${exportName.n} };
71
71
  `;
@@ -75,7 +75,7 @@ const transformVocabFile = async (code, id, config) => {
75
75
  const exportName = findExportNames(code, 'cjs')[0];
76
76
  trace(`Found CJS export '${exportName}' in ${id}`);
77
77
  result = /* ts */`
78
- import { createLanguage, createTranslationFile } from '@vocab/vite/create-language';
78
+ import { createLanguage, createTranslationFile } from '@vocab/vite/runtime';
79
79
  ${translations}
80
80
  exports.${exportName} = translations;
81
81
  `;
@@ -109,6 +109,7 @@ function vitePluginVocab({
109
109
  return {
110
110
  name: 'vite-plugin-vocab',
111
111
  apply: 'build',
112
+ enforce: 'pre',
112
113
  configResolved(config) {
113
114
  // Check if the build is for SSR. This plugin should not run for SSR builds.
114
115
  isSSR = Boolean(config.build.ssr);
@@ -40,7 +40,7 @@ const transformVocabFile = async (code, id, config) => {
40
40
  const exportName = esmExports[0];
41
41
  trace(`Found ESM export '${exportName.n}' in ${id}`);
42
42
  result = /* ts */`
43
- import { createLanguage, createTranslationFile } from '@vocab/vite/create-language';
43
+ import { createLanguage, createTranslationFile } from '@vocab/vite/runtime';
44
44
  ${translations}
45
45
  export { translations as ${exportName.n} };
46
46
  `;
@@ -50,7 +50,7 @@ const transformVocabFile = async (code, id, config) => {
50
50
  const exportName = findExportNames(code, 'cjs')[0];
51
51
  trace(`Found CJS export '${exportName}' in ${id}`);
52
52
  result = /* ts */`
53
- import { createLanguage, createTranslationFile } from '@vocab/vite/create-language';
53
+ import { createLanguage, createTranslationFile } from '@vocab/vite/runtime';
54
54
  ${translations}
55
55
  exports.${exportName} = translations;
56
56
  `;
@@ -84,6 +84,7 @@ function vitePluginVocab({
84
84
  return {
85
85
  name: 'vite-plugin-vocab',
86
86
  apply: 'build',
87
+ enforce: 'pre',
87
88
  configResolved(config) {
88
89
  // Check if the build is for SSR. This plugin should not run for SSR builds.
89
90
  isSSR = Boolean(config.build.ssr);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vocab/vite",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "author": "SEEK",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -16,26 +16,26 @@
16
16
  "module": "./dist/vocab-vite.esm.js",
17
17
  "default": "./dist/vocab-vite.cjs.js"
18
18
  },
19
- "./create-language": {
20
- "module": "./create-language/dist/vocab-vite-create-language.esm.js",
21
- "default": "./create-language/dist/vocab-vite-create-language.cjs.js"
19
+ "./runtime": {
20
+ "module": "./runtime/dist/vocab-vite-runtime.esm.js",
21
+ "default": "./runtime/dist/vocab-vite-runtime.cjs.js"
22
22
  },
23
- "./create-vocab-chunks": {
24
- "module": "./create-vocab-chunks/dist/vocab-vite-create-vocab-chunks.esm.js",
25
- "default": "./create-vocab-chunks/dist/vocab-vite-create-vocab-chunks.cjs.js"
23
+ "./chunks": {
24
+ "module": "./chunks/dist/vocab-vite-chunks.esm.js",
25
+ "default": "./chunks/dist/vocab-vite-chunks.cjs.js"
26
26
  }
27
27
  },
28
28
  "preconstruct": {
29
29
  "entrypoints": [
30
30
  "index.ts",
31
- "create-language.ts",
32
- "create-vocab-chunks.ts"
31
+ "runtime.ts",
32
+ "chunks.ts"
33
33
  ]
34
34
  },
35
35
  "files": [
36
36
  "dist",
37
- "create-language",
38
- "create-vocab-chunks"
37
+ "runtime",
38
+ "chunks"
39
39
  ],
40
40
  "dependencies": {
41
41
  "cjs-module-lexer": "^1.2.2",
@@ -46,9 +46,9 @@
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/debug": "^4.1.5",
49
- "vite": "^5.4.8"
49
+ "vite": "^6.3.5"
50
50
  },
51
51
  "peerDependencies": {
52
- "vite": "^5.4.8"
52
+ "vite": "^5.4.8 || ^6.0.0"
53
53
  }
54
54
  }
@@ -0,0 +1,2 @@
1
+ export * from "../../dist/declarations/src/runtime.js";
2
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidm9jYWItdml0ZS1ydW50aW1lLmNqcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vZGlzdC9kZWNsYXJhdGlvbnMvc3JjL3J1bnRpbWUuZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ if (process.env.NODE_ENV === "production") {
4
+ module.exports = require("./vocab-vite-runtime.cjs.prod.js");
5
+ } else {
6
+ module.exports = require("./vocab-vite-runtime.cjs.dev.js");
7
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "main": "dist/vocab-vite-runtime.cjs.js",
3
+ "module": "dist/vocab-vite-runtime.esm.js"
4
+ }
@@ -1,2 +0,0 @@
1
- export * from "../../dist/declarations/src/create-language.js";
2
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidm9jYWItdml0ZS1jcmVhdGUtbGFuZ3VhZ2UuY2pzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9kaXN0L2RlY2xhcmF0aW9ucy9zcmMvY3JlYXRlLWxhbmd1YWdlLmQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEifQ==
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- if (process.env.NODE_ENV === "production") {
4
- module.exports = require("./vocab-vite-create-language.cjs.prod.js");
5
- } else {
6
- module.exports = require("./vocab-vite-create-language.cjs.dev.js");
7
- }
@@ -1,4 +0,0 @@
1
- {
2
- "main": "dist/vocab-vite-create-language.cjs.js",
3
- "module": "dist/vocab-vite-create-language.esm.js"
4
- }
@@ -1,2 +0,0 @@
1
- export * from "../../dist/declarations/src/create-vocab-chunks.js";
2
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidm9jYWItdml0ZS1jcmVhdGUtdm9jYWItY2h1bmtzLmNqcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vZGlzdC9kZWNsYXJhdGlvbnMvc3JjL2NyZWF0ZS12b2NhYi1jaHVua3MuZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- if (process.env.NODE_ENV === "production") {
4
- module.exports = require("./vocab-vite-create-vocab-chunks.cjs.prod.js");
5
- } else {
6
- module.exports = require("./vocab-vite-create-vocab-chunks.cjs.dev.js");
7
- }
@@ -1,4 +0,0 @@
1
- {
2
- "main": "dist/vocab-vite-create-vocab-chunks.cjs.js",
3
- "module": "dist/vocab-vite-create-vocab-chunks.esm.js"
4
- }
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var icuHandler = require('@vocab/core/icu-handler');
6
5
  var translationFile = require('@vocab/core/translation-file');
6
+ var icuHandler = require('@vocab/core/icu-handler');
7
7
 
8
8
  const createLanguage = loadImport => {
9
9
  let promiseValue;
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var icuHandler = require('@vocab/core/icu-handler');
6
5
  var translationFile = require('@vocab/core/translation-file');
6
+ var icuHandler = require('@vocab/core/icu-handler');
7
7
 
8
8
  const createLanguage = loadImport => {
9
9
  let promiseValue;
@@ -1,5 +1,5 @@
1
- import { getParsedICUMessages } from '@vocab/core/icu-handler';
2
1
  export { createTranslationFile } from '@vocab/core/translation-file';
2
+ import { getParsedICUMessages } from '@vocab/core/icu-handler';
3
3
 
4
4
  const createLanguage = loadImport => {
5
5
  let promiseValue;