@promoboxx/react-scripts-vite 0.1.29 → 0.1.30-rc.2

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/dist/cli.js CHANGED
@@ -35,9 +35,13 @@ function spawnAndExit(command, args = [], env) {
35
35
  });
36
36
  }
37
37
  const [
38
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
38
+ // We should probably change our eslint config to ignore unused variables that
39
+ // start with an underscore. TypeScript ignores them, Rust ignores, them, it's
40
+ // been a convention for almost two decades.
41
+ // https://stackoverflow.com/a/77067927
42
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- see above
39
43
  _interpreter,
40
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
44
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- see above
41
45
  _thisFile, command, ...args] = process.argv;
42
46
  main(command, args);
43
47
  //# sourceMappingURL=cli.js.map
package/dist/client.d.ts CHANGED
@@ -1,38 +1,5 @@
1
1
  /// <reference types="vite/client" />
2
2
  /// <reference types="vite-plugin-svgr/client" />
3
3
  /// <reference types="vitest/globals" />
4
-
5
- // https://github.com/antfu/vite-plugin-pwa/blob/951311fa811b8cee98ea5530522961f64645cd75/client.d.ts
6
- declare module 'virtual:pwa-register' {
7
- export type RegisterSWOptions = {
8
- immediate?: boolean
9
- onNeedRefresh?: () => void
10
- onOfflineReady?: () => void
11
- onRegistered?: (registration: ServiceWorkerRegistration | undefined) => void
12
- onRegisterError?: (error: any) => void
13
- }
14
-
15
- export function registerSW(
16
- options?: RegisterSWOptions,
17
- ): (reloadPage?: boolean) => Promise<void>
18
- }
19
-
20
- // https://github.com/antfu/vite-plugin-pwa/blob/951311fa811b8cee98ea5530522961f64645cd75/client.d.ts
21
- declare module 'virtual:pwa-register/react' {
22
- // @ts-ignore ignore when react is not installed
23
- import { Dispatch, SetStateAction } from 'react'
24
-
25
- export type RegisterSWOptions = {
26
- immediate?: boolean
27
- onNeedRefresh?: () => void
28
- onOfflineReady?: () => void
29
- onRegistered?: (registration: ServiceWorkerRegistration | undefined) => void
30
- onRegisterError?: (error: any) => void
31
- }
32
-
33
- export function useRegisterSW(options?: RegisterSWOptions): {
34
- needRefresh: [boolean, Dispatch<SetStateAction<boolean>>]
35
- offlineReady: [boolean, Dispatch<SetStateAction<boolean>>]
36
- updateServiceWorker: (reloadPage?: boolean) => Promise<void>
37
- }
38
- }
4
+ /// <reference types="vite-plugin-pwa/vanillajs" />
5
+ /// <reference types="vite-plugin-pwa/react" />
@@ -1,8 +1,8 @@
1
- import { Plugin } from 'vite';
1
+ import { type Plugin } from 'vite';
2
2
  /**
3
3
  * Replace env variables in index.html
4
4
  * @see https://github.com/vitejs/vite/issues/3105#issuecomment-939703781
5
5
  * @see https://vitejs.dev/guide/api-plugin.html#transformindexhtml
6
6
  */
7
- declare function replaceEnvInHtml(): Plugin;
7
+ declare function replaceEnvInHtml(): Plugin<any>;
8
8
  export default replaceEnvInHtml;
@@ -13,8 +13,8 @@ function replaceEnvInHtml() {
13
13
  config = resolvedConfig;
14
14
  },
15
15
  transformIndexHtml: {
16
- enforce: 'pre',
17
- transform(html) {
16
+ order: 'pre',
17
+ handler(html) {
18
18
  return html.replace(/%(.*?)%/g, (match, envVarName) => config?.env?.[envVarName] ?? match);
19
19
  },
20
20
  },
@@ -1,5 +1,5 @@
1
1
  import react from '@vitejs/plugin-react';
2
- import { UserConfigFn } from 'vite';
2
+ import { type UserConfigFn } from 'vite';
3
3
  import pluginChecker from 'vite-plugin-checker';
4
4
  import envCompatible from 'vite-plugin-env-compatible';
5
5
  import { VitePWA } from 'vite-plugin-pwa';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promoboxx/react-scripts-vite",
3
- "version": "0.1.29",
3
+ "version": "0.1.30-rc.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "keywords": [],
@@ -14,21 +14,21 @@
14
14
  "author": "",
15
15
  "license": "ISC",
16
16
  "devDependencies": {
17
- "@promoboxx/eslint-config": "^3.0.1",
18
- "prettier": "^3.0.3",
17
+ "@promoboxx/eslint-config": "^3.1.0",
18
+ "prettier": "^3.1.0",
19
19
  "typescript": "^5.2.2"
20
20
  },
21
21
  "dependencies": {
22
- "@vitejs/plugin-react": "^4.1.0",
23
- "eslint": "^8.50.0",
22
+ "@vitejs/plugin-react": "^4.2.0",
23
+ "eslint": "^8.54.0",
24
24
  "jsdom": "^22.1.0",
25
- "vite": "^4.4.9",
25
+ "vite": "^5.0.0",
26
26
  "vite-plugin-checker": "^0.6.2",
27
27
  "vite-plugin-env-compatible": "^1.1.1",
28
- "vite-plugin-pwa": "^0.16.5",
29
- "vite-plugin-svgr": "^4.0.0",
28
+ "vite-plugin-pwa": "^0.17.0",
29
+ "vite-plugin-svgr": "^4.2.0",
30
30
  "vite-tsconfig-paths": "^4.2.1",
31
- "vitest": "^0.34.5"
31
+ "vitest": "^0.34.6"
32
32
  },
33
33
  "files": [
34
34
  "dist/cli.d.ts",