@vcmap/plugin-cli 2.1.2 → 2.1.4
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 +3 -3
- package/assets/.gitlab-ci.yml +2 -2
- package/assets/build/staging/Dockerfile +2 -0
- package/package.json +2 -2
- package/src/build.js +3 -3
- package/src/create.js +7 -2
- package/src/preview.js +3 -1
- package/src/serve.js +11 -1
package/README.md
CHANGED
|
@@ -177,7 +177,7 @@ caching more readily.
|
|
|
177
177
|
The following libraries are provided by the @vcmap/ui in a deployed application. You should define these
|
|
178
178
|
as peer dependencies if you use them in your plugin:
|
|
179
179
|
- @vcmap/core
|
|
180
|
-
- @vcmap/
|
|
180
|
+
- @vcmap-cesium/engine
|
|
181
181
|
- ol
|
|
182
182
|
- vue
|
|
183
183
|
- vuetify
|
|
@@ -197,12 +197,12 @@ a plugin and _that the provided index files_ are used (over directly importing f
|
|
|
197
197
|
|
|
198
198
|
For instance:
|
|
199
199
|
```js
|
|
200
|
-
import Cartesian3 from '@vcmap
|
|
200
|
+
import Cartesian3 from '@vcmap-cesium/engine/Source/Core/Cartesian3.js';
|
|
201
201
|
```
|
|
202
202
|
|
|
203
203
|
should be rewritten to:
|
|
204
204
|
```js
|
|
205
|
-
import { Cartesian3 } from '@vcmap/
|
|
205
|
+
import { Cartesian3 } from '@vcmap-cesium/engine';
|
|
206
206
|
```
|
|
207
207
|
|
|
208
208
|
### What about openlayers?
|
package/assets/.gitlab-ci.yml
CHANGED
|
@@ -147,8 +147,8 @@ version:
|
|
|
147
147
|
- npm version patch -m "%s [skip-ci]"
|
|
148
148
|
- TAG=`git describe --abbrev=0`
|
|
149
149
|
- echo git push git@gitlab:vcsuite/"$CI_PROJECT_PATH".git
|
|
150
|
-
- git push git@gitlab:
|
|
151
|
-
- git push git@gitlab:
|
|
150
|
+
- git push git@gitlab:"$CI_PROJECT_PATH".git $TAG
|
|
151
|
+
- git push git@gitlab:"$CI_PROJECT_PATH".git HEAD:$CI_COMMIT_REF_NAME
|
|
152
152
|
before_script:
|
|
153
153
|
- mkdir -p ~/.ssh
|
|
154
154
|
- chmod 700 ~/.ssh
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vcmap/plugin-cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.4",
|
|
4
4
|
"description": "A CLI to help develop and build plugins for the VC Map",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"vue-template-compiler": "~2.7.14"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@vcmap/ui": "^5.0.0-rc.
|
|
43
|
+
"@vcmap/ui": "^5.0.0-rc.22",
|
|
44
44
|
"vue": "~2.7.14"
|
|
45
45
|
},
|
|
46
46
|
"peerDependenciesMeta": {
|
package/src/build.js
CHANGED
|
@@ -32,12 +32,12 @@ export function getDefaultConfig() {
|
|
|
32
32
|
*/
|
|
33
33
|
export async function getLibraryPaths(pluginName) {
|
|
34
34
|
const { libraries } = await import('@vcmap/ui/build/buildHelpers.js');
|
|
35
|
-
const pluginPath = path.join('plugins', ...pluginName.split('/'));
|
|
35
|
+
const pluginPath = path.posix.join('plugins', ...pluginName.split('/'));
|
|
36
36
|
const libraryPaths = {};
|
|
37
37
|
Object.entries(libraries).forEach(([library, assetName]) => {
|
|
38
|
-
const assetPath = path.join('assets', `${assetName}.js`);
|
|
38
|
+
const assetPath = path.posix.join('assets', `${assetName}.js`);
|
|
39
39
|
|
|
40
|
-
libraryPaths[library] = path.relative(pluginPath, assetPath);
|
|
40
|
+
libraryPaths[library] = path.posix.relative(pluginPath, assetPath);
|
|
41
41
|
});
|
|
42
42
|
return libraryPaths;
|
|
43
43
|
}
|
package/src/create.js
CHANGED
|
@@ -211,7 +211,7 @@ async function createPluginTemplate(options, pluginPath) {
|
|
|
211
211
|
devDeps.push('@vcsuite/eslint-config');
|
|
212
212
|
}
|
|
213
213
|
if (installVitest) {
|
|
214
|
-
devDeps.push('
|
|
214
|
+
devDeps.push('vitest', '@vitest/coverage-c8', 'jest-canvas-mock', 'jsdom');
|
|
215
215
|
}
|
|
216
216
|
await installDeps(devDeps, DepType.DEV, pluginPath);
|
|
217
217
|
logger.success('Installed dependencies');
|
|
@@ -279,6 +279,11 @@ async function createPlugin(options) {
|
|
|
279
279
|
path.join(getDirname(), '..', 'assets', '.gitlab-ci.yml'),
|
|
280
280
|
path.join(pluginPath, '.gitlab-ci.yml'),
|
|
281
281
|
);
|
|
282
|
+
await fs.promises.cp(
|
|
283
|
+
path.join(getDirname(), '..', 'assets', 'build'),
|
|
284
|
+
path.join(pluginPath, 'build'),
|
|
285
|
+
{ recursive: true },
|
|
286
|
+
);
|
|
282
287
|
}
|
|
283
288
|
|
|
284
289
|
if (options.template) {
|
|
@@ -311,7 +316,7 @@ export default async function create() {
|
|
|
311
316
|
|
|
312
317
|
const peerDependencyChoices = [
|
|
313
318
|
{ title: '@vcmap/core', value: '@vcmap/core' },
|
|
314
|
-
{ title: '@vcmap/
|
|
319
|
+
{ title: '@vcmap-cesium/engine', value: '@vcmap-cesium/engine' },
|
|
315
320
|
{ title: 'ol', value: 'ol' },
|
|
316
321
|
{ title: 'vue', value: 'vue' },
|
|
317
322
|
{ title: 'vuetify', value: 'vuetify' },
|
package/src/preview.js
CHANGED
|
@@ -42,7 +42,9 @@ async function getServerOptions(hostedVcm, https) {
|
|
|
42
42
|
let proxy;
|
|
43
43
|
const normalLibraries = await getLibraryPaths('normal');
|
|
44
44
|
const scopedLibraries = await getLibraryPaths('@scoped/plugin');
|
|
45
|
-
const alias = {
|
|
45
|
+
const alias = {
|
|
46
|
+
'@cesium/engine': '@vcmap-cesium/engine',
|
|
47
|
+
};
|
|
46
48
|
setAliases(alias, normalLibraries);
|
|
47
49
|
setAliases(alias, scopedLibraries);
|
|
48
50
|
|
package/src/serve.js
CHANGED
|
@@ -57,6 +57,11 @@ async function getProxy(protocol, port) {
|
|
|
57
57
|
changeOrigin: true,
|
|
58
58
|
secure: false,
|
|
59
59
|
};
|
|
60
|
+
// Cesium engine assets are not part of Build
|
|
61
|
+
proxy['/node_modules/@vcmap-cesium/engine/Build/Assets'] = {
|
|
62
|
+
target,
|
|
63
|
+
rewrite: p => p.replace(/Build/, 'Source'),
|
|
64
|
+
};
|
|
60
65
|
return proxy;
|
|
61
66
|
}
|
|
62
67
|
|
|
@@ -86,6 +91,11 @@ export default async function serve(options) {
|
|
|
86
91
|
const server = await createServer({
|
|
87
92
|
root: getContext(),
|
|
88
93
|
publicDir: false,
|
|
94
|
+
resolve: {
|
|
95
|
+
alias: {
|
|
96
|
+
'@cesium/engine': '@vcmap-cesium/engine',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
89
99
|
optimizeDeps: {
|
|
90
100
|
exclude: [
|
|
91
101
|
'@vcmap/ui',
|
|
@@ -97,7 +107,7 @@ export default async function serve(options) {
|
|
|
97
107
|
'fast-deep-equal',
|
|
98
108
|
'rbush-knn',
|
|
99
109
|
'pbf',
|
|
100
|
-
'@vcmap/
|
|
110
|
+
'@vcmap-cesium/engine',
|
|
101
111
|
],
|
|
102
112
|
},
|
|
103
113
|
plugins: [
|