@eclipse-docks/create-app 0.7.90 → 0.7.92

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": "@eclipse-docks/create-app",
3
- "version": "0.7.90",
3
+ "version": "0.7.92",
4
4
  "description": "Scaffold a new Eclipse Docks app (monorepo with app + example extension)",
5
5
  "type": "module",
6
6
  "bin": "index.js",
@@ -19,7 +19,7 @@ Then open the URL shown in the terminal (e.g. https://localhost:5173/).
19
19
  ## Structure
20
20
 
21
21
  - **packages/app** – The Docks app (entry point, UI)
22
- - **packages/example-extension** – Example extension; use it as a reference to add your own
22
+ - **packages/extension-example** – Example extension package (`extension-example`); use it as a reference to add your own
23
23
 
24
24
  ## Extensions
25
25
 
@@ -24,7 +24,7 @@
24
24
  "@eclipse-docks/extension-python-runtime": "^0.x",
25
25
  "@eclipse-docks/extension-settings-tree": "^0.x",
26
26
  "@eclipse-docks/extension-utils": "^0.x",
27
- "example-extension": "*"
27
+ "extension-example": "*"
28
28
  },
29
29
  "devDependencies": {
30
30
  "typescript": "^6.0.0",
@@ -21,7 +21,7 @@ appLoaderService.registerApp(
21
21
  '@eclipse-docks/extension-settings-tree',
22
22
  '@eclipse-docks/extension-memory-usage',
23
23
  '@eclipse-docks/extension-ai-system',
24
- 'example-extension',
24
+ 'extension-example',
25
25
  ],
26
26
  },
27
27
  { autoStart: true, hostConfig: true, container: appRoot },
@@ -1,9 +1,9 @@
1
1
  import path, { dirname } from 'path';
2
2
  import { fileURLToPath } from 'url';
3
3
  import { defineConfig } from 'vite';
4
+ import { createDocksPwaPlugin } from '@eclipse-docks/extension-pwa/vite';
4
5
  import crossOriginIsolation from 'vite-plugin-cross-origin-isolation';
5
6
  import mkcert from 'vite-plugin-mkcert';
6
- import { VitePWA } from 'vite-plugin-pwa';
7
7
  import { appSplashPlugin } from '@eclipse-docks/core/vite-plugin-app-splash';
8
8
  import { resolveDepVersionsPlugin } from '@eclipse-docks/core/vite-plugin-resolve-deps';
9
9
  import { localAliasesPlugin } from '@eclipse-docks/core/vite-plugin-local-aliases';
@@ -30,44 +30,11 @@ export default defineConfig({
30
30
  }),
31
31
  mkcert(),
32
32
  crossOriginIsolation(),
33
- VitePWA({
34
- registerType: 'autoUpdate',
35
- injectRegister: 'inline',
36
- strategies: 'injectManifest',
37
- srcDir: 'src',
38
- filename: 'sw.ts',
39
- manifest: {
40
- name: '{{APP_NAME}}',
41
- short_name: '{{APP_NAME}}',
42
- description: '{{APP_DESCRIPTION}}',
43
- theme_color: '#1a1a1a',
44
- background_color: '#1a1a1a',
45
- display: 'standalone',
46
- start_url: basePath,
47
- scope: basePath,
48
- icons: [
49
- {
50
- src: 'logo.svg',
51
- sizes: 'any',
52
- type: 'image/svg+xml',
53
- purpose: 'any',
54
- },
55
- {
56
- src: 'favicon.svg',
57
- sizes: 'any',
58
- type: 'image/svg+xml',
59
- purpose: 'monochrome',
60
- },
61
- ],
62
- },
63
- includeAssets: ['favicon.svg', 'logo.svg', 'logo-loading.svg'],
64
- injectManifest: {
65
- maximumFileSizeToCacheInBytes: 12 * 1024 * 1024,
66
- globPatterns: ['**/*.{js,css,html,ico,png,svg,webp,woff2,woff,ttf,wasm}'],
67
- },
68
- devOptions: {
69
- enabled: false,
70
- },
33
+ createDocksPwaPlugin({
34
+ basePath,
35
+ appName: '{{APP_NAME}}',
36
+ appDescription: '{{APP_DESCRIPTION}}',
37
+ maximumFileSizeToCacheInBytes: 12 * 1024 * 1024,
71
38
  }),
72
39
  ],
73
40
  worker: {
@@ -1,4 +1,4 @@
1
- # example-extension
1
+ # extension-example
2
2
 
3
3
  Example Eclipse Docks extension that adds a view to the **left side panel** – the same tab bar as **Workspace** (file browser). You get an "Example" tab next to the workspace; use it as a reference to build your own extensions.
4
4
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "example-extension",
2
+ "name": "extension-example",
3
3
  "version": "0.0.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
@@ -11,7 +11,7 @@ contributionRegistry.registerContribution(SIDEBAR_MAIN, {
11
11
  component: (_id: string) => html`
12
12
  <div style="padding: var(--wa-space-l);">
13
13
  <h2>Example extension</h2>
14
- <p>This view is contributed by the <code>example-extension</code> package to the left side panel.</p>
14
+ <p>This view is contributed by the <code>extension-example</code> package to the left side panel.</p>
15
15
  </div>
16
16
  `,
17
17
  } as TabContribution);
@@ -1,7 +1,7 @@
1
1
  import { extensionRegistry } from '@eclipse-docks/core';
2
2
 
3
3
  extensionRegistry.registerExtension({
4
- id: 'example-extension',
4
+ id: 'extension-example',
5
5
  name: 'Example',
6
6
  description: 'Example extension showing how to add a view to the left side panel',
7
7
  loader: () => import('./example-extension-loader'),
@@ -1,50 +0,0 @@
1
- /// <reference lib="webworker" />
2
-
3
- import {
4
- addPlugins,
5
- cleanupOutdatedCaches,
6
- createHandlerBoundToURL,
7
- precacheAndRoute,
8
- } from 'workbox-precaching';
9
- import { NavigationRoute, registerRoute } from 'workbox-routing';
10
-
11
- declare const self: ServiceWorkerGlobalScope;
12
-
13
- function withCoopCoep(response: Response): Response {
14
- if (response.status === 0 || response.type === 'opaque' || response.type === 'opaqueredirect') {
15
- return response;
16
- }
17
- const headers = new Headers(response.headers);
18
- headers.set('Cross-Origin-Opener-Policy', 'same-origin');
19
- headers.set('Cross-Origin-Embedder-Policy', 'require-corp');
20
- return new Response(response.body, {
21
- status: response.status,
22
- statusText: response.statusText,
23
- headers,
24
- });
25
- }
26
-
27
- cleanupOutdatedCaches();
28
-
29
- addPlugins([
30
- {
31
- cachedResponseWillBeUsed: async ({ cachedResponse }) =>
32
- cachedResponse ? withCoopCoep(cachedResponse) : cachedResponse,
33
- fetchDidSucceed: async ({ response }) => withCoopCoep(response),
34
- },
35
- ]);
36
-
37
- precacheAndRoute(self.__WB_MANIFEST);
38
-
39
- const indexUrl = new URL('index.html', self.registration.scope).href;
40
- registerRoute(new NavigationRoute(createHandlerBoundToURL(indexUrl)));
41
-
42
- self.addEventListener('message', (event) => {
43
- if (event.data?.type === 'SKIP_WAITING') {
44
- void self.skipWaiting();
45
- }
46
- });
47
-
48
- self.addEventListener('activate', (event) => {
49
- event.waitUntil(self.clients.claim());
50
- });