@modular-component/with-components 0.1.6 → 0.2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @modular-component/with-components
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 83d453f: Rework API for better TypeScript performance and improved DX
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [83d453f]
12
+ - @modular-component/core@0.2.0
13
+
14
+ ## 0.1.7
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [31f2966]
19
+ - @modular-component/core@0.1.7
20
+
3
21
  ## 0.1.6
4
22
 
5
23
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,17 +1,4 @@
1
1
  import { ComponentType } from 'react';
2
- declare const withComponents: unique symbol;
3
- declare module '@modular-component/core' {
4
- interface ModularStages<Args, Value> {
5
- [withComponents]: {
6
- restrict: Record<string, ComponentType>;
7
- };
8
- }
9
- }
10
- export declare const WithComponents: {
11
- readonly Components: {
12
- readonly symbol: typeof withComponents;
13
- readonly field: "components";
14
- };
15
- };
16
- export {};
2
+ import { ModularStage } from '@modular-component/core';
3
+ export declare function components<Components extends Record<string, ComponentType>>(components: Components): ModularStage<'components', () => Components>;
17
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAIrC,QAAA,MAAM,cAAc,eAAW,CAAA;AAE/B,OAAO,QAAQ,yBAAyB,CAAC;IACvC,UAAiB,aAAa,CAAC,IAAI,EAAE,KAAK;QACxC,CAAC,cAAc,CAAC,EAAE;YAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;SACxC,CAAA;KACF;CACF;AAED,eAAO,MAAM,cAAc;;;;;CAEhB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAEtD,wBAAgB,UAAU,CAAC,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EACzE,UAAU,EAAE,UAAU,GACrB,YAAY,CAAC,YAAY,EAAE,MAAM,UAAU,CAAC,CAE9C"}
package/dist/index.js CHANGED
@@ -1,6 +1,4 @@
1
- import { createMethodRecord } from '@modular-component/core';
2
- const withComponents = Symbol();
3
- export const WithComponents = createMethodRecord({
4
- Components: { symbol: withComponents, field: 'components' },
5
- });
1
+ export function components(components) {
2
+ return { field: 'components', useStage: () => components };
3
+ }
6
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAE5D,MAAM,cAAc,GAAG,MAAM,EAAE,CAAA;AAU/B,MAAM,CAAC,MAAM,cAAc,GAAG,kBAAkB,CAAC;IAC/C,UAAU,EAAE,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,EAAE;CACnD,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,UAAU,CACxB,UAAsB;IAEtB,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,CAAA;AAC5D,CAAC"}
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "Sub-components",
10
10
  "Injection"
11
11
  ],
12
- "version": "0.1.6",
12
+ "version": "0.2.0",
13
13
  "type": "module",
14
14
  "license": "MIT",
15
15
  "publishConfig": {
@@ -27,14 +27,14 @@
27
27
  "license": "cp ../../LICENSE ./LICENSE"
28
28
  },
29
29
  "dependencies": {
30
- "@modular-component/core": "0.1.6"
30
+ "@modular-component/core": "0.2.0"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "react": ">=17 <19"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/react": "^18.0.17",
37
- "typescript": "^4.6.4"
37
+ "typescript": "^5.2.2"
38
38
  },
39
39
  "main": "dist/index.js",
40
40
  "types": "dist/index.d.ts"
package/src/index.ts CHANGED
@@ -1,17 +1,8 @@
1
1
  import { ComponentType } from 'react'
2
+ import { ModularStage } from '@modular-component/core'
2
3
 
3
- import { createMethodRecord } from '@modular-component/core'
4
-
5
- const withComponents = Symbol()
6
-
7
- declare module '@modular-component/core' {
8
- export interface ModularStages<Args, Value> {
9
- [withComponents]: {
10
- restrict: Record<string, ComponentType>
11
- }
12
- }
4
+ export function components<Components extends Record<string, ComponentType>>(
5
+ components: Components,
6
+ ): ModularStage<'components', () => Components> {
7
+ return { field: 'components', useStage: () => components }
13
8
  }
14
-
15
- export const WithComponents = createMethodRecord({
16
- Components: { symbol: withComponents, field: 'components' },
17
- } as const)