@pushwoosh/single-spa 1.3.1 → 1.4.0

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,6 +1,10 @@
1
1
  import { type ComponentType } from 'react';
2
+ import type { AppProps } from 'single-spa';
2
3
  import { type ReactAppOrParcel } from 'single-spa-react';
3
4
  import { type SPAContextType } from '@pushwoosh/spa-context';
5
+ export type ApplicationFunctionResult<T> = ReactAppOrParcel<T> & {
6
+ Application: ComponentType<T & AppProps>;
7
+ };
4
8
  export declare function createApplicationFunction<T extends {
5
9
  spaContext: SPAContextType;
6
- }>(Comp: ComponentType<T>): ReactAppOrParcel<T>;
10
+ }>(Comp: ComponentType<T>): ApplicationFunctionResult<T>;
@@ -56,9 +56,13 @@ export function createApplicationFunction(Comp) {
56
56
  });
57
57
  }
58
58
  }
59
- return singleSpaReact({
59
+ const lifecycles = singleSpaReact({
60
60
  React,
61
61
  ReactDOMClient,
62
62
  rootComponent: AppWrapper
63
63
  });
64
+ return {
65
+ ...lifecycles,
66
+ Application: AppWrapper
67
+ };
64
68
  }
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export * from './Parcel';
2
2
  export { createParcelFunction } from './createParcelFunction';
3
- export { createApplicationFunction } from './createApplicationFunction';
3
+ export { type ApplicationFunctionResult, createApplicationFunction } from './createApplicationFunction';
4
4
  export { loadModule } from './loadModule';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/single-spa",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
4
4
  "description": "single-spa lifecycle helpers for Pushwoosh micro-frontends: application and parcel factories wrapped in SPAContextProvider",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,14 +15,24 @@
15
15
  "access": "public",
16
16
  "directory": "dist"
17
17
  },
18
+ "pushwoosh": {
19
+ "cdn": {
20
+ "path": "single-spa",
21
+ "dir": "cdn-dist",
22
+ "importMap": [
23
+ "@pushwoosh/single-spa"
24
+ ]
25
+ }
26
+ },
18
27
  "dependencies": {
19
28
  "single-spa": "^6.0.3",
20
29
  "single-spa-react": "^6.0.2"
21
30
  },
22
31
  "devDependencies": {
23
- "@pushwoosh/spa-context": "^3.3.1",
32
+ "@pushwoosh/spa-context": "^3.4.1",
24
33
  "@types/react": "^19.3.0",
25
34
  "@types/react-dom": "^19.3.0",
35
+ "jsdom": "^26.1.0",
26
36
  "react": "^19.3.0",
27
37
  "react-dom": "^19.3.0",
28
38
  "vitest": "^4.1.10"
@@ -36,7 +46,7 @@
36
46
  "node": ">= 24"
37
47
  },
38
48
  "scripts": {
39
- "build": "pushwoosh-engine lib:build",
49
+ "build": "pushwoosh-engine lib:build && `pushwoosh-engine app:command:build`",
40
50
  "check": "pnpm run check:lint && pnpm run check:types && pnpm run test",
41
51
  "check:lint": "echo \"Run check:lint\" && NODE_ENV=production eslint ./src",
42
52
  "check:lint-fix": "echo \"Run check:lint\" && NODE_ENV=production eslint ./src --fix",