@eclipse-docks/extension-pwa 0.7.91 → 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.
@@ -1,5 +1,5 @@
1
1
  import { PluginOption } from 'vite';
2
- type CreateDocksPwaPluginOptions = {
2
+ export type CreateDocksPwaPluginOptions = {
3
3
  basePath: string;
4
4
  appName: string;
5
5
  appDescription: string;
@@ -7,5 +7,4 @@ type CreateDocksPwaPluginOptions = {
7
7
  shortName?: string;
8
8
  };
9
9
  export declare function createDocksPwaPlugin({ basePath, appName, appDescription, maximumFileSizeToCacheInBytes, shortName, }: CreateDocksPwaPluginOptions): PluginOption;
10
- export {};
11
10
  //# sourceMappingURL=vite-pwa-plugin.d.ts.map
@@ -1 +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,KAAK,2BAA2B,GAAG;IACjC,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"}
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.91",
3
+ "version": "0.7.93",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "exports": {
@@ -9,7 +9,8 @@
9
9
  "import": "./dist/index.js"
10
10
  },
11
11
  "./vite": {
12
- "import": "./src/vite-pwa-plugin.ts"
12
+ "types": "./dist/vite-pwa-plugin.d.ts",
13
+ "import": "./dist/vite-pwa-plugin.js"
13
14
  },
14
15
  "./sw": {
15
16
  "import": "./src/sw.ts"
@@ -28,8 +29,7 @@
28
29
  "types": "./dist/index.d.ts",
29
30
  "files": [
30
31
  "dist",
31
- "src/sw.ts",
32
- "src/vite-pwa-plugin.ts"
32
+ "src/sw.ts"
33
33
  ],
34
34
  "scripts": {
35
35
  "build": "vite build"
@@ -1,66 +0,0 @@
1
- import { fileURLToPath } from 'url';
2
- import path from 'path';
3
- import type { PluginOption } from 'vite';
4
- import { VitePWA } from 'vite-plugin-pwa';
5
-
6
- type CreateDocksPwaPluginOptions = {
7
- basePath: string;
8
- appName: string;
9
- appDescription: string;
10
- maximumFileSizeToCacheInBytes: number;
11
- shortName?: string;
12
- };
13
-
14
- const DEFAULT_GLOB_PATTERNS = ['**/*.{js,css,html,ico,png,svg,webp,woff2,woff,ttf,wasm}'];
15
- const DEFAULT_ASSETS = ['favicon.svg', 'logo.svg', 'logo-loading.svg'];
16
- const pwaSwPath = fileURLToPath(new URL('./sw.ts', import.meta.url));
17
- const pwaSwDir = path.dirname(pwaSwPath);
18
- const pwaSwFilename = path.basename(pwaSwPath);
19
-
20
- export function createDocksPwaPlugin({
21
- basePath,
22
- appName,
23
- appDescription,
24
- maximumFileSizeToCacheInBytes,
25
- shortName = appName,
26
- }: CreateDocksPwaPluginOptions): PluginOption {
27
- return VitePWA({
28
- registerType: 'autoUpdate',
29
- injectRegister: 'inline',
30
- strategies: 'injectManifest',
31
- srcDir: pwaSwDir,
32
- filename: pwaSwFilename,
33
- manifest: {
34
- name: appName,
35
- short_name: shortName,
36
- description: appDescription,
37
- theme_color: '#1a1a1a',
38
- background_color: '#1a1a1a',
39
- display: 'standalone',
40
- start_url: basePath,
41
- scope: basePath,
42
- icons: [
43
- {
44
- src: 'logo.svg',
45
- sizes: 'any',
46
- type: 'image/svg+xml',
47
- purpose: 'any',
48
- },
49
- {
50
- src: 'favicon.svg',
51
- sizes: 'any',
52
- type: 'image/svg+xml',
53
- purpose: 'monochrome',
54
- },
55
- ],
56
- },
57
- includeAssets: DEFAULT_ASSETS,
58
- injectManifest: {
59
- maximumFileSizeToCacheInBytes,
60
- globPatterns: DEFAULT_GLOB_PATTERNS,
61
- },
62
- devOptions: {
63
- enabled: false,
64
- },
65
- });
66
- }