Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
47a4e37
feat: characterize petrinaut build output
lunelson May 5, 2026
c253325
test: characterize petrinaut provider lifecycles
lunelson May 6, 2026
2b91696
fix: encode petrinaut package boundary
lunelson May 6, 2026
2895011
fix: emit petrinaut workers as assets
lunelson May 6, 2026
7542b42
fix: narrow petrinaut react compiler transform
lunelson May 6, 2026
4215c86
fix: lazy load petrinaut graph layout
lunelson May 6, 2026
b550252
fix: lazy load petrinaut visualizer compiler
lunelson May 6, 2026
4020430
fix: lazy load petrinaut timeline chart
lunelson May 6, 2026
ea1faf9
fix: lazy initialize petrinaut simulation worker
lunelson May 6, 2026
f5b3c65
docs: record petrinaut simulation worker slice
lunelson May 6, 2026
4d13fde
fix: lazy initialize petrinaut language worker
lunelson May 6, 2026
6c6923d
docs: record petrinaut language worker slice
lunelson May 6, 2026
5ed3f91
fix: lazy initialize petrinaut monaco
lunelson May 6, 2026
335a058
docs: record petrinaut monaco slice
lunelson May 6, 2026
781d48a
fix: lazy load petrinaut examples
lunelson May 6, 2026
57810eb
docs: record petrinaut examples slice
lunelson May 6, 2026
a3240c4
fix: decouple petrinaut bundled fonts
lunelson May 6, 2026
a6bce72
docs: record petrinaut font slice
lunelson May 6, 2026
8306f1f
fix: split petrinaut panda scanning
lunelson May 6, 2026
781c66d
docs: record petrinaut panda slice
lunelson May 6, 2026
4dd52cb
fix: consume prebuilt petrinaut in frontend
lunelson May 6, 2026
c66501e
docs: record petrinaut frontend consumption slice
lunelson May 6, 2026
4eafbe7
test: guard petrinaut bundle graph
lunelson May 6, 2026
5899672
docs: record petrinaut bundle guard slice
lunelson May 6, 2026
04ac9b5
docs: refresh petrinaut final refactor status
lunelson May 6, 2026
d012221
fix: support strict mode lazy workers
lunelson May 6, 2026
dfbc03e
fix: fail petrinaut bundle guard on missing entries
lunelson May 6, 2026
040a649
fix: share visualizer component type
lunelson May 6, 2026
3148923
docs: remove petrinaut refactor planning artifact
lunelson May 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apps/hash-frontend/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ export default withSentryConfig(
"@emotion/server",
"@hashintel/block-design-system",
"@hashintel/design-system",
"@hashintel/petrinaut",
"@hashintel/ds-components",
"@hashintel/ds-helpers",
"@hashintel/type-editor",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import "@hashintel/petrinaut/dist/main.css";
import "@hashintel/petrinaut/styles.css";

import type { EntityId } from "@blockprotocol/type-system";
import { AlertModal } from "@hashintel/design-system";
Expand Down
13 changes: 10 additions & 3 deletions libs/@hashintel/petrinaut/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,28 @@
],
"main": "dist/main.js",
"types": "dist/main.d.ts",
"exports": {
".": {
"types": "./dist/main.d.ts",
"import": "./dist/main.js"
},
"./styles.css": "./dist/main.css",
"./package.json": "./package.json"
},
"scripts": {
"build": "vite build",
"dev": "storybook dev",
"lint:tsc": "tsgo --noEmit",
"lint:eslint": "oxlint --type-aware --report-unused-disable-directives-severity=error .",
"fix:eslint": "oxlint --fix --type-aware --report-unused-disable-directives-severity=error .",
"prepublishOnly": "turbo run build",
"check:bundle": "node scripts/characterize-build-output.mjs --skip-build --skip-watch --guard",
"profile:build": "node scripts/characterize-build-output.mjs",
"test:unit": "vitest"
},
"dependencies": {
"@ark-ui/react": "5.26.2",
"@babel/standalone": "7.28.5",
"@fontsource-variable/inter": "5.2.8",
"@fontsource-variable/inter-tight": "5.2.7",
"@fontsource-variable/jetbrains-mono": "5.2.8",
"@hashintel/ds-components": "workspace:^",
"@hashintel/ds-helpers": "workspace:^",
"@hashintel/refractive": "workspace:^",
Expand Down
13 changes: 12 additions & 1 deletion libs/@hashintel/petrinaut/panda.config.shared.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,25 @@ describe("resolveDsComponentsBuildInfoPath", () => {
});

describe("createPetrinautPandaConfig", () => {
it("includes the shipped build-info file instead of ds-components source globs", () => {
it("includes library source and shipped build-info without Storybook globs", () => {
const config = createPetrinautPandaConfig(
"/virtual/ds-components/panda.buildinfo.json",
);

expect(config.include).toContain("./src/**/*.{js,jsx,ts,tsx}");
expect(config.include).toContain(
"/virtual/ds-components/panda.buildinfo.json",
);
expect(config.include).not.toContain("./.storybook/**/*.{js,jsx,ts,tsx}");
expect(config.include).not.toContain("../ds-components/src/**/*.{ts,tsx}");
});

it("includes Storybook globs only for the Storybook config mode", () => {
const config = createPetrinautPandaConfig(
"/virtual/ds-components/panda.buildinfo.json",
{ includeStorybook: true },
);

expect(config.include).toContain("./.storybook/**/*.{js,jsx,ts,tsx}");
});
});
17 changes: 13 additions & 4 deletions libs/@hashintel/petrinaut/panda.config.shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ import { createRequire } from "node:module";
import { defineConfig } from "@pandacss/dev";
import { scopedThemeConfig } from "@hashintel/ds-components/preset";

import { CODE_FONT_FAMILY } from "./src/constants/ui";

export const DS_COMPONENTS_BUILD_INFO_SUBPATH =
"@hashintel/ds-components/panda.buildinfo.json";

const CODE_FONT_FAMILY = "'JetBrains Mono Variable', monospace";

type PetrinautPandaConfigOptions = {
includeStorybook?: boolean;
};

export const createNodeSpecifierResolver = (moduleLocation: string | URL) => {
const require = createRequire(moduleLocation);

Expand All @@ -18,14 +22,19 @@ export const resolveDsComponentsBuildInfoPath = (
resolve: (specifier: string) => string,
) => resolve(DS_COMPONENTS_BUILD_INFO_SUBPATH);

export const createPetrinautPandaConfig = (dsComponentsBuildInfoPath: string) =>
export const createPetrinautPandaConfig = (
dsComponentsBuildInfoPath: string,
options: PetrinautPandaConfigOptions = {},
) =>
defineConfig({
...scopedThemeConfig(".petrinaut-root"),

include: [
"./src/**/*.{js,jsx,ts,tsx}",
dsComponentsBuildInfoPath,
"./.storybook/**/*.{js,jsx,ts,tsx}",
...(options.includeStorybook
? ["./.storybook/**/*.{js,jsx,ts,tsx}"]
: []),
],

exclude: [],
Expand Down
13 changes: 13 additions & 0 deletions libs/@hashintel/petrinaut/panda.storybook.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {
createNodeSpecifierResolver,
createPetrinautPandaConfig,
resolveDsComponentsBuildInfoPath,
} from "./panda.config.shared";

export default createPetrinautPandaConfig(
resolveDsComponentsBuildInfoPath(
/** Panda evaluates this config through CJS, so `__filename` is available here. */
createNodeSpecifierResolver(__filename),
),
{ includeStorybook: true },
);
6 changes: 5 additions & 1 deletion libs/@hashintel/petrinaut/postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
const isStorybook = process.env.npm_lifecycle_event === "dev";

module.exports = {
plugins: {
"@pandacss/dev/postcss": {},
"@pandacss/dev/postcss": {
configPath: isStorybook ? "panda.storybook.config.ts" : "panda.config.ts",
},
},
};
Loading
Loading