@stack-scribe/icon-pack-aws
v0.3.0
Published
First-party AWS icon pack for stack-scribe
Readme
@stack-scribe/icon-pack-aws
@stack-scribe/icon-pack-aws is the first-party AWS icon pack for Stack Scribe. It provides the AWS icon catalog, shorthand alias resolution, group icon mappings, browser-safe icon resolvers, and Node filesystem-backed icon loading.
Use it with @stack-scribe/core when you want canonical AWS node types, shorthand inputs such as lambda and s3-bucket, and bundled AWS SVG assets.
Install
npm install @stack-scribe/core @stack-scribe/icon-pack-awsWhat It Provides
- The
awsIconPackdefinition for Stack Scribe icon registries - Alias normalization and canonical type resolution for AWS node types
- A browser-safe icon resolver via
@stack-scribe/icon-pack-aws/browser - A Node filesystem-backed icon resolver via
@stack-scribe/icon-pack-aws/node - Catalog exports for AWS node types and icon asset paths
Registry Example
import { createIconRegistry } from "@stack-scribe/core";
import {
awsIconPack,
listAwsNodeTypeAliases,
resolveAwsNodeType,
} from "@stack-scribe/icon-pack-aws";
const registry = createIconRegistry([awsIconPack]);
console.log(resolveAwsNodeType("lambda"));
console.log(listAwsNodeTypeAliases().slice(0, 5));
console.log(registry.resolveType("s3-bucket"));Browser Usage
Use the browser subpath when rendering inside a browser bundle.
import { renderDiagramFromInput } from "@stack-scribe/core";
import { awsBrowserRenderOptions } from "@stack-scribe/icon-pack-aws/browser";
const rendered = await renderDiagramFromInput(
{
nodes: [
{ id: "api", type: "aws.networking-content-delivery.api-gateway" },
{ id: "fn", type: "lambda" },
],
edges: [{ from: "api", to: "fn" }],
},
awsBrowserRenderOptions,
);
console.log(rendered.svg);awsBrowserRenderOptions supplies a trusted browser icon resolver for Stack Scribe rendering.
Node Usage
Use the Node subpath when you need filesystem-backed icon loading or direct access to the packaged SVG assets.
import { createIconRegistry } from "@stack-scribe/core";
import { awsIconPack } from "@stack-scribe/icon-pack-aws";
import {
createAwsIconResolver,
getAwsIcon,
getAwsIconPath,
getAwsIconsDirectory,
} from "@stack-scribe/icon-pack-aws/node";
const iconRegistry = createIconRegistry([awsIconPack]);
const iconResolver = createAwsIconResolver();
console.log(Boolean(iconRegistry.resolveType("cloudfront")));
console.log(getAwsIconPath("aws.compute.lambda"));
console.log(getAwsIconsDirectory());
console.log(getAwsIcon("s3-bucket").includes("<svg"));
console.log(Boolean(iconResolver));Public Exports
From @stack-scribe/icon-pack-aws:
awsIconPackcreateAwsIconRegistry()AwsNodeTypeSchemaawsNodeTypeToIconawsGroupIconDefinitionslistAwsNodeTypeAliases()normalizeAwsNodeTypeInput()resolveAwsNodeType()
From @stack-scribe/icon-pack-aws/browser:
createAwsBrowserIconAssetLoader()createAwsBrowserIconResolver()awsBrowserIconResolverawsBrowserRenderOptions
From @stack-scribe/icon-pack-aws/node:
createAwsIconAssetLoader()createAwsIconResolver()getAwsIconsDirectory()getAwsIconPath()andgetAwsGroupIconPath()getAwsIcon()andgetAwsGroupIcon()clearAwsIconCache()fallbackIconSvg
From @stack-scribe/icon-pack-aws/catalog:
NodeTypeSchemanodeTypeToIcon
Notes
- The package ships the AWS SVG assets alongside the package files.
- Root exports stay browser-safe; Node filesystem access lives under the
./nodesubpath. - Alias resolution is explicit and supports common shorthand inputs used by Stack Scribe tooling.
