@alloy-js/core 0.2.0 → 0.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.
- package/CHANGELOG.md +18 -0
- package/dist/src/binder.d.ts +28 -5
- package/dist/src/binder.d.ts.map +1 -1
- package/dist/src/binder.js +107 -7
- package/dist/src/binder.js.map +1 -1
- package/dist/src/components/Declaration.d.ts +1 -1
- package/dist/src/components/Declaration.d.ts.map +1 -1
- package/dist/src/components/Declaration.js.map +1 -1
- package/dist/src/components/Indent.d.ts +1 -1
- package/dist/src/components/Indent.d.ts.map +1 -1
- package/dist/src/components/Indent.js.map +1 -1
- package/dist/src/components/MemberDeclaration.d.ts +1 -1
- package/dist/src/components/MemberDeclaration.d.ts.map +1 -1
- package/dist/src/components/MemberDeclaration.js.map +1 -1
- package/dist/src/components/MemberScope.d.ts +1 -1
- package/dist/src/components/MemberScope.d.ts.map +1 -1
- package/dist/src/components/Output.d.ts +1 -1
- package/dist/src/components/Output.d.ts.map +1 -1
- package/dist/src/components/Output.js +5 -3
- package/dist/src/components/Output.js.map +1 -1
- package/dist/src/components/Scope.d.ts +1 -1
- package/dist/src/components/Scope.d.ts.map +1 -1
- package/dist/src/components/Scope.js.map +1 -1
- package/dist/src/components/SourceDirectory.d.ts +1 -1
- package/dist/src/components/SourceDirectory.d.ts.map +1 -1
- package/dist/src/components/SourceDirectory.js +1 -1
- package/dist/src/components/SourceDirectory.js.map +1 -1
- package/dist/src/components/SourceFile.d.ts +16 -1
- package/dist/src/components/SourceFile.d.ts.map +1 -1
- package/dist/src/components/SourceFile.js +14 -2
- package/dist/src/components/SourceFile.js.map +1 -1
- package/dist/src/context/assignment.d.ts.map +1 -1
- package/dist/src/context/assignment.js +2 -2
- package/dist/src/context/assignment.js.map +1 -1
- package/dist/src/context/binder.d.ts.map +1 -1
- package/dist/src/context/binder.js +2 -2
- package/dist/src/context/binder.js.map +1 -1
- package/dist/src/context/declaration.d.ts.map +1 -1
- package/dist/src/context/declaration.js +2 -2
- package/dist/src/context/declaration.js.map +1 -1
- package/dist/src/context/indent.d.ts.map +1 -1
- package/dist/src/context/indent.js +2 -2
- package/dist/src/context/indent.js.map +1 -1
- package/dist/src/context/member-declaration.d.ts.map +1 -1
- package/dist/src/context/member-declaration.js +2 -2
- package/dist/src/context/member-declaration.js.map +1 -1
- package/dist/src/context/member-scope.d.ts.map +1 -1
- package/dist/src/context/member-scope.js +2 -2
- package/dist/src/context/member-scope.js.map +1 -1
- package/dist/src/context/name-policy.d.ts.map +1 -1
- package/dist/src/context/name-policy.js +2 -2
- package/dist/src/context/name-policy.js.map +1 -1
- package/dist/src/context/scope.d.ts.map +1 -1
- package/dist/src/context/scope.js +2 -2
- package/dist/src/context/scope.js.map +1 -1
- package/dist/src/context/source-directory.d.ts.map +1 -1
- package/dist/src/context/source-directory.js +2 -2
- package/dist/src/context/source-directory.js.map +1 -1
- package/dist/src/context/source-file.d.ts.map +1 -1
- package/dist/src/context/source-file.js +2 -2
- package/dist/src/context/source-file.js.map +1 -1
- package/dist/src/context.d.ts +5 -2
- package/dist/src/context.d.ts.map +1 -1
- package/dist/src/context.js +11 -4
- package/dist/src/context.js.map +1 -1
- package/dist/src/debug.d.ts +14 -0
- package/dist/src/debug.d.ts.map +1 -0
- package/dist/src/debug.js +163 -0
- package/dist/src/debug.js.map +1 -0
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/jsx-runtime.d.ts +6 -2
- package/dist/src/jsx-runtime.d.ts.map +1 -1
- package/dist/src/jsx-runtime.js +8 -6
- package/dist/src/jsx-runtime.js.map +1 -1
- package/dist/src/render.d.ts +1 -1
- package/dist/src/render.d.ts.map +1 -1
- package/dist/src/render.js +3 -3
- package/dist/src/render.js.map +1 -1
- package/dist/src/slot.d.ts +15 -0
- package/dist/src/slot.d.ts.map +1 -0
- package/dist/src/slot.js +51 -0
- package/dist/src/slot.js.map +1 -0
- package/dist/src/utils.d.ts +2 -7
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +1 -34
- package/dist/src/utils.js.map +1 -1
- package/dist/src/write-output.browser.d.ts +2 -0
- package/dist/src/write-output.browser.d.ts.map +1 -0
- package/dist/src/write-output.browser.js +4 -0
- package/dist/src/write-output.browser.js.map +1 -0
- package/dist/src/write-output.d.ts +7 -0
- package/dist/src/write-output.d.ts.map +1 -0
- package/dist/src/write-output.js +34 -0
- package/dist/src/write-output.js.map +1 -0
- package/dist/test/components/slot.test.d.ts +2 -0
- package/dist/test/components/slot.test.d.ts.map +1 -0
- package/dist/testing/render.d.ts +1 -1
- package/dist/testing/render.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -5
- package/src/binder.ts +181 -6
- package/src/components/Declaration.tsx +1 -1
- package/src/components/Indent.tsx +1 -1
- package/src/components/MemberDeclaration.tsx +1 -1
- package/src/components/MemberScope.tsx +1 -1
- package/src/components/Output.tsx +3 -2
- package/src/components/Scope.tsx +1 -1
- package/src/components/SourceDirectory.tsx +1 -1
- package/src/components/SourceFile.tsx +28 -6
- package/src/context/assignment.ts +6 -2
- package/src/context/binder.ts +7 -2
- package/src/context/declaration.ts +2 -2
- package/src/context/indent.ts +13 -6
- package/src/context/member-declaration.ts +2 -2
- package/src/context/member-scope.ts +6 -2
- package/src/context/name-policy.ts +6 -2
- package/src/context/scope.ts +7 -2
- package/src/context/source-directory.ts +2 -2
- package/src/context/source-file.ts +2 -2
- package/src/context.ts +15 -4
- package/src/debug.ts +209 -0
- package/src/index.ts +2 -1
- package/src/jsx-runtime.ts +19 -8
- package/src/render.ts +8 -8
- package/src/slot.ts +90 -0
- package/src/utils.ts +2 -34
- package/src/write-output.browser.ts +3 -0
- package/src/write-output.ts +33 -0
- package/temp/api.json +589 -56
- package/test/components/slot.test.tsx +172 -0
- package/test/components/source-file.test.tsx +28 -0
- package/test/rendering/basic.test.tsx +1 -1
- package/test/symbols.test.ts +102 -0
- package/testing/render.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createNamedContext, useContext } from "../context.js";
|
|
2
2
|
/**
|
|
3
3
|
* AssignmentContext provides the symbol that is the target of the current
|
|
4
4
|
* assignment.
|
|
@@ -15,7 +15,7 @@ import { createContext, useContext } from "../context.js";
|
|
|
15
15
|
* object value expression should use assignment context to provide the member
|
|
16
16
|
* symbols for the object value's properties.
|
|
17
17
|
*/
|
|
18
|
-
export const AssignmentContext =
|
|
18
|
+
export const AssignmentContext = createNamedContext("Assignment");
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Creates a new {@link (AssignmentContext:interface)}.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assignment.js","names":["
|
|
1
|
+
{"version":3,"file":"assignment.js","names":["createNamedContext","useContext","AssignmentContext","createAssignmentContext","target","isAssigned","getAssignmentSymbol","assignmentContext","undefined"],"sources":["../../../src/context/assignment.ts"],"sourcesContent":[null],"mappings":"AACA,SAEEA,kBAAkB,EAClBC,UAAU,QACL,eAAe;AAetB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAsD,GACjEF,kBAAkB,CAAC,YAAY,CAAC;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,uBAAuBA,CACrCC,MAAoB,EACD;EACnB,OAAO;IACLC,UAAU,EAAE,KAAK;IACjBD;EACF,CAAC;AACH;AAEA,OAAO,SAASE,mBAAmBA,CAAA,EAAG;EACpC,MAAMC,iBAAiB,GAAGN,UAAU,CAACC,iBAAiB,CAAC;EACvD,IAAIK,iBAAiB,EAAE;IACrB,OAAOA,iBAAiB,CAACH,MAAM;EACjC;EACA,OAAOI,SAAS;AAClB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binder.d.ts","sourceRoot":"","sources":["../../../src/context/binder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"binder.d.ts","sourceRoot":"","sources":["../../../src/context/binder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EACL,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AAIvB;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,gBAAgB,CAAC,MAAM,CACrB,CAAC;AAE/B,wBAAgB,SAAS,WAExB"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createNamedContext, useContext } from "../context.js";
|
|
2
2
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The binder context provides the binder instance to all components. This
|
|
6
6
|
* context is provided by the {@link Output | output component}.
|
|
7
7
|
*/
|
|
8
|
-
export const BinderContext =
|
|
8
|
+
export const BinderContext = createNamedContext("Binder");
|
|
9
9
|
export function useBinder() {
|
|
10
10
|
return useContext(BinderContext);
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binder.js","names":["
|
|
1
|
+
{"version":3,"file":"binder.js","names":["createNamedContext","useContext","BinderContext","useBinder"],"sources":["../../../src/context/binder.ts"],"sourcesContent":[null],"mappings":"AACA,SAEEA,kBAAkB,EAClBC,UAAU,QACL,eAAe;AACtB;;AAGA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAuC,GAClDF,kBAAkB,CAAC,QAAQ,CAAC;AAE9B,OAAO,SAASG,SAASA,CAAA,EAAG;EAC1B,OAAOF,UAAU,CAACC,aAAa,CAAC;AAClC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declaration.d.ts","sourceRoot":"","sources":["../../../src/context/declaration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"declaration.d.ts","sourceRoot":"","sources":["../../../src/context/declaration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAsB,MAAM,eAAe,CAAC;AAErE,eAAO,MAAM,kBAAkB,EAAE,gBAAgB,CAAC,YAAY,CAC3B,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const DeclarationContext =
|
|
1
|
+
import { createNamedContext } from "../context.js";
|
|
2
|
+
export const DeclarationContext = createNamedContext("Declaration");
|
|
3
3
|
//# sourceMappingURL=declaration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declaration.js","names":["
|
|
1
|
+
{"version":3,"file":"declaration.js","names":["createNamedContext","DeclarationContext"],"sources":["../../../src/context/declaration.ts"],"sourcesContent":[null],"mappings":"AACA,SAA2BA,kBAAkB,QAAQ,eAAe;AAEpE,OAAO,MAAMC,kBAAkD,GAC7DD,kBAAkB,CAAC,aAAa,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indent.d.ts","sourceRoot":"","sources":["../../../src/context/indent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,
|
|
1
|
+
{"version":3,"file":"indent.d.ts","sourceRoot":"","sources":["../../../src/context/indent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EACL,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AAEvB,eAAO,MAAM,aAAa,EAAE,gBAAgB,CAAC,WAAW,CAOvD,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,gBAAgB,CAAC,MAAM,CAAyB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createContext } from "../context.js";
|
|
2
|
-
export const IndentContext =
|
|
1
|
+
import { createContext, createNamedContext } from "../context.js";
|
|
2
|
+
export const IndentContext = createNamedContext("Indent", {
|
|
3
3
|
level: 0,
|
|
4
4
|
indent: " ",
|
|
5
5
|
indentString: ""
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indent.js","names":["createContext","IndentContext","level","indent","indentString","TestContext"],"sources":["../../../src/context/indent.ts"],"sourcesContent":[null],"mappings":"AACA,
|
|
1
|
+
{"version":3,"file":"indent.js","names":["createContext","createNamedContext","IndentContext","level","indent","indentString","TestContext"],"sources":["../../../src/context/indent.ts"],"sourcesContent":[null],"mappings":"AACA,SAEEA,aAAa,EACbC,kBAAkB,QACb,eAAe;AAEtB,OAAO,MAAMC,aAA4C,GAAGD,kBAAkB,CAC5E,QAAQ,EACR;EACEE,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE,IAAI;EACZC,YAAY,EAAE;AAChB,CACF,CAAC;AAED,OAAO,MAAMC,WAAqC,GAAGN,aAAa,CAAC,MAAM,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"member-declaration.d.ts","sourceRoot":"","sources":["../../../src/context/member-declaration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"member-declaration.d.ts","sourceRoot":"","sources":["../../../src/context/member-declaration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAsB,MAAM,eAAe,CAAC;AAErE;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,gBAAgB,CAAC,YAAY,CAC3B,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createNamedContext } from "../context.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Provides the symbol for the member currently being declared.
|
|
5
5
|
*
|
|
6
6
|
* @see {@link DeclarationContext} for getting the symbol for the current non-member declaration.
|
|
7
7
|
*/
|
|
8
|
-
export const MemberDeclarationContext =
|
|
8
|
+
export const MemberDeclarationContext = createNamedContext("MemberDeclaration");
|
|
9
9
|
//# sourceMappingURL=member-declaration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"member-declaration.js","names":["
|
|
1
|
+
{"version":3,"file":"member-declaration.js","names":["createNamedContext","MemberDeclarationContext"],"sources":["../../../src/context/member-declaration.ts"],"sourcesContent":[null],"mappings":"AACA,SAA2BA,kBAAkB,QAAQ,eAAe;;AAEpE;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,wBAAwD,GACnED,kBAAkB,CAAC,mBAAmB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"member-scope.d.ts","sourceRoot":"","sources":["../../../src/context/member-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,
|
|
1
|
+
{"version":3,"file":"member-scope.d.ts","sourceRoot":"","sources":["../../../src/context/member-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EACL,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AAEvB;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,aAAa,CAAC,EAAE,WAAW,CAAC;IAC5B,eAAe,CAAC,EAAE,WAAW,CAAC;CAC/B;AACD,eAAO,MAAM,kBAAkB,EAAE,gBAAgB,CAAC,kBAAkB,CACjC,CAAC;AAEpC,wBAAgB,cAAc,uBAE7B"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createNamedContext, useContext } from "../context.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The member scope context provides the instance and static member scopes that
|
|
5
5
|
* are used for member declarations and instance member resolution.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
export const MemberScopeContext =
|
|
8
|
+
export const MemberScopeContext = createNamedContext("MemberScope");
|
|
9
9
|
export function useMemberScope() {
|
|
10
10
|
return useContext(MemberScopeContext);
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"member-scope.js","names":["
|
|
1
|
+
{"version":3,"file":"member-scope.js","names":["createNamedContext","useContext","MemberScopeContext","useMemberScope"],"sources":["../../../src/context/member-scope.ts"],"sourcesContent":[null],"mappings":"AACA,SAEEA,kBAAkB,EAClBC,UAAU,QACL,eAAe;;AAEtB;AACA;AACA;AACA;;AAKA,OAAO,MAAMC,kBAAwD,GACnEF,kBAAkB,CAAC,aAAa,CAAC;AAEnC,OAAO,SAASG,cAAcA,CAAA,EAAG;EAC/B,OAAOF,UAAU,CAACC,kBAAkB,CAAC;AACvC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"name-policy.d.ts","sourceRoot":"","sources":["../../../src/context/name-policy.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"name-policy.d.ts","sourceRoot":"","sources":["../../../src/context/name-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,eAAO,MAAM,iBAAiB,EAAE,gBAAgB,CAAC,UAAU,CAAC,MAAM,CAAC,CAK/D,CAAC;AAEL,wBAAgB,aAAa,uBAE5B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const NamePolicyContext =
|
|
1
|
+
import { createNamedContext, useContext } from "../context.js";
|
|
2
|
+
export const NamePolicyContext = createNamedContext("NamePolicy", {
|
|
3
3
|
getName(name) {
|
|
4
4
|
return name;
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"name-policy.js","names":["
|
|
1
|
+
{"version":3,"file":"name-policy.js","names":["createNamedContext","useContext","NamePolicyContext","getName","name","useNamePolicy"],"sources":["../../../src/context/name-policy.ts"],"sourcesContent":[null],"mappings":"AAAA,SAEEA,kBAAkB,EAClBC,UAAU,QACL,eAAe;AAGtB,OAAO,MAAMC,iBAAuD,GAClEF,kBAAkB,CAAqB,YAAY,EAAE;EACnDG,OAAOA,CAACC,IAAI,EAAE;IACZ,OAAOA,IAAI;EACb;AACF,CAAC,CAAC;AAEJ,OAAO,SAASC,aAAaA,CAAA,EAAG;EAC9B,OAAOJ,UAAU,CAACC,iBAAiB,CAAC;AACtC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../../src/context/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,
|
|
1
|
+
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../../src/context/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EACL,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AAEvB,eAAO,MAAM,YAAY,EAAE,gBAAgB,CAAC,WAAW,CAC1B,CAAC;AAE9B,wBAAgB,QAAQ,gBAEvB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const ScopeContext =
|
|
1
|
+
import { createNamedContext, useContext } from "../context.js";
|
|
2
|
+
export const ScopeContext = createNamedContext("Scope");
|
|
3
3
|
export function useScope() {
|
|
4
4
|
return useContext(ScopeContext);
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope.js","names":["
|
|
1
|
+
{"version":3,"file":"scope.js","names":["createNamedContext","useContext","ScopeContext","useScope"],"sources":["../../../src/context/scope.ts"],"sourcesContent":[null],"mappings":"AACA,SAEEA,kBAAkB,EAClBC,UAAU,QACL,eAAe;AAEtB,OAAO,MAAMC,YAA2C,GACtDF,kBAAkB,CAAC,OAAO,CAAC;AAE7B,OAAO,SAASG,QAAQA,CAAA,EAAG;EACzB,OAAOF,UAAU,CAACC,YAAY,CAAC;AACjC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-directory.d.ts","sourceRoot":"","sources":["../../../src/context/source-directory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"source-directory.d.ts","sourceRoot":"","sources":["../../../src/context/source-directory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAsB,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,CAAC,sBAAsB,GAAG,iBAAiB,CAAC,EAAE,CAAC;IACzD,UAAU,CAAC,OAAO,EAAE,sBAAsB,GAAG,iBAAiB,GAAG,IAAI,CAAC;IACtE,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,sBAAsB,EAAE,gBAAgB,CAAC,sBAAsB,CACrC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const SourceDirectoryContext =
|
|
1
|
+
import { createNamedContext } from "../context.js";
|
|
2
|
+
export const SourceDirectoryContext = createNamedContext("SourceDirectory");
|
|
3
3
|
//# sourceMappingURL=source-directory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-directory.js","names":["
|
|
1
|
+
{"version":3,"file":"source-directory.js","names":["createNamedContext","SourceDirectoryContext"],"sources":["../../../src/context/source-directory.ts"],"sourcesContent":[null],"mappings":"AAAA,SAA2BA,kBAAkB,QAAQ,eAAe;AASpE,OAAO,MAAMC,sBAAgE,GAC3ED,kBAAkB,CAAC,iBAAiB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-file.d.ts","sourceRoot":"","sources":["../../../src/context/source-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"source-file.d.ts","sourceRoot":"","sources":["../../../src/context/source-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAsB,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,mBAAmB,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACrD;AAED,eAAO,MAAM,iBAAiB,EAAE,gBAAgB,CAAC,iBAAiB,CAChC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const SourceFileContext =
|
|
1
|
+
import { createNamedContext } from "../context.js";
|
|
2
|
+
export const SourceFileContext = createNamedContext("SourceFile");
|
|
3
3
|
//# sourceMappingURL=source-file.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-file.js","names":["
|
|
1
|
+
{"version":3,"file":"source-file.js","names":["createNamedContext","SourceFileContext"],"sources":["../../../src/context/source-file.ts"],"sourcesContent":[null],"mappings":"AAAA,SAA2BA,kBAAkB,QAAQ,eAAe;AAUpE,OAAO,MAAMC,iBAAsD,GACjED,kBAAkB,CAAC,YAAY,CAAC","ignoreList":[]}
|
package/dist/src/context.d.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { Children, ComponentDefinition } from "
|
|
1
|
+
import { Children, ComponentDefinition } from "./jsx-runtime.js";
|
|
2
2
|
export interface ComponentContext<T> {
|
|
3
3
|
id: symbol;
|
|
4
4
|
default: T | undefined;
|
|
5
5
|
Provider: ComponentDefinition<ContextProviderProps<T>>;
|
|
6
|
+
name?: string;
|
|
6
7
|
}
|
|
7
8
|
export interface ContextProviderProps<T = unknown> {
|
|
8
9
|
value?: T;
|
|
9
10
|
children?: Children;
|
|
10
11
|
}
|
|
11
12
|
export declare function useContext<T>(context: ComponentContext<T>): T | undefined;
|
|
12
|
-
export declare
|
|
13
|
+
export declare const contextsByKey: Map<symbol, ComponentContext<any>>;
|
|
14
|
+
export declare function createContext<T = unknown>(defaultValue?: T, name?: string): ComponentContext<T>;
|
|
15
|
+
export declare function createNamedContext<T>(name: string, defaultValue?: T): ComponentContext<T>;
|
|
13
16
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EACR,mBAAmB,EAIpB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;IACvB,QAAQ,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB,CAAC,CAAC,GAAG,OAAO;IAC/C,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,SAAS,CAWzE;AAED,eAAO,MAAM,aAAa,oCAA2C,CAAC;AAEtE,wBAAgB,aAAa,CAAC,CAAC,GAAG,OAAO,EACvC,YAAY,CAAC,EAAE,CAAC,EAChB,IAAI,CAAC,EAAE,MAAM,GACZ,gBAAgB,CAAC,CAAC,CAAC,CAoBrB;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,uBAEnE"}
|
package/dist/src/context.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { effect, getContext, untrack } from "@alloy-js/core/jsx-runtime";
|
|
2
1
|
import { shallowRef } from "@vue/reactivity";
|
|
2
|
+
import { effect, getContext, untrack } from "./jsx-runtime.js";
|
|
3
3
|
export function useContext(context) {
|
|
4
4
|
// context must come from a parent
|
|
5
5
|
let current = getContext();
|
|
@@ -11,11 +11,13 @@ export function useContext(context) {
|
|
|
11
11
|
}
|
|
12
12
|
return context.default;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
export const contextsByKey = new Map();
|
|
15
|
+
export function createContext(defaultValue, name) {
|
|
16
|
+
const id = Symbol(name ?? "context");
|
|
17
|
+
const ctx = {
|
|
17
18
|
id,
|
|
18
19
|
default: defaultValue,
|
|
20
|
+
name,
|
|
19
21
|
Provider(props) {
|
|
20
22
|
const context = getContext();
|
|
21
23
|
const rendered = shallowRef();
|
|
@@ -26,5 +28,10 @@ export function createContext(defaultValue) {
|
|
|
26
28
|
return rendered.value;
|
|
27
29
|
}
|
|
28
30
|
};
|
|
31
|
+
contextsByKey.set(id, ctx);
|
|
32
|
+
return ctx;
|
|
33
|
+
}
|
|
34
|
+
export function createNamedContext(name, defaultValue) {
|
|
35
|
+
return createContext(defaultValue, name);
|
|
29
36
|
}
|
|
30
37
|
//# sourceMappingURL=context.js.map
|
package/dist/src/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","names":["effect","getContext","untrack","
|
|
1
|
+
{"version":3,"file":"context.js","names":["shallowRef","effect","getContext","untrack","useContext","context","current","Object","hasOwn","id","owner","default","contextsByKey","Map","createContext","defaultValue","name","Symbol","ctx","Provider","props","rendered","value","children","set","createNamedContext"],"sources":["../../src/context.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,UAAU,QAAQ,iBAAiB;AAC5C,SAGEC,MAAM,EACNC,UAAU,EACVC,OAAO,QACF,kBAAkB;AAczB,OAAO,SAASC,UAAUA,CAAIC,OAA4B,EAAiB;EACzE;EACA,IAAIC,OAAO,GAAGJ,UAAU,CAAC,CAAC;EAC1B,OAAOI,OAAO,EAAE;IACd,IAAIC,MAAM,CAACC,MAAM,CAACF,OAAO,CAACD,OAAO,EAAGA,OAAO,CAACI,EAAE,CAAC,EAAE;MAC/C,OAAOH,OAAO,CAACD,OAAO,CAAEA,OAAO,CAACI,EAAE,CAAC;IACrC;IACAH,OAAO,GAAGA,OAAO,CAACI,KAAK;EACzB;EAEA,OAAOL,OAAO,CAACM,OAAO;AACxB;AAEA,OAAO,MAAMC,aAAa,GAAG,IAAIC,GAAG,CAAgC,CAAC;AAErE,OAAO,SAASC,aAAaA,CAC3BC,YAAgB,EAChBC,IAAa,EACQ;EACrB,MAAMP,EAAE,GAAGQ,MAAM,CAACD,IAAI,IAAI,SAAS,CAAC;EACpC,MAAME,GAAG,GAAG;IACVT,EAAE;IACFE,OAAO,EAAEI,YAAY;IACrBC,IAAI;IACJG,QAAQA,CAACC,KAA8B,EAAE;MACvC,MAAMf,OAAO,GAAGH,UAAU,CAAC,CAAC;MAE5B,MAAMmB,QAAQ,GAAGrB,UAAU,CAAC,CAAC;MAC7BC,MAAM,CAAC,MAAM;QACXI,OAAO,CAAEA,OAAO,CAAEI,EAAE,CAAC,GAAGW,KAAK,CAACE,KAAK;QACnCD,QAAQ,CAACC,KAAK,GAAGnB,OAAO,CAAC,MAAMiB,KAAK,CAACG,QAAQ,CAAC;MAChD,CAAC,CAAC;MAEF,OAAOF,QAAQ,CAACC,KAAK;IACvB;EACF,CAAC;EACDV,aAAa,CAACY,GAAG,CAACf,EAAE,EAAES,GAAG,CAAC;EAC1B,OAAOA,GAAG;AACZ;AAEA,OAAO,SAASO,kBAAkBA,CAAIT,IAAY,EAAED,YAAgB,EAAE;EACpE,OAAOD,aAAa,CAAIC,YAAY,EAAEC,IAAI,CAAC;AAC7C","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/debug.ts"],"names":[],"mappings":"AAMA,UAAU,cAAc;IACtB,SAAS,EAAE;QACT,KAAK,IAAI,IAAI,CAAC;QACd,IAAI,IAAI,IAAI,CAAC;QACb,KAAK,IAAI,IAAI,CAAC;QACd,MAAM,IAAI,IAAI,CAAC;QACf,OAAO,IAAI,IAAI,CAAC;KACjB,CAAC;CACH;AAoGD,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,KAAK,EAAE,cAAc,CAAC;CAC3B"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { isReactive } from "@vue/reactivity";
|
|
2
|
+
import { Chalk } from "chalk";
|
|
3
|
+
import Table from "cli-table3";
|
|
4
|
+
import { contextsByKey } from "./context.js";
|
|
5
|
+
import { getContext } from "./jsx-runtime.js";
|
|
6
|
+
const debug = {
|
|
7
|
+
component: {
|
|
8
|
+
stack: debugStack,
|
|
9
|
+
tree() {
|
|
10
|
+
console.log("tree");
|
|
11
|
+
},
|
|
12
|
+
watch() {
|
|
13
|
+
console.log("watch");
|
|
14
|
+
},
|
|
15
|
+
render() {
|
|
16
|
+
console.log("render");
|
|
17
|
+
},
|
|
18
|
+
context: debugContext
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
function debugStack() {
|
|
22
|
+
let currentContext = getContext();
|
|
23
|
+
let foundContexts = [];
|
|
24
|
+
while (currentContext !== null) {
|
|
25
|
+
if (currentContext.context && Object.getOwnPropertySymbols(currentContext.context)[0]) {
|
|
26
|
+
foundContexts.push(currentContext);
|
|
27
|
+
}
|
|
28
|
+
if (currentContext.componentOwner && currentContext.componentOwner.component.name !== "Provider") {
|
|
29
|
+
process.stdout.write(style.component.name(currentContext.componentOwner.component.name) + "\n");
|
|
30
|
+
const table = kvTable();
|
|
31
|
+
const props = currentContext.componentOwner.props;
|
|
32
|
+
table.push([{
|
|
33
|
+
hAlign: "right",
|
|
34
|
+
content: "props"
|
|
35
|
+
}, props && Object.keys(props).length > 0 ? dumpValue(props) : chalk.gray("(none)")]);
|
|
36
|
+
table.push([{
|
|
37
|
+
hAlign: "right",
|
|
38
|
+
content: "contexts"
|
|
39
|
+
}, foundContexts.length > 0 ? foundContexts.map(c => printContext(c, true)).join("\n") : chalk.gray("(none)")]);
|
|
40
|
+
process.stdout.write(table.toString() + "\n\n");
|
|
41
|
+
foundContexts = [];
|
|
42
|
+
}
|
|
43
|
+
currentContext = currentContext.owner;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function debugContext() {
|
|
47
|
+
let currentContext = getContext();
|
|
48
|
+
while (currentContext !== null) {
|
|
49
|
+
console.log(printContext(currentContext));
|
|
50
|
+
currentContext = currentContext.owner;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function printContext(context, omitOwner = false) {
|
|
54
|
+
if (!context.context) return "";
|
|
55
|
+
const key = Object.getOwnPropertySymbols(context.context)[0];
|
|
56
|
+
if (!key) return "";
|
|
57
|
+
const contextDefinition = contextsByKey.get(key);
|
|
58
|
+
const contextName = contextDefinition?.name ?? "unknown context";
|
|
59
|
+
const value = context.context[key];
|
|
60
|
+
let output = style.context.name(contextName);
|
|
61
|
+
if (!omitOwner) {
|
|
62
|
+
const owner = findContextOwner(context);
|
|
63
|
+
output += " provided by " + style.component.name(owner);
|
|
64
|
+
}
|
|
65
|
+
output += "\n" + dumpValue(value) + "\n";
|
|
66
|
+
return output;
|
|
67
|
+
}
|
|
68
|
+
function findContextOwner(context) {
|
|
69
|
+
let currentContext = context;
|
|
70
|
+
while (currentContext && (currentContext.componentOwner === undefined || currentContext.componentOwner.component.name === "Provider")) {
|
|
71
|
+
currentContext = currentContext.owner;
|
|
72
|
+
}
|
|
73
|
+
return currentContext?.componentOwner?.component.name ?? "unknown";
|
|
74
|
+
}
|
|
75
|
+
globalThis.debug = debug;
|
|
76
|
+
const chalk = new Chalk();
|
|
77
|
+
const style = {
|
|
78
|
+
value: {
|
|
79
|
+
primitive(value) {
|
|
80
|
+
switch (typeof value) {
|
|
81
|
+
case "string":
|
|
82
|
+
return chalk.blue(`"${value}"`);
|
|
83
|
+
case "object":
|
|
84
|
+
case "undefined":
|
|
85
|
+
return chalk.gray(String(value));
|
|
86
|
+
default:
|
|
87
|
+
return chalk.blue(String(value));
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
symbol(value) {
|
|
91
|
+
return chalk.gray(String(value));
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
context: {
|
|
95
|
+
name(name) {
|
|
96
|
+
return chalk.bgGray(` ${chalk.white(name)} `);
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
component: {
|
|
100
|
+
name(name) {
|
|
101
|
+
return chalk.bgBlue(` <${chalk.white(name)}> `);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
function reactiveTag(value) {
|
|
106
|
+
if (isReactive(value)) {
|
|
107
|
+
return " " + chalk.greenBright(`reactive`) + " ";
|
|
108
|
+
}
|
|
109
|
+
return "";
|
|
110
|
+
}
|
|
111
|
+
function dumpValue(value, level = 0) {
|
|
112
|
+
switch (typeof value) {
|
|
113
|
+
case "boolean":
|
|
114
|
+
case "string":
|
|
115
|
+
case "number":
|
|
116
|
+
return style.value.primitive(value) + reactiveTag(value);
|
|
117
|
+
case "symbol":
|
|
118
|
+
return style.value.symbol(value) + reactiveTag(value);
|
|
119
|
+
case "object":
|
|
120
|
+
if (value === null) {
|
|
121
|
+
return style.value.primitive(null) + reactiveTag(value);
|
|
122
|
+
} else {
|
|
123
|
+
if (level > 0) return chalk.gray(`{ ... }` + reactiveTag(value));
|
|
124
|
+
const table = kvTable(" ");
|
|
125
|
+
for (const [key, propValue] of Object.entries(value)) {
|
|
126
|
+
table.push([{
|
|
127
|
+
content: key
|
|
128
|
+
}, dumpValue(propValue, level + 1)]);
|
|
129
|
+
}
|
|
130
|
+
return table.toString();
|
|
131
|
+
}
|
|
132
|
+
case "function":
|
|
133
|
+
return chalk.gray("ƒ ()");
|
|
134
|
+
case "undefined":
|
|
135
|
+
return style.value.primitive(undefined);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function kvTable(sep = " ") {
|
|
139
|
+
return new Table({
|
|
140
|
+
chars: {
|
|
141
|
+
top: "",
|
|
142
|
+
"top-mid": "",
|
|
143
|
+
"top-left": "",
|
|
144
|
+
"top-right": "",
|
|
145
|
+
bottom: "",
|
|
146
|
+
"bottom-mid": "",
|
|
147
|
+
"bottom-left": "",
|
|
148
|
+
"bottom-right": "",
|
|
149
|
+
left: "",
|
|
150
|
+
"left-mid": "",
|
|
151
|
+
mid: "",
|
|
152
|
+
"mid-mid": "",
|
|
153
|
+
right: "",
|
|
154
|
+
"right-mid": "",
|
|
155
|
+
middle: sep
|
|
156
|
+
},
|
|
157
|
+
style: {
|
|
158
|
+
"padding-left": 0,
|
|
159
|
+
"padding-right": 0
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
//# sourceMappingURL=debug.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.js","names":["isReactive","Chalk","Table","contextsByKey","getContext","debug","component","stack","debugStack","tree","console","log","watch","render","context","debugContext","currentContext","foundContexts","Object","getOwnPropertySymbols","push","componentOwner","name","process","stdout","write","style","table","kvTable","props","hAlign","content","keys","length","dumpValue","chalk","gray","map","c","printContext","join","toString","owner","omitOwner","key","contextDefinition","get","contextName","value","output","findContextOwner","undefined","globalThis","primitive","blue","String","symbol","bgGray","white","bgBlue","reactiveTag","greenBright","level","propValue","entries","sep","chars","top","bottom","left","mid","right","middle"],"sources":["../../src/debug.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,KAAK,QAAQ,OAAO;AAC7B,OAAOC,KAAK,MAAM,YAAY;AAC9B,SAASC,aAAa,QAAQ,cAAc;AAC5C,SAAkBC,UAAU,QAAQ,kBAAkB;AAYtD,MAAMC,KAAqB,GAAG;EAC5BC,SAAS,EAAE;IACTC,KAAK,EAAEC,UAAU;IACjBC,IAAIA,CAAA,EAAG;MACLC,OAAO,CAACC,GAAG,CAAC,MAAM,CAAC;IACrB,CAAC;IACDC,KAAKA,CAAA,EAAG;MACNF,OAAO,CAACC,GAAG,CAAC,OAAO,CAAC;IACtB,CAAC;IACDE,MAAMA,CAAA,EAAG;MACPH,OAAO,CAACC,GAAG,CAAC,QAAQ,CAAC;IACvB,CAAC;IACDG,OAAO,EAAEC;EACX;AACF,CAAC;AAED,SAASP,UAAUA,CAAA,EAAG;EACpB,IAAIQ,cAAc,GAAGZ,UAAU,CAAC,CAAC;EACjC,IAAIa,aAAwB,GAAG,EAAE;EACjC,OAAOD,cAAc,KAAK,IAAI,EAAE;IAC9B,IACEA,cAAc,CAACF,OAAO,IACtBI,MAAM,CAACC,qBAAqB,CAACH,cAAc,CAACF,OAAO,CAAC,CAAC,CAAC,CAAC,EACvD;MACAG,aAAa,CAACG,IAAI,CAACJ,cAAc,CAAC;IACpC;IAEA,IACEA,cAAc,CAACK,cAAc,IAC7BL,cAAc,CAACK,cAAc,CAACf,SAAS,CAACgB,IAAI,KAAK,UAAU,EAC3D;MACAC,OAAO,CAACC,MAAM,CAACC,KAAK,CAClBC,KAAK,CAACpB,SAAS,CAACgB,IAAI,CAACN,cAAc,CAACK,cAAc,CAACf,SAA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S,EAAE,EAAE;MACbC,KAAK,EAAE,EAAE;MACT,WAAW,EAAE,EAAE;MACfC,MAAM,EAAEP;IACV,CAAC;IACDvC,KAAK,EAAE;MAAE,cAAc,EAAE,CAAC;MAAE,eAAe,EAAE;IAAE;EACjD,CAAC,CAAC;AACJ","ignoreList":[]}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from "@alloy-js/core/jsx-runtime";
|
|
2
1
|
export { computed, isProxy, reactive, ref, shallowReactive, shallowRef, toRaw, type Ref, } from "@vue/reactivity";
|
|
3
2
|
export * from "./binder.js";
|
|
4
3
|
export * from "./code.js";
|
|
@@ -10,4 +9,6 @@ export * from "./name-policy.js";
|
|
|
10
9
|
export * from "./refkey.js";
|
|
11
10
|
export * from "./render.js";
|
|
12
11
|
export * from "./utils.js";
|
|
12
|
+
export * from "./write-output.js";
|
|
13
|
+
import "./debug.js";
|
|
13
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,GAAG,EACH,eAAe,EACf,UAAU,EACV,KAAK,EACL,KAAK,GAAG,GACT,MAAM,iBAAiB,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,OAAO,YAAY,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from "@alloy-js/core/jsx-runtime";
|
|
2
1
|
export { computed, isProxy, reactive, ref, shallowReactive, shallowRef, toRaw } from "@vue/reactivity";
|
|
3
2
|
export * from "./binder.js";
|
|
4
3
|
export * from "./code.js";
|
|
@@ -10,4 +9,6 @@ export * from "./name-policy.js";
|
|
|
10
9
|
export * from "./refkey.js";
|
|
11
10
|
export * from "./render.js";
|
|
12
11
|
export * from "./utils.js";
|
|
12
|
+
export * from "./write-output.js";
|
|
13
|
+
import "./debug.js";
|
|
13
14
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["computed","isProxy","reactive","ref","shallowReactive","shallowRef","toRaw"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["computed","isProxy","reactive","ref","shallowReactive","shallowRef","toRaw"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,SACEA,QAAQ,EACRC,OAAO,EACPC,QAAQ,EACRC,GAAG,EACHC,eAAe,EACfC,UAAU,EACVC,KAAK,QAEA,iBAAiB;AACxB,cAAc,aAAa;AAC3B,cAAc,WAAW;AACzB,cAAc,uBAAuB;AACrC,cAAc,cAAc;AAC5B,cAAc,oBAAoB;AAClC,cAAc,kBAAkB;AAChC,cAAc,kBAAkB;AAChC,cAAc,aAAa;AAC3B,cAAc,aAAa;AAC3B,cAAc,YAAY;AAC1B,cAAc,mBAAmB;AACjC,OAAO,YAAY","ignoreList":[]}
|
|
@@ -8,9 +8,14 @@ export interface Context {
|
|
|
8
8
|
owner: Context | null;
|
|
9
9
|
context?: Record<symbol, unknown>;
|
|
10
10
|
meta?: Record<string, any>;
|
|
11
|
+
/**
|
|
12
|
+
* When this context was created by a component, this will
|
|
13
|
+
* be the component that created it.
|
|
14
|
+
*/
|
|
15
|
+
componentOwner?: ComponentCreator<unknown>;
|
|
11
16
|
}
|
|
12
17
|
export declare function getContext(): Context | null;
|
|
13
|
-
export declare function root<T>(fn: (d: Disposable) => T,
|
|
18
|
+
export declare function root<T>(fn: (d: Disposable) => T, componentOwner?: ComponentCreator<any>): T;
|
|
14
19
|
export declare function untrack<T>(fn: () => T): T;
|
|
15
20
|
export declare function memo<T>(fn: () => T, equal?: boolean): () => T;
|
|
16
21
|
export declare function effect<T>(fn: (prev?: T) => T, current?: T): void;
|
|
@@ -30,7 +35,6 @@ export interface ComponentCreator<TProps = Props> {
|
|
|
30
35
|
props: Props;
|
|
31
36
|
tag?: symbol;
|
|
32
37
|
}
|
|
33
|
-
export declare const shouldDebug: boolean;
|
|
34
38
|
export declare function pushStack(component: Component<any>, props: Props): void;
|
|
35
39
|
export declare function popStack(): void;
|
|
36
40
|
export declare function printRenderStack(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-runtime.d.ts","sourceRoot":"","sources":["../../src/jsx-runtime.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,GAAG,EAKJ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AASrC,MAAM,WAAW,UAAU;IACzB,IAAI,IAAI,CAAC;CACV;AAED,MAAM,WAAW,OAAO;IACtB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAGtB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAGlC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"jsx-runtime.d.ts","sourceRoot":"","sources":["../../src/jsx-runtime.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,GAAG,EAKJ,MAAM,iBAAiB,CAAC;AACzB,OA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EACV,OAAO,EAAE,CAAC,GACT,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACb,wBAAgB,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EACnC,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,CAAC,EACV,OAAO,EAAE,CAAC,EACV,OAAO,EAAE,CAAC,GACT,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC"}
|
package/dist/src/jsx-runtime.js
CHANGED
|
@@ -9,9 +9,9 @@ let globalContext = null;
|
|
|
9
9
|
export function getContext() {
|
|
10
10
|
return globalContext;
|
|
11
11
|
}
|
|
12
|
-
export function root(fn,
|
|
12
|
+
export function root(fn, componentOwner) {
|
|
13
13
|
globalContext = {
|
|
14
|
-
|
|
14
|
+
componentOwner,
|
|
15
15
|
disposables: [],
|
|
16
16
|
owner: globalContext,
|
|
17
17
|
context: {}
|
|
@@ -77,20 +77,19 @@ function cleanup(fn) {
|
|
|
77
77
|
}
|
|
78
78
|
// debugging utilities
|
|
79
79
|
const renderStack = [];
|
|
80
|
-
export const shouldDebug = !!process.env.ALLOY_DEBUG;
|
|
81
80
|
export function pushStack(component, props) {
|
|
82
|
-
if (!shouldDebug) return;
|
|
81
|
+
if (!shouldDebug()) return;
|
|
83
82
|
renderStack.push({
|
|
84
83
|
component,
|
|
85
84
|
props
|
|
86
85
|
});
|
|
87
86
|
}
|
|
88
87
|
export function popStack() {
|
|
89
|
-
if (!shouldDebug) return;
|
|
88
|
+
if (!shouldDebug()) return;
|
|
90
89
|
renderStack.pop();
|
|
91
90
|
}
|
|
92
91
|
export function printRenderStack() {
|
|
93
|
-
if (!shouldDebug) return;
|
|
92
|
+
if (!shouldDebug()) return;
|
|
94
93
|
|
|
95
94
|
// eslint-disable-next-line no-console
|
|
96
95
|
console.error("Error rendering:");
|
|
@@ -169,4 +168,7 @@ export function mergeProps(...sources) {
|
|
|
169
168
|
}
|
|
170
169
|
return target;
|
|
171
170
|
}
|
|
171
|
+
function shouldDebug() {
|
|
172
|
+
return typeof process !== "undefined" && !!process.env?.ALLOY_DEBUG;
|
|
173
|
+
}
|
|
172
174
|
//# sourceMappingURL=jsx-runtime.js.map
|