UNPKG

everything-dev

Version:

A consolidated product package for building Module Federation apps with oRPC APIs.

1 lines • 1.69 kB
{"version":3,"file":"workspace-subtree.cjs","names":["lstatSync","join"],"sources":["../../src/utils/workspace-subtree.ts"],"sourcesContent":["import { lstatSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { glob } from \"glob\";\n\n/**\n * The ignore set both sides of a source handoff agree on: `bos import`\n * classifies files under it, and source archives published by the deploy\n * train (#406) exclude it — so an imported archive never smuggles in\n * build output, VCS state, or local .bos state. Keep this list in sync\n * with nothing else: it is the single source of truth.\n */\nexport const WORKSPACE_SUBTREE_IGNORE = [\n \"**/node_modules/**\",\n \"**/.git/**\",\n \"**/dist/**\",\n \"**/.bos/**\",\n \"**/.every-plugin/**\",\n];\n\n/** Sorted, file-only list of the workspace subtree at `root`, under the shared ignore set. */\nexport async function listWorkspaceSubtreeFiles(\n root: string,\n workspace: string,\n): Promise<string[]> {\n const matches = await glob(`${workspace}/**`, {\n cwd: root,\n nodir: true,\n dot: true,\n absolute: false,\n ignore: WORKSPACE_SUBTREE_IGNORE,\n });\n const files: string[] = [];\n for (const match of matches) {\n if (lstatSync(join(root, match)).isFile()) {\n files.push(match);\n }\n }\n return files.sort();\n}\n"],"mappings":";;;;;;;;;;;;AAWA,MAAa,2BAA2B;CACtC;CACA;CACA;CACA;CACA;AACF;;AAGA,eAAsB,0BACpB,MACA,WACmB;CACnB,MAAM,UAAU,UAAM,WAAK,GAAG,UAAU,MAAM;EAC5C,KAAK;EACL,OAAO;EACP,KAAK;EACL,UAAU;EACV,QAAQ;CACV,CAAC;CACD,MAAM,QAAkB,CAAC;CACzB,KAAK,MAAM,SAAS,SAClB,QAAIA,uBAAUC,gBAAK,MAAM,KAAK,CAAC,CAAC,CAAC,OAAO,GACtC,MAAM,KAAK,KAAK;CAGpB,OAAO,MAAM,KAAK;AACpB"}