Files
gui/pkgs/build/externalNodePlugin.js
zeekay 6d0dd44bfd chore: flatten pkgs/packages/* → pkgs/* (one canonical pkgs dir)
ONE WAY ONLY: 'pkgs' is the canonical name for any directory holding
packages. The redundant 'pkgs/packages/' sub-level is dropped — every
package now lives at pkgs/<name>/ (with categorical sub-groups
pkgs/compiler/, pkgs/core/, pkgs/ui/ unchanged since they are
sub-systems, not just 'packages').

- mv pkgs/packages/* → pkgs/* (24 packages)
- rm pkgs/packages/hanzogui-dev-config (orphan: only had dist/ artifacts,
  no source; gui-dev-config is the canonical @hanzogui/dev-config)
- package.json workspaces: drop pkgs/packages glob, add ./pkgs/*
- tsconfig.json: rewrite paths + 15 references entries
- apps/{demos,kitchen-sink,gui.hanzo.ai}/tsconfig.json: reference paths
- .github/workflows/publish-gui.yml: directory walk list
- pkgs/{get,recipes}/package.json: repository.directory

bun.lock will regenerate on next install.
2026-05-27 17:33:42 -07:00

30 lines
812 B
JavaScript

// Must not start with "/" or "./" or "../"
const NON_NODE_MODULE_RE = /^[^./]|^\.[^./]|^\.\.[^/]/
module.exports = ({ patterns, skipNodeModulesBundle, disabled }) => {
return {
name: `external`,
setup(build) {
if (disabled) return
if (skipNodeModulesBundle) {
build.onResolve({ filter: NON_NODE_MODULE_RE }, (args) => ({
path: args.path,
external: true,
}))
}
if (!patterns || patterns.length === 0) return
build.onResolve({ filter: /.*/ }, (args) => {
const external = patterns.some((p) => {
if (p instanceof RegExp) {
return p.test(args.path)
}
return args.path === p
})
if (external) {
return { path: args.path, external }
}
})
},
}
}