nuxt-charts 2.1.0-beta.2 → 2.1.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/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3"
6
6
  },
7
- "version": "2.1.0-beta.2",
7
+ "version": "2.1.0",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "unknown"
package/dist/module.mjs CHANGED
@@ -1,47 +1,51 @@
1
1
  import { addComponent, addImportsSources, defineNuxtModule, createResolver } from '@nuxt/kit';
2
2
 
3
3
  const resolveComponents = (config, filePath) => {
4
- const { prefix } = config;
4
+ const { prefix, include, global } = config;
5
5
  const allComponents = [
6
6
  "AreaChart",
7
- "AreaStackedChart",
8
7
  "LineChart",
9
8
  "BarChart",
10
9
  "DonutChart",
11
10
  "BubbleChart",
12
11
  "GanttChart",
13
- "DualChart"
12
+ "DagreGraph",
13
+ "DualChart",
14
+ "SankeyChart",
15
+ "TopoJSONMap",
16
+ "DottedMap"
14
17
  ];
15
- allComponents.forEach((component) => {
16
- if (typeof component === "string") {
17
- addComponent({
18
- export: component,
19
- name: prefix + component,
20
- mode: "client",
21
- filePath
22
- });
23
- } else if (Array.isArray(component)) {
24
- addComponent({
25
- export: component[0],
26
- name: prefix + component[1],
27
- mode: "client",
28
- filePath
29
- });
30
- }
18
+ const components = include?.length ? allComponents.filter((component) => include.includes(component)) : allComponents;
19
+ components.forEach((component) => {
20
+ addComponent({
21
+ export: component,
22
+ name: prefix + component,
23
+ mode: "client",
24
+ global,
25
+ filePath
26
+ });
31
27
  });
32
28
  };
33
29
 
34
- const resolveImports = (_, filePath) => {
35
- const allTypes = ["BulletLegendItemInterface", "MarkerConfig", "CrosshairConfig", "AxisConfig"];
30
+ const resolveImports = (config, filePath) => {
31
+ if (!config.autoImports) {
32
+ return;
33
+ }
34
+ const allTypes = ["BulletLegendItemInterface", "MarkerConfig", "CrosshairConfig", "AxisConfig", "TooltipConfig", "MapRegion", "MapPin"];
36
35
  addImportsSources({
37
- from: filePath,
36
+ from: "vue-chrts/types",
38
37
  type: true,
39
38
  imports: [...allTypes]
40
39
  });
41
- const allImports = ["CurveType", "LegendPosition", "Orientation", "DonutType"];
40
+ const enumImports = ["CurveType", "LegendPosition", "Orientation"];
41
+ addImportsSources({
42
+ from: "vue-chrts/enums",
43
+ imports: [...enumImports]
44
+ });
45
+ const runtimeImports = ["DonutType", "getMap", "getPin"];
42
46
  addImportsSources({
43
- from: filePath,
44
- imports: [...allImports]
47
+ from: "vue-chrts",
48
+ imports: [...runtimeImports]
45
49
  });
46
50
  };
47
51
 
@@ -61,19 +65,25 @@ const module = defineNuxtModule({
61
65
  },
62
66
  moduleDependencies: {},
63
67
  async setup(options, nuxt) {
64
- nuxt.options.vite.optimizeDeps = nuxt.options.vite.optimizeDeps || {};
65
- nuxt.options.vite.optimizeDeps.include = nuxt.options.vite.optimizeDeps.include || [];
66
- nuxt.options.vite.optimizeDeps.include = [
68
+ const deps = [
67
69
  "vue-chrts",
68
- ...nuxt.options.vite.optimizeDeps.include
69
- ];
70
- nuxt.options.build.transpile = [
71
- "vue-chrts",
72
- ...nuxt.options.build.transpile
70
+ "@unovis/ts",
71
+ "@unovis/vue",
72
+ "d3-geo",
73
+ "proj4",
74
+ "@turf/boolean-point-in-polygon"
73
75
  ];
76
+ nuxt.options.vite.optimizeDeps = nuxt.options.vite.optimizeDeps || {};
77
+ nuxt.options.vite.optimizeDeps.include = nuxt.options.vite.optimizeDeps.include || [];
78
+ nuxt.options.vite.optimizeDeps.include.push(...deps);
79
+ nuxt.options.vite.ssr = nuxt.options.vite.ssr || {};
80
+ nuxt.options.vite.ssr.noExternal = nuxt.options.vite.ssr.noExternal || [];
81
+ if (Array.isArray(nuxt.options.vite.ssr.noExternal)) {
82
+ nuxt.options.vite.ssr.noExternal.push(...deps);
83
+ }
74
84
  const { resolve } = createResolver(import.meta.url);
75
85
  const runtimePath = resolve("./runtime/vue-chrts");
76
- resolveImports(options, runtimePath);
86
+ resolveImports(options);
77
87
  resolveComponents(options, runtimePath);
78
88
  }
79
89
  });
@@ -1 +1 @@
1
- export * from 'vue-chrts';
1
+ export { AreaChart, LineChart, BarChart, DonutChart, BubbleChart, GanttChart, DagreGraph, DualChart, SankeyChart, TopoJSONMap, DottedMap, } from "vue-chrts";
@@ -1 +1,13 @@
1
- export * from "vue-chrts";
1
+ export {
2
+ AreaChart,
3
+ LineChart,
4
+ BarChart,
5
+ DonutChart,
6
+ BubbleChart,
7
+ GanttChart,
8
+ DagreGraph,
9
+ DualChart,
10
+ SankeyChart,
11
+ TopoJSONMap,
12
+ DottedMap
13
+ } from "vue-chrts";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-charts",
3
- "version": "2.1.0-beta.2",
3
+ "version": "2.1.0",
4
4
  "description": "Nuxt module for vue-chrts",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -16,21 +16,19 @@
16
16
  "dist"
17
17
  ],
18
18
  "dependencies": {
19
- "@unovis/ts": "^1.6.2",
20
- "@unovis/vue": "^1.6.2",
21
- "vue-chrts": "2.1.0-beta.0.1"
19
+ "vue-chrts": "2.1.0"
22
20
  },
23
21
  "devDependencies": {
24
22
  "@nuxt/eslint": "^1.7.1",
25
23
  "@nuxt/eslint-config": "^1.7.1",
26
- "@nuxt/kit": "^4.2.0",
24
+ "@nuxt/kit": "^4.3.0",
27
25
  "@nuxt/module-builder": "^0.8.4",
28
- "@nuxt/schema": "^4.2.0",
26
+ "@nuxt/schema": "^4.3.0",
29
27
  "@types/node": "^20.19.9",
30
28
  "changelogen": "^0.6.2",
31
29
  "commit-and-tag-version": "^12.5.1",
32
30
  "eslint": "^9.0.0",
33
- "nuxt": "^4.2.0",
31
+ "nuxt": "^4.3.0",
34
32
  "typescript": "^5.8.3",
35
33
  "vitest": "^3.2.4"
36
34
  },