@eclipse-docks/extension-pwa 0.7.92 → 0.7.93
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.
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PluginOption } from 'vite';
|
|
2
|
+
export type CreateDocksPwaPluginOptions = {
|
|
3
|
+
basePath: string;
|
|
4
|
+
appName: string;
|
|
5
|
+
appDescription: string;
|
|
6
|
+
maximumFileSizeToCacheInBytes: number;
|
|
7
|
+
shortName?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function createDocksPwaPlugin({ basePath, appName, appDescription, maximumFileSizeToCacheInBytes, shortName, }: CreateDocksPwaPluginOptions): PluginOption;
|
|
10
|
+
//# sourceMappingURL=vite-pwa-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-pwa-plugin.d.ts","sourceRoot":"","sources":["../src/vite-pwa-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAGzC,MAAM,MAAM,2BAA2B,GAAG;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,6BAA6B,EAAE,MAAM,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAQF,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,OAAO,EACP,cAAc,EACd,6BAA6B,EAC7B,SAAmB,GACpB,EAAE,2BAA2B,GAAG,YAAY,CAwC5C"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { fileURLToPath } from "url";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { VitePWA } from "vite-plugin-pwa";
|
|
4
|
+
//#region src/vite-pwa-plugin.ts
|
|
5
|
+
var DEFAULT_GLOB_PATTERNS = ["**/*.{js,css,html,ico,png,svg,webp,woff2,woff,ttf,wasm}"];
|
|
6
|
+
var DEFAULT_ASSETS = [
|
|
7
|
+
"favicon.svg",
|
|
8
|
+
"logo.svg",
|
|
9
|
+
"logo-loading.svg"
|
|
10
|
+
];
|
|
11
|
+
var pwaSwPath = fileURLToPath(import.meta.resolve("@eclipse-docks/extension-pwa/sw"));
|
|
12
|
+
var pwaSwDir = path.dirname(pwaSwPath);
|
|
13
|
+
var pwaSwFilename = path.basename(pwaSwPath);
|
|
14
|
+
function createDocksPwaPlugin({ basePath, appName, appDescription, maximumFileSizeToCacheInBytes, shortName = appName }) {
|
|
15
|
+
return VitePWA({
|
|
16
|
+
registerType: "autoUpdate",
|
|
17
|
+
injectRegister: "inline",
|
|
18
|
+
strategies: "injectManifest",
|
|
19
|
+
srcDir: pwaSwDir,
|
|
20
|
+
filename: pwaSwFilename,
|
|
21
|
+
manifest: {
|
|
22
|
+
name: appName,
|
|
23
|
+
short_name: shortName,
|
|
24
|
+
description: appDescription,
|
|
25
|
+
theme_color: "#1a1a1a",
|
|
26
|
+
background_color: "#1a1a1a",
|
|
27
|
+
display: "standalone",
|
|
28
|
+
start_url: basePath,
|
|
29
|
+
scope: basePath,
|
|
30
|
+
icons: [{
|
|
31
|
+
src: "logo.svg",
|
|
32
|
+
sizes: "any",
|
|
33
|
+
type: "image/svg+xml",
|
|
34
|
+
purpose: "any"
|
|
35
|
+
}, {
|
|
36
|
+
src: "favicon.svg",
|
|
37
|
+
sizes: "any",
|
|
38
|
+
type: "image/svg+xml",
|
|
39
|
+
purpose: "monochrome"
|
|
40
|
+
}]
|
|
41
|
+
},
|
|
42
|
+
includeAssets: DEFAULT_ASSETS,
|
|
43
|
+
injectManifest: {
|
|
44
|
+
maximumFileSizeToCacheInBytes,
|
|
45
|
+
globPatterns: DEFAULT_GLOB_PATTERNS
|
|
46
|
+
},
|
|
47
|
+
devOptions: { enabled: false }
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
export { createDocksPwaPlugin };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=vite-pwa-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-pwa-plugin.js","names":[],"sources":["../src/vite-pwa-plugin.ts"],"sourcesContent":["import { fileURLToPath } from 'url';\nimport path from 'path';\nimport type { PluginOption } from 'vite';\nimport { VitePWA } from 'vite-plugin-pwa';\n\nexport type CreateDocksPwaPluginOptions = {\n basePath: string;\n appName: string;\n appDescription: string;\n maximumFileSizeToCacheInBytes: number;\n shortName?: string;\n};\n\nconst DEFAULT_GLOB_PATTERNS = ['**/*.{js,css,html,ico,png,svg,webp,woff2,woff,ttf,wasm}'];\nconst DEFAULT_ASSETS = ['favicon.svg', 'logo.svg', 'logo-loading.svg'];\nconst pwaSwPath = fileURLToPath(import.meta.resolve('@eclipse-docks/extension-pwa/sw'));\nconst pwaSwDir = path.dirname(pwaSwPath);\nconst pwaSwFilename = path.basename(pwaSwPath);\n\nexport function createDocksPwaPlugin({\n basePath,\n appName,\n appDescription,\n maximumFileSizeToCacheInBytes,\n shortName = appName,\n}: CreateDocksPwaPluginOptions): PluginOption {\n return VitePWA({\n registerType: 'autoUpdate',\n injectRegister: 'inline',\n strategies: 'injectManifest',\n srcDir: pwaSwDir,\n filename: pwaSwFilename,\n manifest: {\n name: appName,\n short_name: shortName,\n description: appDescription,\n theme_color: '#1a1a1a',\n background_color: '#1a1a1a',\n display: 'standalone',\n start_url: basePath,\n scope: basePath,\n icons: [\n {\n src: 'logo.svg',\n sizes: 'any',\n type: 'image/svg+xml',\n purpose: 'any',\n },\n {\n src: 'favicon.svg',\n sizes: 'any',\n type: 'image/svg+xml',\n purpose: 'monochrome',\n },\n ],\n },\n includeAssets: DEFAULT_ASSETS,\n injectManifest: {\n maximumFileSizeToCacheInBytes,\n globPatterns: DEFAULT_GLOB_PATTERNS,\n },\n devOptions: {\n enabled: false,\n },\n });\n}\n"],"mappings":";;;;AAaA,IAAM,wBAAwB,CAAC,0DAA0D;AACzF,IAAM,iBAAiB;CAAC;CAAe;CAAY;CAAmB;AACtE,IAAM,YAAY,cAAc,OAAO,KAAK,QAAQ,kCAAkC,CAAC;AACvF,IAAM,WAAW,KAAK,QAAQ,UAAU;AACxC,IAAM,gBAAgB,KAAK,SAAS,UAAU;AAE9C,SAAgB,qBAAqB,EACnC,UACA,SACA,gBACA,+BACA,YAAY,WACgC;AAC5C,QAAO,QAAQ;EACb,cAAc;EACd,gBAAgB;EAChB,YAAY;EACZ,QAAQ;EACR,UAAU;EACV,UAAU;GACR,MAAM;GACN,YAAY;GACZ,aAAa;GACb,aAAa;GACb,kBAAkB;GAClB,SAAS;GACT,WAAW;GACX,OAAO;GACP,OAAO,CACL;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,SAAS;IACV,EACD;IACE,KAAK;IACL,OAAO;IACP,MAAM;IACN,SAAS;IACV,CACF;GACF;EACD,eAAe;EACf,gBAAgB;GACd;GACA,cAAc;GACf;EACD,YAAY,EACV,SAAS,OACV;EACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-docks/extension-pwa",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.93",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"import": "./dist/index.js"
|
|
10
10
|
},
|
|
11
11
|
"./vite": {
|
|
12
|
-
"types": "./
|
|
13
|
-
"import": "./
|
|
12
|
+
"types": "./dist/vite-pwa-plugin.d.ts",
|
|
13
|
+
"import": "./dist/vite-pwa-plugin.js"
|
|
14
14
|
},
|
|
15
15
|
"./sw": {
|
|
16
16
|
"import": "./src/sw.ts"
|
|
@@ -29,9 +29,7 @@
|
|
|
29
29
|
"types": "./dist/index.d.ts",
|
|
30
30
|
"files": [
|
|
31
31
|
"dist",
|
|
32
|
-
"src/sw.ts"
|
|
33
|
-
"src/vite-pwa-plugin.js",
|
|
34
|
-
"src/vite-pwa-plugin.d.ts"
|
|
32
|
+
"src/sw.ts"
|
|
35
33
|
],
|
|
36
34
|
"scripts": {
|
|
37
35
|
"build": "vite build"
|
package/src/vite-pwa-plugin.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { PluginOption } from 'vite';
|
|
2
|
-
|
|
3
|
-
export type CreateDocksPwaPluginOptions = {
|
|
4
|
-
basePath: string;
|
|
5
|
-
appName: string;
|
|
6
|
-
appDescription: string;
|
|
7
|
-
maximumFileSizeToCacheInBytes: number;
|
|
8
|
-
shortName?: string;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export declare function createDocksPwaPlugin(
|
|
12
|
-
options: CreateDocksPwaPluginOptions,
|
|
13
|
-
): PluginOption;
|
package/src/vite-pwa-plugin.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath } from 'url';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { VitePWA } from 'vite-plugin-pwa';
|
|
4
|
-
|
|
5
|
-
const DEFAULT_GLOB_PATTERNS = ['**/*.{js,css,html,ico,png,svg,webp,woff2,woff,ttf,wasm}'];
|
|
6
|
-
const DEFAULT_ASSETS = ['favicon.svg', 'logo.svg', 'logo-loading.svg'];
|
|
7
|
-
const pwaSwPath = fileURLToPath(new URL('./sw.ts', import.meta.url));
|
|
8
|
-
const pwaSwDir = path.dirname(pwaSwPath);
|
|
9
|
-
const pwaSwFilename = path.basename(pwaSwPath);
|
|
10
|
-
|
|
11
|
-
export function createDocksPwaPlugin({
|
|
12
|
-
basePath,
|
|
13
|
-
appName,
|
|
14
|
-
appDescription,
|
|
15
|
-
maximumFileSizeToCacheInBytes,
|
|
16
|
-
shortName = appName,
|
|
17
|
-
}) {
|
|
18
|
-
return VitePWA({
|
|
19
|
-
registerType: 'autoUpdate',
|
|
20
|
-
injectRegister: 'inline',
|
|
21
|
-
strategies: 'injectManifest',
|
|
22
|
-
srcDir: pwaSwDir,
|
|
23
|
-
filename: pwaSwFilename,
|
|
24
|
-
manifest: {
|
|
25
|
-
name: appName,
|
|
26
|
-
short_name: shortName,
|
|
27
|
-
description: appDescription,
|
|
28
|
-
theme_color: '#1a1a1a',
|
|
29
|
-
background_color: '#1a1a1a',
|
|
30
|
-
display: 'standalone',
|
|
31
|
-
start_url: basePath,
|
|
32
|
-
scope: basePath,
|
|
33
|
-
icons: [
|
|
34
|
-
{
|
|
35
|
-
src: 'logo.svg',
|
|
36
|
-
sizes: 'any',
|
|
37
|
-
type: 'image/svg+xml',
|
|
38
|
-
purpose: 'any',
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
src: 'favicon.svg',
|
|
42
|
-
sizes: 'any',
|
|
43
|
-
type: 'image/svg+xml',
|
|
44
|
-
purpose: 'monochrome',
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
},
|
|
48
|
-
includeAssets: DEFAULT_ASSETS,
|
|
49
|
-
injectManifest: {
|
|
50
|
-
maximumFileSizeToCacheInBytes,
|
|
51
|
-
globPatterns: DEFAULT_GLOB_PATTERNS,
|
|
52
|
-
},
|
|
53
|
-
devOptions: {
|
|
54
|
-
enabled: false,
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
}
|