@vcmap/plugin-cli 2.0.4 → 2.0.7

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/README.md CHANGED
@@ -113,7 +113,6 @@ as peer dependencies if you use them in your plugin:
113
113
  - @vcmap/core
114
114
  - @vcmap/cesium
115
115
  - ol
116
- - @vcsuite/ui-components
117
116
  - vue
118
117
  - @vue/composition-api
119
118
  - vuetify
@@ -3,14 +3,14 @@
3
3
  <v-card class="pa-2 ma-2">
4
4
  <v-container>
5
5
  <v-row class="justify-center mb-4">
6
- <h1>Hello World</h1>
6
+ <h1>{{ $t('helloWorld.helloWorld')}}</h1>
7
7
  </v-row>
8
8
  <v-row class="justify-center">
9
9
  <VcsButton
10
10
  icon="mdi-times"
11
11
  @click="closeSelf"
12
12
  >
13
- Close Window
13
+ {{ $t('helloWorld.close')}}
14
14
  </VcsButton>
15
15
  </v-row>
16
16
  </v-container>
@@ -20,7 +20,7 @@
20
20
 
21
21
  <script>
22
22
  import { inject } from '@vue/composition-api';
23
- import { VcsButton } from '@vcsuite/ui-components';
23
+ import { VcsButton } from '@vcmap/ui';
24
24
 
25
25
  export const windowId = 'hello_world_window_id';
26
26
 
@@ -3,19 +3,25 @@ import { version, name } from '../package.json';
3
3
  import HelloWorld, { windowId } from './helloWorld.vue';
4
4
 
5
5
  /**
6
- * @param {VcsApp} app - the app from which this plugin is loaded.
7
- * @param {Object} config - the configuration of this plugin instance, passed in from the app.
8
- * @returns {VcsPlugin}
6
+ * @param {T} config - the configuration of this plugin instance, passed in from the app.
7
+ * @returns {import("@vcmap/ui/src/vcsUiApp").VcsPlugin<T>}
8
+ * @template {Object} T
9
9
  */
10
- export default function helloWorld(app, config) {
10
+ export default function(config) {
11
11
  return {
12
12
  get name() { return name; },
13
13
  get version() { return version; },
14
+ /**
15
+ * @param {import("@vcmap/ui").VcsUiApp} vcsUiApp
16
+ * @returns {Promise<void>}
17
+ */
14
18
  initialize: async (vcsUiApp) => {
15
19
  console.log('Called before loading the rest of the current context. Passed in the containing Vcs UI App ');
16
- console.log(app, config);
17
- console.log(vcsUiApp);
18
20
  },
21
+ /**
22
+ * @param {import("@vcmap/ui").VcsUiApp} vcsUiApp
23
+ * @returns {Promise<void>}
24
+ */
19
25
  onVcsAppMounted: async (vcsUiApp) => {
20
26
  console.log('Called when the root UI component is mounted and managers are ready to accept components');
21
27
  vcsUiApp.windowManager.add({
@@ -28,8 +34,28 @@ export default function helloWorld(app, config) {
28
34
  },
29
35
  }, name);
30
36
  },
37
+ /**
38
+ * @returns {Promise<T>}
39
+ */
31
40
  toJSON: async () => {
32
41
  console.log('Called when serializing this plugin instance');
33
42
  },
43
+ i18n: {
44
+ en: {
45
+ helloWorld: {
46
+ helloWorld: 'Hello World',
47
+ close: 'Close',
48
+ },
49
+ },
50
+ de: {
51
+ helloWorld: {
52
+ helloWorld: 'Hallo Welt',
53
+ close: 'Schließen',
54
+ },
55
+ },
56
+ },
57
+ destroy() {
58
+ console.log('hook to cleanup');
59
+ },
34
60
  };
35
- }
61
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vcmap/plugin-cli",
3
- "version": "2.0.4",
3
+ "version": "2.0.7",
4
4
  "description": "A CLI to help develop and build plugins for the VC Map",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -34,15 +34,15 @@
34
34
  "prompts": "^2.4.1",
35
35
  "sass": "1.32.13",
36
36
  "semver": "^7.3.5",
37
- "unplugin-vue-components": "^0.17.21",
37
+ "unplugin-vue-components": "^0.19.6",
38
38
  "vinyl-fs": "^3.0.3",
39
- "vite": "^2.9.1",
40
- "vite-plugin-vue2": "^1.7.3",
41
- "vue-template-compiler": "^2.6.14"
39
+ "vite": "^2.9.12",
40
+ "vite-plugin-vue2": "^2.0.1",
41
+ "vue-template-compiler": "~2.6.14"
42
42
  },
43
43
  "peerDependencies": {
44
- "@vcmap/ui": "^5.0.0-rc.7",
45
- "vue": "^2.6.14"
44
+ "@vcmap/ui": "^5.0.0-rc.9",
45
+ "vue": "~2.6.14"
46
46
  },
47
47
  "peerDependenciesMeta": {
48
48
  "@vcmap/ui": {
package/src/build.js CHANGED
@@ -82,6 +82,9 @@ export default async function buildModule(options) {
82
82
  external,
83
83
  output: {
84
84
  paths: libraryPaths,
85
+ manualChunks() { // ensure only one chunk will be created
86
+ return 'index';
87
+ },
85
88
  },
86
89
  },
87
90
  watch: options.watch ? {
package/src/create.js CHANGED
@@ -174,7 +174,6 @@ export default async function create() {
174
174
  ];
175
175
 
176
176
  const peerDependencyChoices = [
177
- { title: '@vcsuite/ui-components', value: '@vcsuite/ui-components', selected: true },
178
177
  { title: '@vcmap/core', value: '@vcmap/core' },
179
178
  { title: '@vcmap/cesium', value: '@vcmap/cesium' },
180
179
  { title: 'ol', value: 'ol@~6.13.0' },
package/src/serve.js CHANGED
@@ -78,7 +78,6 @@ export default async function serve(options) {
78
78
  '@vcmap/ui',
79
79
  '@vcmap/core',
80
80
  'ol',
81
- '@vcsuite/ui-components',
82
81
  'proj4',
83
82
  ],
84
83
  include: [
@@ -104,6 +103,13 @@ export default async function serve(options) {
104
103
  https: options.https,
105
104
  proxy,
106
105
  },
106
+ css: {
107
+ preprocessorOptions: {
108
+ sass: {
109
+ additionalData: "\n@import './node_modules/@vcmap/ui/src/styles/variables.scss'\n",
110
+ },
111
+ },
112
+ },
107
113
  });
108
114
 
109
115
  addMapConfigRoute(app, options.mapConfig, options.auth, options.config);