wesl 0.7.24 → 0.7.25
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/README.md +1 -1
- package/dist/index.d.ts +3 -1
- package/package.json +3 -4
- package/src/Linker.ts +11 -0
package/README.md
CHANGED
|
@@ -41,5 +41,5 @@ fn random_color(uv: vec2u) -> vec3f {
|
|
|
41
41
|
</pre>
|
|
42
42
|
|
|
43
43
|
[wesl plugin]: https://www.npmjs.com/package/wesl-plugin
|
|
44
|
-
[examples]: https://github.com/wgsl-tooling-wg/wesl-js/tree/main/
|
|
44
|
+
[examples]: https://github.com/wgsl-tooling-wg/wesl-js/tree/main/examples
|
|
45
45
|
[wesl]: https://www.npmjs.com/package/wesl
|
package/dist/index.d.ts
CHANGED
|
@@ -887,6 +887,8 @@ interface LinkParams {
|
|
|
887
887
|
/** function to construct globally unique wgsl identifiers */
|
|
888
888
|
mangler?: ManglerFn;
|
|
889
889
|
}
|
|
890
|
+
/** Project config for web components and tools. */
|
|
891
|
+
type WeslProject = Pick<LinkParams, "weslSrc" | "rootModuleName" | "conditions" | "constants" | "libs" | "packageName">;
|
|
890
892
|
/** Generate a virtual WESL module based on a set of conditions. */
|
|
891
893
|
type VirtualLibraryFn = (conditions: Conditions) => string;
|
|
892
894
|
/**
|
|
@@ -1282,4 +1284,4 @@ declare function offsetToLineNumber(offset: number, text: string): [lineNum: num
|
|
|
1282
1284
|
*/
|
|
1283
1285
|
declare function errorHighlight(source: string, span: Span): [string, string];
|
|
1284
1286
|
//#endregion
|
|
1285
|
-
export { AbstractElem, AbstractElemBase, AliasElem, Attribute, AttributeElem, BatchModuleResolver, BinaryExpression, BinaryOperator, BindIdentsParams, BindResults, BindingAST, BindingStructElem, BlockStatement, BoundAndTransformed, BuiltinAttribute, BundleResolver, ComponentExpression, ComponentMemberExpression, CompositeResolver, ConditionalAttribute, Conditions, ConstAssertElem, ConstElem, ContainerElem, ContinuingElem, DeclIdent, DeclIdentElem, DeclarationElem, DiagnosticAttribute, DiagnosticDirective, DiagnosticRule, DirectiveElem, DirectiveVariant, ElemKindMap, ElemWithAttributes, ElemWithContentsBase, ElifAttribute, ElseAttribute, EmittableElem, EnableDirective, ExpressionElem, ExtendedGPUValidationError, FnElem, FnParamElem, FunctionCallExpression, GlobalDeclarationElem, GlobalVarElem, GrammarElem, HasAttributes, Ident, IfAttribute, ImportCollection, ImportElem, ImportItem, ImportSegment, ImportStatement, InterpolateAttribute, LetElem, LexicalScope, LinkConfig, LinkParams, LinkRegistryParams, LinkedWesl, LinkerTransform, Literal, LiveDecls, ManglerFn, ModuleElem, ModuleResolver, NameElem, OpenElem, OverrideElem, ParenthesizedExpression, ParseError, type ParseOptions, PartialScope, RecordResolver, RecordResolverOptions, RefIdent, RefIdentElem, RequiresDirective, Scope, ScopeItem, SimpleMemberRef, Span, SrcMap, SrcMapBuilder, SrcMapEntry, SrcModule, SrcPosition, SrcWithPath, StableState, StandardAttribute, StatementElem, StructElem, StructMemberElem, StuffElem, SwitchClauseElem, SyntheticElem, TerminalElem, TextElem, TrackingResolver, TransformedAST, TranslateTimeExpressionElem, TypeRefElem, TypeTemplateParameter, TypedDeclElem, UnaryExpression, UnaryOperator, UnboundRef, UnknownExpressionElem, VarElem, VirtualLibrary, VirtualLibraryFn, VirtualLibrarySet, WeslAST, WeslBundle, WeslDevice, WeslGPUCompilationInfo, WeslGPUCompilationMessage, WeslJsPlugin, WeslParseContext, WeslParseError, WeslParseState, WeslStream, _linkSync, astToString, attributeToString, bindAndTransform, bindIdents, bindIdentsRecursive, bindingStructsPlugin, childIdent, childScope, containsScope, debug, debugContentsToString, discoverModules, emptyScope, errorHighlight, fileToModulePath, filterMap, filterValidElements, findAllRootDecls, findMap, findRefsToBindingStructs, findUnboundIdents, findUnboundRefs, findValidRootDecls, flatImports, freshResolver, groupBy, grouped, identToString, last, lengthPrefixMangle, link, linkRegistry, liveDeclsToString, log, lowerBindingStructs, makeLiveDecls, makeWeslDevice, mapForward, mapValues, markBindingStructs, markEntryTypes, mergeScope, minimalMangle, minimallyMangledName, modulePartsToRelativePath, moduleToRelativePath, multiKeySet, multisampledTextureTypes, nextIdentId, noSuffix, normalize, normalizeDebugRoot, normalizeModuleName, npmNameVariations, offsetToLineNumber, overlapTail, parseSrcModule, partition, publicDecl, replaceWords, requestWeslDevice, resetScopeIds, resolveModulePath, sampledTextureTypes, sanitizePackageName, scan, scopeToString, scopeToStringLong, srcLog, stdEnumerant, stdEnumerants, stdFn, stdFns, stdType, stdTypes, textureStorageTypes, transformBindingReference, transformBindingStruct, underscoreMangle, validation, wgslStandardAttributes, withLoggerAsync };
|
|
1287
|
+
export { AbstractElem, AbstractElemBase, AliasElem, Attribute, AttributeElem, BatchModuleResolver, BinaryExpression, BinaryOperator, BindIdentsParams, BindResults, BindingAST, BindingStructElem, BlockStatement, BoundAndTransformed, BuiltinAttribute, BundleResolver, ComponentExpression, ComponentMemberExpression, CompositeResolver, ConditionalAttribute, Conditions, ConstAssertElem, ConstElem, ContainerElem, ContinuingElem, DeclIdent, DeclIdentElem, DeclarationElem, DiagnosticAttribute, DiagnosticDirective, DiagnosticRule, DirectiveElem, DirectiveVariant, ElemKindMap, ElemWithAttributes, ElemWithContentsBase, ElifAttribute, ElseAttribute, EmittableElem, EnableDirective, ExpressionElem, ExtendedGPUValidationError, FnElem, FnParamElem, FunctionCallExpression, GlobalDeclarationElem, GlobalVarElem, GrammarElem, HasAttributes, Ident, IfAttribute, ImportCollection, ImportElem, ImportItem, ImportSegment, ImportStatement, InterpolateAttribute, LetElem, LexicalScope, LinkConfig, LinkParams, LinkRegistryParams, LinkedWesl, LinkerTransform, Literal, LiveDecls, ManglerFn, ModuleElem, ModuleResolver, NameElem, OpenElem, OverrideElem, ParenthesizedExpression, ParseError, type ParseOptions, PartialScope, RecordResolver, RecordResolverOptions, RefIdent, RefIdentElem, RequiresDirective, Scope, ScopeItem, SimpleMemberRef, Span, SrcMap, SrcMapBuilder, SrcMapEntry, SrcModule, SrcPosition, SrcWithPath, StableState, StandardAttribute, StatementElem, StructElem, StructMemberElem, StuffElem, SwitchClauseElem, SyntheticElem, TerminalElem, TextElem, TrackingResolver, TransformedAST, TranslateTimeExpressionElem, TypeRefElem, TypeTemplateParameter, TypedDeclElem, UnaryExpression, UnaryOperator, UnboundRef, UnknownExpressionElem, VarElem, VirtualLibrary, VirtualLibraryFn, VirtualLibrarySet, WeslAST, WeslBundle, WeslDevice, WeslGPUCompilationInfo, WeslGPUCompilationMessage, WeslJsPlugin, WeslParseContext, WeslParseError, WeslParseState, WeslProject, WeslStream, _linkSync, astToString, attributeToString, bindAndTransform, bindIdents, bindIdentsRecursive, bindingStructsPlugin, childIdent, childScope, containsScope, debug, debugContentsToString, discoverModules, emptyScope, errorHighlight, fileToModulePath, filterMap, filterValidElements, findAllRootDecls, findMap, findRefsToBindingStructs, findUnboundIdents, findUnboundRefs, findValidRootDecls, flatImports, freshResolver, groupBy, grouped, identToString, last, lengthPrefixMangle, link, linkRegistry, liveDeclsToString, log, lowerBindingStructs, makeLiveDecls, makeWeslDevice, mapForward, mapValues, markBindingStructs, markEntryTypes, mergeScope, minimalMangle, minimallyMangledName, modulePartsToRelativePath, moduleToRelativePath, multiKeySet, multisampledTextureTypes, nextIdentId, noSuffix, normalize, normalizeDebugRoot, normalizeModuleName, npmNameVariations, offsetToLineNumber, overlapTail, parseSrcModule, partition, publicDecl, replaceWords, requestWeslDevice, resetScopeIds, resolveModulePath, sampledTextureTypes, sanitizePackageName, scan, scopeToString, scopeToStringLong, srcLog, stdEnumerant, stdEnumerants, stdFn, stdFns, stdType, stdTypes, textureStorageTypes, transformBindingReference, transformBindingStruct, underscoreMangle, validation, wgslStandardAttributes, withLoggerAsync };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wesl",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.25",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -23,8 +23,7 @@
|
|
|
23
23
|
"multi_pkg": "x",
|
|
24
24
|
"terser": "^5.43.1",
|
|
25
25
|
"typedoc": "^0.28.7",
|
|
26
|
-
"typedoc-theme-hierarchy": "^6.0.0"
|
|
27
|
-
"wrangler": "^4.22.0"
|
|
26
|
+
"typedoc-theme-hierarchy": "^6.0.0"
|
|
28
27
|
},
|
|
29
28
|
"license": "MIT",
|
|
30
29
|
"keywords": [
|
|
@@ -38,7 +37,7 @@
|
|
|
38
37
|
"build:nodebug": "vite build --config vite.nodebug.config.ts",
|
|
39
38
|
"build:size": "./scripts/size-check.ts",
|
|
40
39
|
"deploy:docsite": "run-s build:docs pages:deploy",
|
|
41
|
-
"pages:deploy": "wrangler pages deploy --project-name wesl-js docs",
|
|
40
|
+
"pages:deploy": "pnpx wrangler pages deploy --project-name wesl-js docs",
|
|
42
41
|
"test": "vitest --hideSkippedTests",
|
|
43
42
|
"test:cts": "./scripts/test-cts.ts",
|
|
44
43
|
"test:nodebug": "vitest run --config vitest.nodebug.config.ts",
|
package/src/Linker.ts
CHANGED
|
@@ -91,6 +91,17 @@ export interface LinkParams {
|
|
|
91
91
|
mangler?: ManglerFn;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
/** Project config for web components and tools. */
|
|
95
|
+
export type WeslProject = Pick<
|
|
96
|
+
LinkParams,
|
|
97
|
+
| "weslSrc"
|
|
98
|
+
| "rootModuleName"
|
|
99
|
+
| "conditions"
|
|
100
|
+
| "constants"
|
|
101
|
+
| "libs"
|
|
102
|
+
| "packageName"
|
|
103
|
+
>;
|
|
104
|
+
|
|
94
105
|
/** Generate a virtual WESL module based on a set of conditions. */
|
|
95
106
|
export type VirtualLibraryFn = (conditions: Conditions) => string;
|
|
96
107
|
|