@eclipse-docks/create-app 0.7.89 → 0.7.91
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 +1 -1
- package/template/README.md +1 -1
- package/template/packages/app/package.json +1 -1
- package/template/packages/app/src/main.ts +1 -1
- package/template/packages/app/vite.config.ts +6 -39
- package/template/packages/{example-extension → extension-example}/README.md +1 -1
- package/template/packages/{example-extension → extension-example}/package.json +1 -1
- package/template/packages/{example-extension → extension-example}/src/example-extension-loader.ts +1 -1
- package/template/packages/{example-extension → extension-example}/src/index.ts +1 -1
- package/template/packages/app/src/sw.ts +0 -50
- /package/template/packages/{example-extension → extension-example}/tsconfig.json +0 -0
- /package/template/packages/{example-extension → extension-example}/vite.config.ts +0 -0
package/package.json
CHANGED
package/template/README.md
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
|
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
|
|
package/template/packages/{example-extension → extension-example}/src/example-extension-loader.ts
RENAMED
|
@@ -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
|
|
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
|
|
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
|
-
});
|
|
File without changes
|
|
File without changes
|