diff --git a/.release-plan.json b/.release-plan.json index fd4614e..a804b97 100644 --- a/.release-plan.json +++ b/.release-plan.json @@ -2,8 +2,8 @@ "solution": { "@starbeam-dev/compile": { "impact": "minor", - "oldVersion": "1.0.2", - "newVersion": "1.1.0", + "oldVersion": "1.2.0", + "newVersion": "1.3.0", "constraints": [ { "impact": "minor", @@ -17,5 +17,5 @@ "pkgJSONPath": "./package.json" } }, - "description": "## Release (2024-01-06)\n\n@starbeam-dev/compile 1.1.0 (minor)\n\n#### :rocket: Enhancement\n* `@starbeam-dev/compile`\n * [#1](https://github.com/starbeamjs/dev-compile/pull/1) Add copy plugin for root CHANGELOG ([@NullVoxPopuli](https://github.com/NullVoxPopuli))\n\n#### :house: Internal\n* `@starbeam-dev/compile`\n * [#2](https://github.com/starbeamjs/dev-compile/pull/2) The published version is 1.0.2, not 1.0.1 ([@NullVoxPopuli](https://github.com/NullVoxPopuli))\n * [#3](https://github.com/starbeamjs/dev-compile/pull/3) Setup release plan ([@NullVoxPopuli](https://github.com/NullVoxPopuli))\n\n#### Committers: 1\n- [@NullVoxPopuli](https://github.com/NullVoxPopuli)\n" + "description": "## Release (2024-01-12)\n\n@starbeam-dev/compile 1.3.0 (minor)\n\n#### :rocket: Enhancement\n* `@starbeam-dev/compile`\n * [#5](https://github.com/starbeamjs/dev-compile/pull/5) Make starbeam smaller / faster ([@NullVoxPopuli](https://github.com/NullVoxPopuli))\n\n#### :house: Internal\n* `@starbeam-dev/compile`\n * [#6](https://github.com/starbeamjs/dev-compile/pull/6) Prepare Release ([@github-actions[bot]](https://github.com/apps/github-actions))\n\n#### Committers: 2\n- [@NullVoxPopuli](https://github.com/NullVoxPopuli)\n- [@github-actions[bot]](https://github.com/apps/github-actions)\n" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e522d6..7227f17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,29 @@ # Changelog +## Release (2024-01-12) + +@starbeam-dev/compile 1.3.0 (minor) + +#### :rocket: Enhancement +* `@starbeam-dev/compile` + * [#5](https://github.com/starbeamjs/dev-compile/pull/5) Make starbeam smaller / faster ([@NullVoxPopuli](https://github.com/NullVoxPopuli)) + +#### :house: Internal +* `@starbeam-dev/compile` + * [#6](https://github.com/starbeamjs/dev-compile/pull/6) Prepare Release ([@github-actions[bot]](https://github.com/apps/github-actions)) + +#### Committers: 2 +- [@NullVoxPopuli](https://github.com/NullVoxPopuli) +- [@github-actions[bot]](https://github.com/apps/github-actions) +## Release (2024-01-12) + +@starbeam-dev/compile 1.2.0 (minor) + +#### :rocket: Enhancement +* `@starbeam-dev/compile` + * [#5](https://github.com/starbeamjs/dev-compile/pull/5) Make starbeam smaller / faster ([@NullVoxPopuli](https://github.com/NullVoxPopuli)) + +#### Committers: 1 +- [@NullVoxPopuli](https://github.com/NullVoxPopuli) ## Release (2024-01-06) @starbeam-dev/compile 1.1.0 (minor) diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 7de43a5..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { RollupOptions } from "rollup"; -import { Plugin as RollupPlugin } from "rollup"; -declare const _default: (mode?: string) => RollupPlugin; -declare const _default: () => RollupPlugin; -interface CompileOptions { - /** - * Copy the changelog from the root of the monorepo. - * true by default - */ - copyRootChangelog?: boolean; -} -declare function compile(here: ImportMeta | string, options?: CompileOptions): RollupOptions[]; -export { _default as importMeta, _default as inline, compile }; diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index 31067c4..0000000 --- a/dist/index.js +++ /dev/null @@ -1,739 +0,0 @@ -import { readFileSync } from 'node:fs'; -import { execSync } from 'node:child_process'; -import { join, resolve } from 'node:path'; -import terser from '@rollup/plugin-terser'; -import { Package, rootAt } from '@starbeam-dev/core'; -import copy from 'rollup-plugin-copy'; -import 'typescript'; -import { createRequire } from 'node:module'; -import { getTsconfig } from 'get-tsconfig'; - -// originally from: https://github.com/vitejs/vite/blob/51e9c83458e30e3ce70abead14e02a7b353322d9/src/node/build/buildPluginReplace.ts -const { default: MagicString } = await import('magic-string'); -/** @typedef {import("rollup").TransformResult} TransformResult */ /** @typedef {import("rollup").Plugin} RollupPlugin */ /** - * Replace literal strings in code with specified replacements with sourcemap - * support. - * - * Example rollup config: - * - * ```js - * import { replace } from "@starbeam-dev/compile"; - * - * export default { - * // ... - * plugins: [ - * replace({ "import.meta.hello": `"world"` }) - * ] - * }; - * ``` - * - * This will replace any instances of `import.meta.hello` in source modules with - * the content `"world"`. - * - * The main purpose of this plugin is to replace dynamic variables with - * build-time constant values, which can then be further processed by a - * minification pass. - * - * For example, the `importMeta` plugin replaces `import.meta.env.DEV` with - * `true` in development mode and `false` in production mode. In production, - * source code guarded with `if (import.meta.env.DEV)` will be emitted as `if - * (false)`. The subsequent minification pass will remove the entire `if` block, - * including its contents. - * - * @param {(id: string) => boolean} test - * @param {Record} replacements @param {boolean} sourcemap - * - * @returns {RollupPlugin} - */ function createReplacePlugin(test, replacements, sourcemap) { - const pattern = new RegExp("\\b(" + Object.keys(replacements).map((str)=>{ - return str.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&"); - }).join("|") + ")\\b", "g"); - return { - name: "starbeam:replace", - transform (code, id) { - if (test(id)) { - const s = new MagicString(code); - let hasReplaced = false; - let match; - while(match = pattern.exec(code)){ - hasReplaced = true; - const start = match.index; - const [wholeMatch, partialMatch] = match; - const end = start + wholeMatch.length; - const replacement = replacements[partialMatch]; - if (replacement === undefined) { - throw new Error(`Unexpected missing replacement for "${partialMatch}".\n\nReplacements were ${JSON.stringify(replacements, null, STRINGIFY_SPACES)}`); - } - s.overwrite(start, end, replacement); - } - if (!hasReplaced) { - return null; - } - /** @type {TransformResult} */ const result = { - code: s.toString() - }; - if (sourcemap) { - result.map = s.generateMap({ - hires: true - }); - } - return result; - } - } - }; -} -const STRINGIFY_SPACES = 2; - -/** - * Replaces `import.meta` environment annotations with constants depending on - * the specified mode. - * - * If no mode is specified, the mode defaults to `process.env["MODE"]`. If - * `process.env["MODE"]` is not set, the mode defaults to `"development"`. - * - * If you want to control this plugin without relying on ambient environment - * variables, you should specify the mode explicitly. - * - * Replacements: - * - * | source | replacement rule | - * | ---------------------- | ------------------------------------------------ | - * | `import.meta.env.MODE` | the specified mode (string) | - * | `import.meta.env.DEV` | true if the mode is "development" (boolean) | - * | `import.meta.env.PROD` | true if the mode is "production" (boolean) | - * - * It is possible for both `DEV` and `PROD` to be false (if the specified mode - * is something other than `"development"` or `"production"`). In general, this - * is not recommended when using this plugin. - */ var importMeta = ((mode = process.env["MODE"] ?? "development")=>{ - const DEV = mode === "development"; - const PROD = mode === "production"; - const STARBEAM_TRACE = process.env["STARBEAM_TRACE"] ?? false; - return createReplacePlugin((id)=>/\.(j|t)sx?$/.test(id), { - // remove inline testing - "import.meta.vitest": "false", - // env - "import.meta.env.MODE": mode, - "import.meta.env.DEV": DEV ? "true" : "false", - "import.meta.env.PROD": PROD ? "true" : "false", - "import.meta.env.STARBEAM_TRACE": STARBEAM_TRACE ? "true" : "false" - }, true); -}); - -const INLINE_PREFIX = "\0inline:"; -/** - * Inlines any imports that end in `?inline` into the importing module as a - * string. - * - * This adds Vite's `?inline` feature to standalone rollup builds. - */ var inline = (()=>{ - return { - name: "inline", - async resolveId (source, importer, options) { - const path = removeTrailing(source, "?inline"); - if (path) { - const resolved = await this.resolve(path, importer, options); - if (resolved && !resolved.external) { - await this.load(resolved); - return INLINE_PREFIX + resolved.id; - } - } - }, - async load (id) { - if (id.startsWith(INLINE_PREFIX)) { - const path = id.slice(INLINE_PREFIX.length); - const code = readFileSync(path, "utf8"); - return Promise.resolve({ - code: `export default ${JSON.stringify(code)};` - }); - } - } - }; -}); -const FIRST_CHAR = 0; -function removeTrailing(source, trailing) { - if (source.endsWith(trailing)) { - return source.slice(FIRST_CHAR, -trailing.length); - } -} - -/** - * The package should be inlined into the output. In this situation, the `external` function should - * return `false`. This is the default behavior. - */ const INLINE = false; -/** - * The package should be treated as an external dependency. In this situation, the `external` function - * should return `true`. This is unusual and should be used when: - * - * - The package is a "helper library" (such as tslib) that we don't want to make a real dependency - * of the published package. - * - (for now) The package doesn't have good support for ESM (i.e. `type: module` in package.json) - * but rollup will handle it for us. - */ const EXTERNAL = true; - -/** - * @typedef {import("#core").PackageInfo} PackageInfo - */ /** - * A plugin that applies the default starbeam-dev externals rules to the builds - * for the specified package. - * - * When an import is "external", it is left as-is in the built package. When an - * import is "inline", it is combined with the built package's main file and - * further optimized. - * - * In general, it's better to inline an import if any of the following are true: - * - * 1. It is only used by this package. - * 2. Its exports are easy to optimize by a minifier in production builds (e.g. - * exports that are simple functions that have no behavior or simply return - * its argument). Functions that use `import.meta.env.DEV` guards around - * behavior that would be tricky to optimize are still good candidates for - * inlining. - * 3. More generally, when inlining the import in production mode is likely to - * save more bytes than the bytes lost due to duplication. - * - * ## Rules - * - * 1. Relative imports: If the import starts with a `.`, then it is an inline - * import. - * 2. Custom rules: If the `starbeam:inline` key in `package.json` specifies a - * rule for a dependency, use it. You can use custom rules to override any of - * the default rules below. - * 3. [TODO] Custom workspace rules: If the `starbeam:inline` key in the - * `package.json` for the workspace root specifies a rule for a dependency, - * use it. - * 4. Helper libraries: If the import is one of the well-known helper libraries, - * then it is an inline import. - * 5. Absolute imports: If the import starts with `/`, then it is an inline - * import. This is because absolute imports are usually relative imports - * previously resolved by the build process. In general, you should not use - * absolute imports in your source code when using this plugin (and probably - * in general). - * 6. Import map imports: If the import starts with `#`, then it is an inline - * import. Since import-map imports typically resolve to relative imports, - * the current behavior is to inline them. - * 7. If the `starbeam:external` key in `package.json` specifies a rule for a - * dependency, use it. - * - * It would probably be more correct to attempt to resolve import map imports - * and then apply the rules above to the resolved imports. Please file an issue - * describing your situation if you need this. - * - * ## Well-Known Helper Libraries - * - * - `@babel/runtime/*` - * - `tslib` - * - `@swc/core` - * - * ## Manifest Rules (`starbeam:external` keys) - * - * The `starbeam:inline` key is either an array of rules or a rules object. - * - * ### Rule Pattern - * - * A rule pattern is a string, one of the following: - * - * - The name of a package listed in the `dependencies` or - * `optionalDependencies` field of the `package.json` file - * - A pattern that ends in a `*` (e.g. `@starbeam/*`) and matches the name of - * at least one package listed in the `dependencies` or - * `optionalDependencies`. The `*` matches one or more characters that are - * valid as part of an npm package name. - * - The special pattern `(helpers)`. This matches all of the well-known helper - * libraries. - * - * ### Rules Array - * - * The easiest way to specify inlining rules is by specifying an array of - * patterns. - * - * Example: - * - * ```json - * { - * "dependencies": { - * "react": "^18.2.0", - * "lodash": "^4.17.21" - * }, - * - * "starbeam:inline": ["lodash"] - * } - * ``` - * - * Any patterns in the array will be configured to be inlined. These patterns - * supersede the default behavior. - * - * ### Rules Object - * - * Each key in the object is a rule pattern, and the value is either "inline" or - * "external". - * - * Example: - * - * ```json - * { - * "dependencies": { - * "react": "^18.2.0", - * "lodash": "^4.17.21" - * }, - * - * "starbeam:inline": { - * "loadash": "inline" - * } - * } - * ``` - * - * In this example, the `react` dependency is externalized, and the `lodash` - * dependency is inlined. - * - * The default behavior is to externalize all dependencies, so you don't need to - * specify "external" in a rules object unless you want to supersede a later - * rule. - * - * Example: - * - * ```json - * { - * "dependencies": { - * "react": "^18.2.0", - * "lodash.map": "^4.17.21", - * "lodash.merge": "^4.17.21" - * "lodash.flat-map": "^4.17.21" - * }, - * - * "starbeam:inline": { - * "lodash.merge": "external", - * "lodash.*": "inline" - * } - * } - * ``` - * - * In this example, `react` and `lodash.merge` are externalized, and - * `lodash.map` and `lodash.flat-map` are inlined. - * - * ### Rule Objects in a Rules Array - * - * When you have a lot of inline rules and only a handful of externals - * overrides, it's nice to be able to avoid repeating `: "inline"` over and over - * again. - * - * In this situation, you can include rule objects in a rules array. - * - * Example: - * - * Instead of this: - * - * ```json - * "starbeam:inline": { - * "lodash.merge": "external", - * "lodash.*": "inline" - * } - * ``` - * - * You can do this: - * - * ```json - * "starbeam:inline": [ - * { "lodash.merge": "external" }, - * "lodash.*" - * ] - * ``` - * - * ## Matching Order for Custom Rules - * - * Custom rules are matched in the order they are listed in the - * `starbeam:external` key. - * - * Earlier rules in the rule array take precedence over later rules. Earlier - * rules in an rules object take precedence over later rules in the same rule - * object. - * - * ## Development and Peer Dependencies - * - * Since development dependencies are not intended to be used at runtime, they - * should never be imported from runtime code, and therefore should never be - * included in the build. - * - * Since peer dependencies are intended to be supplied by a dependent package - * (i.e. the package including the package you are building), they are always - * external and should not be listed in the `starbeam:external` key. - * - * @param {PackageInfo} pkg - * @returns {import("rollup").Plugin} - */ function externals(pkg) { - const isExternal = external(pkg); - return { - name: "starbeam:externals", - resolveId (id) { - if (isExternal(id)) { - return { - id, - external: true - }; - } - } - }; -} -/** - * @param {PackageInfo} pkg - * @returns - */ function external(pkg) { - /** - * @param {string} id - * @returns {boolean} - */ return (id)=>{ - // Inline relative modules. - if (id.startsWith(".")) { - return INLINE; - } - // Resolve custom rules. These rules include the default behavior of - // well-known helper libraries. - for (const rule of pkg.starbeam.inline){ - const isExternal = resolveIsExternal(rule, id); - if (isExternal !== undefined) return isExternal; - } - // Allow custom rules to override the default behavior - // of `#` and `/` dependencies. - if (id.startsWith("#") || id.startsWith("/")) { - return INLINE; - } - const strictExternals = pkg.starbeam.strict.externals; - if (strictExternals !== "allow") { - const message = [ - `The external dependency ${id} is included in your compiled output. This means that your compiled output will contain a runtime import of that package.`, - `This is the default behavior of starbeam-dev, but you did not specify an inline rule for ${id}, and there is no built-in rule that applies to ${id}.` - ]; - if (strictExternals === "error") { - const error = [ - `Unexpected external dependency: ${id}.`, - ...message, - `This is an error because you are in strict externals mode (${strictExternals}), as specified in "starbeam:strict" in your package.json at:\n ${join(pkg.root, "package.json")})` - ].join("\n\n"); - throw Error(error); - } else { - console.warn([ - ...message, - `This message appears because you are in strict externals mode (${strictExternals}), as specified in "starbeam:strict" in your package.json at:\n ${join(pkg.root, "package.json")})` - ].join("\n")); - } - } - return true; - }; -} -function resolveIsExternal(option, id) { - return findExternalFn(option)(id); - /** - * @param {import("#core").NormalizedExternalOption} option - * @returns {(id: string) => import("#core").RollupExternal | undefined} - */ function findExternalFn([operator, name, config]) { - const find = operatorFn(operator); - return (id)=>find(id, name) ? fromConfig(config) : undefined; - } - /** - * @param {import("#core").ExternalConfig | undefined} config - * @returns {import("#core").RollupExternal | undefined} - */ function fromConfig(config) { - switch(config){ - case "external": - return EXTERNAL; - case "inline": - return INLINE; - case undefined: - return undefined; - } - } - function operatorFn(operator) { - switch(operator){ - case "startsWith": - return (id, key)=>id.startsWith(key); - case "is": - return (id, key)=>id === key; - } - } -} - -const require = createRequire(import.meta.url); -const rollupTS = require("rollup-plugin-ts"); -/** - * Build a library with TypeScript in the specified mode. - * - * This plugin uses swc (via `@swc/core`) to efficiently compile TypeScript to - * JavaScript. - * - * ## Assumptions - * - * You are using at least TypeScript 5.0. - * - * You are using the (large) subset of TypeScript that can be compiled by - * evaluating a single module and stripping out type-specific features. You are - * not using features of TypeScript that require multi-module analysis to - * determine how to compile a single module. - * - * - You should not use `const` enums, but if you do, they will be converted - * into normal enums. - * - All import paths that refer to non-existent JavaScript modules (type-only - * modules) are imported using `import type`. - * - All imports that do not refer to a JavaScript value are imported as part of - * an `import type` statement or are annotated with `type` (i.e. `import { - * map, type MapFn } from "map"`). - * - * ## Recommendations - * - * To ensure that your code satisfies these assumptions, we recommend the - * following tsconfig options: - * - *
- *
`verbatimModuleSyntax`: true
- *
- * You will get a TypeScript error if one of your imports is only - * used as a type but does not include the `type` specifier. - *
- *
- * - * We also recommend the use of `@typescript-eslint/consistent-type-imports` and - * `@typescript-eslint/no-import-type-side-effects`. These auto-fixable lints - * will error if you don't use `import type` on an import statement that is - * never used as a value. These lints will also ensure that any named imports - * that are only used as types are annotated with `type`. - * - * If you're using vscode, you can enable "source.fixAll" in - * `editor.codeActionOnSave` and imports will automatically be updated if you - * need to add or remove `import type`. - * - * ## Type Checking - * - * > **TL;DR** This plugin does **not** typecheck your code. It is intended to - * > be run after verifying your code using tools such as `tsc` and `eslint` and - * > after successfully running your tests. - * - * Now for the longer version... - * - * **Compiling** a library is a separate step from **verifying** the library. - * - * Conversationally, people refer to the process of verifying and compiling a - * library as "the build" (i.e. "failing the build"). - * - * This is largely an artifact of workflows in other languages, such as Java, - * C++ and Rust. In these languages, the *compiler* performs a large amount of - * verification before compilation can begin. - * - * Even in those environments, many projects perform additional verification - * steps (such as linting and testing) before creating and publishing the - * compilation artifacts. - * - * But in **our** environment, virtually the entire verification step can be - * performed before the compilation step. - * - * > Adding to the confusion, the tool that you use to *verify* your TypeScript - * > code is called `tsc`. Even more confusingly, `tsc` is intended to be a - * > good-enough reference compiler for TypeScript code. In practice, though, it - * > makes more sense to use `tsc` as part of a comprehensive *verification* - * > strategy and to use other tools (such as `esbuild` or `swc`) to compile - * > your TypeScript code. - * - * ## Verify Separately - * - * This plugin is intended to be used as part of a build process that runs the - * verification step first, and only invokes the compilation step once the - * verification step has completed. - * - * These same verification steps should run in your CI pipeline. - * - * During development, we recommend that you use the same verification tools in - * your editor, which can help developers avoid submitting pull requests that - * will fail verification. - */ function typescript(mode) { - return (pkg, config)=>{ - const { config: tsconfig } = getTsconfig(pkg.root) ?? {}; - const compilerOptions = tsconfig?.compilerOptions ?? {}; - const transform = { - treatConstEnumAsEnum: true - }; - const minify = { - format: { - comments: mode === 'production' - }, - mangle: { - toplevel: true, - properties: { - builtins: false - } - }, - module: true, - compress: { - module: true, - passes: 4, - unsafe_math: true, - unsafe_symbols: mode === "production", - hoist_funs: true, - conditionals: true, - drop_debugger: true, - evaluate: true, - reduce_vars: true, - side_effects: true, - dead_code: true, - defaults: true, - unused: true - } - }; - let jscConfig = { - transform - }; - if (mode === "production") { - jscConfig.minify = minify; - } - const fragmentFactory = compilerOptions.jsxFragmentFactory; - const jsxFactory = compilerOptions.jsxFactory; - if (fragmentFactory && jsxFactory) jscConfig = withReact(jscConfig, { - pragma: jsxFactory, - pragmaFrag: fragmentFactory - }); - const importSource = compilerOptions.jsxImportSource; - if (importSource) jscConfig = withReact(jscConfig, { - runtime: "automatic", - importSource - }); - return rollupTS({ - transpiler: "swc", - transpileOnly: true, - swcConfig: { - jsc: jscConfig - }, - tsconfig: { - ...compilerOptions, - ...config - } - }); - }; -} -function withReact(jsc, react) { - jsc.transform ??= {}; - jsc.transform.react = { - ...jsc.transform.react, - ...react - }; - return jsc; -} - -const MODES = [ - "development", - "production", - undefined -]; -function compile(here, options) { - const pkg = Package.at(here); - if (pkg === undefined) { - throw new Error(`Package not found at ${rootAt(here)}`); - } - return compilePackage(pkg, options || {}); -} -function copyRootChangelog(pkg) { - const monorepoRoot = execSync('git rev-parse --show-toplevel', { - encoding: 'utf-8', - cwd: pkg.root - }).trim(); - const rootChangelog = join(monorepoRoot, 'CHANGELOG.md'); - // this plugin does not provide types - const includeChangelog = copy({ - targets: [ - { - src: rootChangelog, - dest: '.' - } - ] - }); - return includeChangelog; -} -/** - * @param {import("@starbeam-dev/core").PackageInfo} pkg - * @param {CompileOptions} options - * @returns {import("rollup").RollupOptions[]} - */ function compilePackage(pkg, options) { - return MODES.flatMap((mode)=>{ - const PLUGINS = []; - if (mode) { - PLUGINS.push(importMeta(mode)); - } - const deps = Object.keys(pkg.dependencies); - const entries = entryPoints(pkg, mode).map((options)=>({ - ...options, - external: deps, - plugins: [ - ...PLUGINS, - externals(pkg), - typescript(mode)(pkg, { - target: "esnext", - module: "esnext", - moduleDetection: "force", - moduleResolution: "bundler", - verbatimModuleSyntax: true - }), - ...mode === 'production' ? [ - terser({ - // remove all comments - format: { - comments: false - }, - // prevent any compression - compress: false - }) - ] : [] - ] - })); - /** - * We only need to do this once, so we'll push it on the first entrypoint's rollup config - */ if (options.copyRootChangelog ?? true) { - const copyPlugin = copyRootChangelog(pkg); - // eslint-disable-next-line @typescript-eslint/no-magic-numbers - entries[0]?.plugins.push(copyPlugin); - } - return entries; - }); -} -function entryPoints(pkg, mode) { - const { root, starbeam: { entry } } = pkg; - function entryPoint([exportName, ts]) { - return { - input: resolve(root, ts), - treeshake: true, - output: { - file: filename({ - root, - name: exportName, - mode, - ext: "js" - }), - format: "esm", - sourcemap: true, - hoistTransitiveImports: false, - exports: "auto" - }, - onwarn: (warning, warn)=>{ - switch(warning.code){ - case "CIRCULAR_DEPENDENCY": - case "EMPTY_BUNDLE": - return; - default: - warn(warning); - } - } - }; - } - if (entry === undefined) { - // eslint-disable-next-line no-console - console.warn("No entry point found for package", pkg.name); - return []; - } else { - return Object.entries(entry).map(entryPoint); - } -} -function filename({ root, name, mode, ext }) { - if (mode) { - return resolve(root, "dist", `${name}.${mode}.${ext}`); - } else { - return resolve(root, "dist", `${name}.${ext}`); - } -} - -export { compile, importMeta, inline }; -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index 9a70cf0..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":["../src/rollup/plugins/replace.ts","../src/rollup/plugins/import-meta.ts","../src/rollup/plugins/inline.ts","../src/constants.ts","../src/rollup/plugins/external.ts","../src/rollup/plugins/typescript.ts","../src/rollup/rollup.ts"],"sourcesContent":["// originally from: https://github.com/vitejs/vite/blob/51e9c83458e30e3ce70abead14e02a7b353322d9/src/node/build/buildPluginReplace.ts\n\nimport type { TransformResult } from \"rollup\";\n\nimport type { RollupPlugin } from \"../utils.js\";\n\nconst { default: MagicString } = await import(\"magic-string\");\n\n/** @typedef {import(\"rollup\").TransformResult} TransformResult */\n/** @typedef {import(\"rollup\").Plugin} RollupPlugin */\n\n/**\n * Replace literal strings in code with specified replacements with sourcemap\n * support.\n *\n * Example rollup config:\n *\n * ```js\n * import { replace } from \"@starbeam-dev/compile\";\n *\n * export default {\n * // ...\n * plugins: [\n * replace({ \"import.meta.hello\": `\"world\"` })\n * ]\n * };\n * ```\n *\n * This will replace any instances of `import.meta.hello` in source modules with\n * the content `\"world\"`.\n *\n * The main purpose of this plugin is to replace dynamic variables with\n * build-time constant values, which can then be further processed by a\n * minification pass.\n *\n * For example, the `importMeta` plugin replaces `import.meta.env.DEV` with\n * `true` in development mode and `false` in production mode. In production,\n * source code guarded with `if (import.meta.env.DEV)` will be emitted as `if\n * (false)`. The subsequent minification pass will remove the entire `if` block,\n * including its contents.\n *\n * @param {(id: string) => boolean} test\n * @param {Record} replacements @param {boolean} sourcemap\n *\n * @returns {RollupPlugin}\n */\nexport function createReplacePlugin(\n test: (id: string) => boolean,\n replacements: Record,\n sourcemap: boolean,\n): RollupPlugin {\n const pattern = new RegExp(\n \"\\\\b(\" +\n Object.keys(replacements)\n .map((str) => {\n return str.replace(/[-[\\]/{}()*+?.\\\\^$|]/g, \"\\\\$&\");\n })\n .join(\"|\") +\n \")\\\\b\",\n \"g\",\n );\n\n return {\n name: \"starbeam:replace\",\n\n transform(code: string, id: string): TransformResult {\n if (test(id)) {\n const s = new MagicString(code);\n let hasReplaced = false;\n\n let match: RegExpMatchArray | null;\n\n while ((match = pattern.exec(code))) {\n hasReplaced = true;\n const start = match.index as number;\n const [wholeMatch, partialMatch] = match as [string, string];\n\n const end = start + wholeMatch.length;\n const replacement = replacements[partialMatch];\n\n if (replacement === undefined) {\n throw new Error(\n `Unexpected missing replacement for \"${partialMatch}\".\\n\\nReplacements were ${JSON.stringify(\n replacements,\n null,\n STRINGIFY_SPACES,\n )}`,\n );\n }\n\n s.overwrite(start, end, replacement);\n }\n\n if (!hasReplaced) {\n return null;\n }\n\n /** @type {TransformResult} */\n const result: TransformResult = { code: s.toString() };\n if (sourcemap) {\n result.map = s.generateMap({ hires: true });\n }\n return result;\n }\n },\n };\n}\n\nconst STRINGIFY_SPACES = 2;\n","import type { RollupPlugin } from \"../utils.js\";\nimport { createReplacePlugin } from \"./replace.js\";\n\n/**\n * Replaces `import.meta` environment annotations with constants depending on\n * the specified mode.\n *\n * If no mode is specified, the mode defaults to `process.env[\"MODE\"]`. If\n * `process.env[\"MODE\"]` is not set, the mode defaults to `\"development\"`.\n *\n * If you want to control this plugin without relying on ambient environment\n * variables, you should specify the mode explicitly.\n *\n * Replacements:\n *\n * | source | replacement rule |\n * | ---------------------- | ------------------------------------------------ |\n * | `import.meta.env.MODE` | the specified mode (string) |\n * | `import.meta.env.DEV` | true if the mode is \"development\" (boolean) |\n * | `import.meta.env.PROD` | true if the mode is \"production\" (boolean) |\n *\n * It is possible for both `DEV` and `PROD` to be false (if the specified mode\n * is something other than `\"development\"` or `\"production\"`). In general, this\n * is not recommended when using this plugin.\n */\nexport default (mode = process.env[\"MODE\"] ?? \"development\"): RollupPlugin => {\n const DEV = mode === \"development\";\n const PROD = mode === \"production\";\n const STARBEAM_TRACE = process.env[\"STARBEAM_TRACE\"] ?? false;\n\n return createReplacePlugin(\n (id) => /\\.(j|t)sx?$/.test(id),\n {\n // remove inline testing\n \"import.meta.vitest\": \"false\",\n // env\n \"import.meta.env.MODE\": mode,\n \"import.meta.env.DEV\": DEV ? \"true\" : \"false\",\n \"import.meta.env.PROD\": PROD ? \"true\" : \"false\",\n \"import.meta.env.STARBEAM_TRACE\": STARBEAM_TRACE ? \"true\" : \"false\",\n },\n true,\n );\n};\n","import { readFileSync } from \"node:fs\";\n\nimport type { RollupPlugin } from \"../utils.js\";\n\nconst INLINE_PREFIX = \"\\0inline:\";\n\n/**\n * Inlines any imports that end in `?inline` into the importing module as a\n * string.\n *\n * This adds Vite's `?inline` feature to standalone rollup builds.\n */\nexport default (): RollupPlugin => {\n return {\n name: \"inline\",\n\n async resolveId(source, importer, options) {\n const path = removeTrailing(source, \"?inline\");\n\n if (path) {\n const resolved = await this.resolve(path, importer, options);\n\n if (resolved && !resolved.external) {\n await this.load(resolved);\n return INLINE_PREFIX + resolved.id;\n }\n }\n },\n\n async load(id) {\n if (id.startsWith(INLINE_PREFIX)) {\n const path = id.slice(INLINE_PREFIX.length);\n const code = readFileSync(path, \"utf8\");\n\n return Promise.resolve({\n code: `export default ${JSON.stringify(code)};`,\n });\n }\n },\n };\n};\n\nconst FIRST_CHAR = 0;\n\nfunction removeTrailing(source: string, trailing: string): string | undefined {\n if (source.endsWith(trailing)) {\n return source.slice(FIRST_CHAR, -trailing.length);\n }\n}\n","import type { RollupExternal } from \"@starbeam-dev/core\";\nimport typescriptLibrary from \"typescript\";\n\n/**\n * The package should be inlined into the output. In this situation, the `external` function should\n * return `false`. This is the default behavior.\n */\nexport const INLINE = false satisfies RollupExternal;\n\n/**\n * The package should be treated as an external dependency. In this situation, the `external` function\n * should return `true`. This is unusual and should be used when:\n *\n * - The package is a \"helper library\" (such as tslib) that we don't want to make a real dependency\n * of the published package.\n * - (for now) The package doesn't have good support for ESM (i.e. `type: module` in package.json)\n * but rollup will handle it for us.\n */\nexport const EXTERNAL = true satisfies RollupExternal;\n\nexport const {\n ImportsNotUsedAsValues,\n JsxEmit,\n ModuleKind,\n ModuleResolutionKind,\n ScriptTarget,\n ModuleDetectionKind,\n} = typescriptLibrary;\n","/* eslint-disable no-console */\nimport { join } from \"node:path\";\n\nimport type {\n ExternalConfig,\n NormalizedExternalOperator,\n NormalizedExternalOption,\n PackageInfo,\n RollupExternal,\n} from \"@starbeam-dev/core\";\n\nimport { EXTERNAL, INLINE } from \"../../constants.js\";\nimport type { RollupPlugin } from \"../utils.js\";\n\n/**\n * @typedef {import(\"#core\").PackageInfo} PackageInfo\n */\n\n/**\n * A plugin that applies the default starbeam-dev externals rules to the builds\n * for the specified package.\n *\n * When an import is \"external\", it is left as-is in the built package. When an\n * import is \"inline\", it is combined with the built package's main file and\n * further optimized.\n *\n * In general, it's better to inline an import if any of the following are true:\n *\n * 1. It is only used by this package.\n * 2. Its exports are easy to optimize by a minifier in production builds (e.g.\n * exports that are simple functions that have no behavior or simply return\n * its argument). Functions that use `import.meta.env.DEV` guards around\n * behavior that would be tricky to optimize are still good candidates for\n * inlining.\n * 3. More generally, when inlining the import in production mode is likely to\n * save more bytes than the bytes lost due to duplication.\n *\n * ## Rules\n *\n * 1. Relative imports: If the import starts with a `.`, then it is an inline\n * import.\n * 2. Custom rules: If the `starbeam:inline` key in `package.json` specifies a\n * rule for a dependency, use it. You can use custom rules to override any of\n * the default rules below.\n * 3. [TODO] Custom workspace rules: If the `starbeam:inline` key in the\n * `package.json` for the workspace root specifies a rule for a dependency,\n * use it.\n * 4. Helper libraries: If the import is one of the well-known helper libraries,\n * then it is an inline import.\n * 5. Absolute imports: If the import starts with `/`, then it is an inline\n * import. This is because absolute imports are usually relative imports\n * previously resolved by the build process. In general, you should not use\n * absolute imports in your source code when using this plugin (and probably\n * in general).\n * 6. Import map imports: If the import starts with `#`, then it is an inline\n * import. Since import-map imports typically resolve to relative imports,\n * the current behavior is to inline them.\n * 7. If the `starbeam:external` key in `package.json` specifies a rule for a\n * dependency, use it.\n *\n * It would probably be more correct to attempt to resolve import map imports\n * and then apply the rules above to the resolved imports. Please file an issue\n * describing your situation if you need this.\n *\n * ## Well-Known Helper Libraries\n *\n * - `@babel/runtime/*`\n * - `tslib`\n * - `@swc/core`\n *\n * ## Manifest Rules (`starbeam:external` keys)\n *\n * The `starbeam:inline` key is either an array of rules or a rules object.\n *\n * ### Rule Pattern\n *\n * A rule pattern is a string, one of the following:\n *\n * - The name of a package listed in the `dependencies` or\n * `optionalDependencies` field of the `package.json` file\n * - A pattern that ends in a `*` (e.g. `@starbeam/*`) and matches the name of\n * at least one package listed in the `dependencies` or\n * `optionalDependencies`. The `*` matches one or more characters that are\n * valid as part of an npm package name.\n * - The special pattern `(helpers)`. This matches all of the well-known helper\n * libraries.\n *\n * ### Rules Array\n *\n * The easiest way to specify inlining rules is by specifying an array of\n * patterns.\n *\n * Example:\n *\n * ```json\n * {\n * \"dependencies\": {\n * \"react\": \"^18.2.0\",\n * \"lodash\": \"^4.17.21\"\n * },\n *\n * \"starbeam:inline\": [\"lodash\"]\n * }\n * ```\n *\n * Any patterns in the array will be configured to be inlined. These patterns\n * supersede the default behavior.\n *\n * ### Rules Object\n *\n * Each key in the object is a rule pattern, and the value is either \"inline\" or\n * \"external\".\n *\n * Example:\n *\n * ```json\n * {\n * \"dependencies\": {\n * \"react\": \"^18.2.0\",\n * \"lodash\": \"^4.17.21\"\n * },\n *\n * \"starbeam:inline\": {\n * \"loadash\": \"inline\"\n * }\n * }\n * ```\n *\n * In this example, the `react` dependency is externalized, and the `lodash`\n * dependency is inlined.\n *\n * The default behavior is to externalize all dependencies, so you don't need to\n * specify \"external\" in a rules object unless you want to supersede a later\n * rule.\n *\n * Example:\n *\n * ```json\n * {\n * \"dependencies\": {\n * \"react\": \"^18.2.0\",\n * \"lodash.map\": \"^4.17.21\",\n * \"lodash.merge\": \"^4.17.21\"\n * \"lodash.flat-map\": \"^4.17.21\"\n * },\n *\n * \"starbeam:inline\": {\n * \"lodash.merge\": \"external\",\n * \"lodash.*\": \"inline\"\n * }\n * }\n * ```\n *\n * In this example, `react` and `lodash.merge` are externalized, and\n * `lodash.map` and `lodash.flat-map` are inlined.\n *\n * ### Rule Objects in a Rules Array\n *\n * When you have a lot of inline rules and only a handful of externals\n * overrides, it's nice to be able to avoid repeating `: \"inline\"` over and over\n * again.\n *\n * In this situation, you can include rule objects in a rules array.\n *\n * Example:\n *\n * Instead of this:\n *\n * ```json\n * \"starbeam:inline\": {\n * \"lodash.merge\": \"external\",\n * \"lodash.*\": \"inline\"\n * }\n * ```\n *\n * You can do this:\n *\n * ```json\n * \"starbeam:inline\": [\n * { \"lodash.merge\": \"external\" },\n * \"lodash.*\"\n * ]\n * ```\n *\n * ## Matching Order for Custom Rules\n *\n * Custom rules are matched in the order they are listed in the\n * `starbeam:external` key.\n *\n * Earlier rules in the rule array take precedence over later rules. Earlier\n * rules in an rules object take precedence over later rules in the same rule\n * object.\n *\n * ## Development and Peer Dependencies\n *\n * Since development dependencies are not intended to be used at runtime, they\n * should never be imported from runtime code, and therefore should never be\n * included in the build.\n *\n * Since peer dependencies are intended to be supplied by a dependent package\n * (i.e. the package including the package you are building), they are always\n * external and should not be listed in the `starbeam:external` key.\n *\n * @param {PackageInfo} pkg\n * @returns {import(\"rollup\").Plugin}\n */\nexport default function externals(pkg: PackageInfo): RollupPlugin {\n const isExternal = external(pkg);\n\n return {\n name: \"starbeam:externals\",\n\n resolveId(id) {\n if (isExternal(id)) {\n return { id, external: true };\n }\n },\n };\n}\n\n/**\n * @param {PackageInfo} pkg\n * @returns\n */\nfunction external(pkg: PackageInfo) {\n /**\n * @param {string} id\n * @returns {boolean}\n */\n return (id: string): boolean => {\n // Inline relative modules.\n if (id.startsWith(\".\")) {\n return INLINE;\n }\n\n // Resolve custom rules. These rules include the default behavior of\n // well-known helper libraries.\n for (const rule of pkg.starbeam.inline) {\n const isExternal = resolveIsExternal(rule, id);\n if (isExternal !== undefined) return isExternal;\n }\n\n // Allow custom rules to override the default behavior\n // of `#` and `/` dependencies.\n if (id.startsWith(\"#\") || id.startsWith(\"/\")) {\n return INLINE;\n }\n\n const strictExternals = pkg.starbeam.strict.externals;\n if (strictExternals !== \"allow\") {\n const message = [\n `The external dependency ${id} is included in your compiled output. This means that your compiled output will contain a runtime import of that package.`,\n `This is the default behavior of starbeam-dev, but you did not specify an inline rule for ${id}, and there is no built-in rule that applies to ${id}.`,\n ];\n\n if (strictExternals === \"error\") {\n const error = [\n `Unexpected external dependency: ${id}.`,\n ...message,\n `This is an error because you are in strict externals mode (${strictExternals}), as specified in \"starbeam:strict\" in your package.json at:\\n ${join(\n pkg.root,\n \"package.json\",\n )})`,\n ].join(\"\\n\\n\");\n throw Error(error);\n } else {\n console.warn(\n [\n ...message,\n `This message appears because you are in strict externals mode (${strictExternals}), as specified in \"starbeam:strict\" in your package.json at:\\n ${join(\n pkg.root,\n \"package.json\",\n )})`,\n ].join(\"\\n\"),\n );\n }\n }\n\n return true;\n };\n}\n\nfunction resolveIsExternal(\n option: NormalizedExternalOption,\n id: string,\n): RollupExternal | undefined {\n return findExternalFn(option)(id);\n\n /**\n * @param {import(\"#core\").NormalizedExternalOption} option\n * @returns {(id: string) => import(\"#core\").RollupExternal | undefined}\n */\n function findExternalFn([operator, name, config]: NormalizedExternalOption): (\n id: string,\n ) => RollupExternal | undefined {\n const find = operatorFn(operator);\n return (id) => (find(id, name) ? fromConfig(config) : undefined);\n }\n\n /**\n * @param {import(\"#core\").ExternalConfig | undefined} config\n * @returns {import(\"#core\").RollupExternal | undefined}\n */\n function fromConfig(\n config: ExternalConfig | undefined,\n ): RollupExternal | undefined {\n switch (config) {\n case \"external\":\n return EXTERNAL;\n case \"inline\":\n return INLINE;\n case undefined:\n return undefined;\n }\n }\n\n function operatorFn(\n operator: NormalizedExternalOperator,\n ): (id: string, key: string) => boolean {\n switch (operator) {\n case \"startsWith\":\n return (id, key) => id.startsWith(key);\n case \"is\":\n return (id, key) => id === key;\n }\n }\n}\n","import { createRequire } from \"node:module\";\n\nimport type { PackageInfo } from \"@starbeam-dev/core\";\nimport type { JscConfig, ReactConfig, TransformConfig } from \"@swc/core\";\nimport { getTsconfig } from \"get-tsconfig\";\n\nimport type { CompilerOptionsJson } from \"../ts.js\";\nimport type { RollupPlugin } from \"../utils.js\";\n\nconst require = createRequire(import.meta.url);\n\nconst rollupTS =\n require(\"rollup-plugin-ts\") as typeof import(\"rollup-plugin-ts\").default;\n\n/**\n * Build a library with TypeScript in the specified mode.\n *\n * This plugin uses swc (via `@swc/core`) to efficiently compile TypeScript to\n * JavaScript.\n *\n * ## Assumptions\n *\n * You are using at least TypeScript 5.0.\n *\n * You are using the (large) subset of TypeScript that can be compiled by\n * evaluating a single module and stripping out type-specific features. You are\n * not using features of TypeScript that require multi-module analysis to\n * determine how to compile a single module.\n *\n * - You should not use `const` enums, but if you do, they will be converted\n * into normal enums.\n * - All import paths that refer to non-existent JavaScript modules (type-only\n * modules) are imported using `import type`.\n * - All imports that do not refer to a JavaScript value are imported as part of\n * an `import type` statement or are annotated with `type` (i.e. `import {\n * map, type MapFn } from \"map\"`).\n *\n * ## Recommendations\n *\n * To ensure that your code satisfies these assumptions, we recommend the\n * following tsconfig options:\n *\n *
\n *
`verbatimModuleSyntax`: true
\n *
\n * You will get a TypeScript error if one of your imports is only\n * used as a type but does not include the `type` specifier.\n *
\n *
\n *\n * We also recommend the use of `@typescript-eslint/consistent-type-imports` and\n * `@typescript-eslint/no-import-type-side-effects`. These auto-fixable lints\n * will error if you don't use `import type` on an import statement that is\n * never used as a value. These lints will also ensure that any named imports\n * that are only used as types are annotated with `type`.\n *\n * If you're using vscode, you can enable \"source.fixAll\" in\n * `editor.codeActionOnSave` and imports will automatically be updated if you\n * need to add or remove `import type`.\n *\n * ## Type Checking\n *\n * > **TL;DR** This plugin does **not** typecheck your code. It is intended to\n * > be run after verifying your code using tools such as `tsc` and `eslint` and\n * > after successfully running your tests.\n *\n * Now for the longer version...\n *\n * **Compiling** a library is a separate step from **verifying** the library.\n *\n * Conversationally, people refer to the process of verifying and compiling a\n * library as \"the build\" (i.e. \"failing the build\").\n *\n * This is largely an artifact of workflows in other languages, such as Java,\n * C++ and Rust. In these languages, the *compiler* performs a large amount of\n * verification before compilation can begin.\n *\n * Even in those environments, many projects perform additional verification\n * steps (such as linting and testing) before creating and publishing the\n * compilation artifacts.\n *\n * But in **our** environment, virtually the entire verification step can be\n * performed before the compilation step.\n *\n * > Adding to the confusion, the tool that you use to *verify* your TypeScript\n * > code is called `tsc`. Even more confusingly, `tsc` is intended to be a\n * > good-enough reference compiler for TypeScript code. In practice, though, it\n * > makes more sense to use `tsc` as part of a comprehensive *verification*\n * > strategy and to use other tools (such as `esbuild` or `swc`) to compile\n * > your TypeScript code.\n *\n * ## Verify Separately\n *\n * This plugin is intended to be used as part of a build process that runs the\n * verification step first, and only invokes the compilation step once the\n * verification step has completed.\n *\n * These same verification steps should run in your CI pipeline.\n *\n * During development, we recommend that you use the same verification tools in\n * your editor, which can help developers avoid submitting pull requests that\n * will fail verification.\n */\nexport default function typescript(\n mode: \"development\" | \"production\" | undefined,\n) {\n return (pkg: PackageInfo, config: CompilerOptionsJson): RollupPlugin => {\n const { config: tsconfig } = getTsconfig(pkg.root) ?? {};\n const compilerOptions = tsconfig?.compilerOptions ?? {};\n\n const transform: Partial = {\n treatConstEnumAsEnum: true,\n };\n\n const minify = {\n format: {\n comments: mode === 'production',\n },\n mangle: {\n toplevel: true,\n properties: {\n builtins: false,\n },\n },\n module: true,\n compress: {\n module: true,\n passes: 4,\n unsafe_math: true,\n unsafe_symbols: mode === \"production\",\n hoist_funs: true,\n conditionals: true,\n drop_debugger: true,\n evaluate: true,\n reduce_vars: true,\n side_effects: true,\n dead_code: true,\n defaults: true,\n unused: true,\n },\n } as const;\n\n let jscConfig: Partial = { transform };\n\n if (mode === \"production\") {\n jscConfig.minify = minify;\n }\n\n const fragmentFactory = compilerOptions.jsxFragmentFactory;\n const jsxFactory = compilerOptions.jsxFactory;\n\n if (fragmentFactory && jsxFactory)\n jscConfig = withReact(jscConfig, {\n pragma: jsxFactory,\n pragmaFrag: fragmentFactory,\n });\n\n const importSource = compilerOptions.jsxImportSource;\n\n if (importSource)\n jscConfig = withReact(jscConfig, { runtime: \"automatic\", importSource });\n\n return rollupTS({\n transpiler: \"swc\",\n transpileOnly: true,\n\n swcConfig: {\n jsc: jscConfig,\n },\n\n tsconfig: {\n ...compilerOptions,\n ...config,\n },\n });\n };\n}\n\nfunction withReact(jsc: JscConfig, react: ReactConfig): JscConfig {\n jsc.transform ??= {};\n jsc.transform.react = { ...jsc.transform.react, ...react };\n return jsc;\n}\n","import { execSync } from 'node:child_process';\nimport { join, resolve } from \"node:path\";\n\nimport terser from '@rollup/plugin-terser';\nimport { Package, type PackageInfo, rootAt } from \"@starbeam-dev/core\";\nimport type { RollupOptions } from \"rollup\";\nimport copy from 'rollup-plugin-copy'\n\nimport externals from \"./plugins/external.js\";\nimport importMeta from \"./plugins/import-meta.js\";\nimport typescript from \"./plugins/typescript.js\";\nimport type { RollupPlugin } from \"./utils.js\";\n\nconst MODES = [\"development\", \"production\", undefined] as const;\n\ninterface CompileOptions {\n /**\n * Copy the changelog from the root of the monorepo.\n * true by default\n */\n copyRootChangelog?: boolean;\n}\n\nexport function compile(here: ImportMeta | string, options?: CompileOptions): RollupOptions[] {\n const pkg = Package.at(here);\n\n if (pkg === undefined) {\n throw new Error(`Package not found at ${rootAt(here)}`);\n }\n\n return compilePackage(pkg, options || {});\n}\n\nfunction copyRootChangelog(pkg: PackageInfo): RollupPlugin {\n const monorepoRoot = execSync('git rev-parse --show-toplevel', { encoding: 'utf-8', cwd: pkg.root }).trim();\n const rootChangelog = join(monorepoRoot, 'CHANGELOG.md');\n\n // this plugin does not provide types\n const includeChangelog = copy({\n targets: [\n {\n src: rootChangelog,\n dest: '.',\n }\n ],\n });\n\n return includeChangelog;\n\n}\n\n/**\n * @param {import(\"@starbeam-dev/core\").PackageInfo} pkg\n * @param {CompileOptions} options\n * @returns {import(\"rollup\").RollupOptions[]}\n */\nfunction compilePackage(pkg: PackageInfo, options: CompileOptions): RollupOptions[] {\n return MODES.flatMap((mode) => {\n const PLUGINS: RollupPlugin[] = [];\n\n if (mode) {\n PLUGINS.push(importMeta(mode));\n }\n\n const deps = Object.keys(pkg.dependencies);\n\n const entries = entryPoints(pkg, mode).map((options) => ({\n ...options,\n external: deps,\n plugins: [\n ...PLUGINS,\n externals(pkg),\n typescript(mode)(pkg, {\n target: \"esnext\",\n module: \"esnext\",\n moduleDetection: \"force\",\n moduleResolution: \"bundler\",\n verbatimModuleSyntax: true,\n }),\n ...(mode === 'production' ? [\n terser({\n // remove all comments\n format: {\n comments: false\n },\n // prevent any compression\n compress: false\n }),\n ] : [])\n ],\n }));\n\n /**\n * We only need to do this once, so we'll push it on the first entrypoint's rollup config\n */\n if (options.copyRootChangelog ?? true) {\n const copyPlugin = copyRootChangelog(pkg);\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n entries[0]?.plugins.push(copyPlugin);\n }\n\n return entries;\n });\n}\n\nfunction entryPoints(\n pkg: PackageInfo,\n mode: \"development\" | \"production\" | undefined,\n): import(\"rollup\").RollupOptions[] {\n const {\n root,\n starbeam: { entry },\n } = pkg;\n\n function entryPoint([exportName, ts]: [string, string]): RollupOptions {\n return {\n input: resolve(root, ts),\n treeshake: true,\n output: {\n file: filename({ root, name: exportName, mode, ext: \"js\" }),\n format: \"esm\",\n sourcemap: true,\n hoistTransitiveImports: false,\n exports: \"auto\",\n },\n onwarn: (warning, warn) => {\n switch (warning.code) {\n case \"CIRCULAR_DEPENDENCY\":\n case \"EMPTY_BUNDLE\":\n return;\n default:\n warn(warning);\n }\n },\n };\n }\n\n if (entry === undefined) {\n // eslint-disable-next-line no-console\n console.warn(\"No entry point found for package\", pkg.name);\n return [];\n } else {\n return Object.entries(entry).map(entryPoint);\n }\n}\n\nfunction filename({\n root,\n name,\n mode,\n ext,\n}: {\n root: string;\n name: string;\n mode: \"development\" | \"production\" | undefined;\n ext: \"js\" | \"cjs\";\n}): string {\n if (mode) {\n return resolve(root, \"dist\", `${name}.${mode}.${ext}`);\n } else {\n return resolve(root, \"dist\", `${name}.${ext}`);\n }\n}\n"],"names":["default","MagicString","createReplacePlugin","test","replacements","sourcemap","pattern","RegExp","Object","keys","map","str","replace","join","name","transform","code","id","s","hasReplaced","match","exec","start","index","wholeMatch","partialMatch","end","length","replacement","undefined","Error","JSON","stringify","STRINGIFY_SPACES","overwrite","result","toString","generateMap","hires","mode","process","env","DEV","PROD","STARBEAM_TRACE","INLINE_PREFIX","resolveId","source","importer","options","path","removeTrailing","resolved","resolve","external","load","startsWith","slice","readFileSync","Promise","FIRST_CHAR","trailing","endsWith","INLINE","EXTERNAL","externals","pkg","isExternal","rule","starbeam","inline","resolveIsExternal","strictExternals","strict","message","error","root","console","warn","option","findExternalFn","operator","config","find","operatorFn","fromConfig","key","require","createRequire","url","rollupTS","typescript","tsconfig","getTsconfig","compilerOptions","treatConstEnumAsEnum","minify","format","comments","mangle","toplevel","properties","builtins","module","compress","passes","unsafe_math","unsafe_symbols","hoist_funs","conditionals","drop_debugger","evaluate","reduce_vars","side_effects","dead_code","defaults","unused","jscConfig","fragmentFactory","jsxFragmentFactory","jsxFactory","withReact","pragma","pragmaFrag","importSource","jsxImportSource","runtime","transpiler","transpileOnly","swcConfig","jsc","react","MODES","compile","here","Package","at","rootAt","compilePackage","copyRootChangelog","monorepoRoot","execSync","encoding","cwd","trim","rootChangelog","includeChangelog","copy","targets","src","dest","flatMap","PLUGINS","push","importMeta","deps","dependencies","entries","entryPoints","plugins","target","moduleDetection","moduleResolution","verbatimModuleSyntax","terser","copyPlugin","entry","entryPoint","exportName","ts","input","treeshake","output","file","filename","ext","hoistTransitiveImports","exports","onwarn","warning"],"mappings":";;;;;;;;;;AAAA;AAMA,MAAM,EAAEA,OAASC,EAAAA,WAAW,EAAE,GAAG,MAAM,OAAO,cAAA,CAAA,CAAA;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCC,IACM,SAASC,mBAAAA,CACdC,IAA6B,EAC7BC,YAAoC,EACpCC,SAAkB,EAAA;IAElB,MAAMC,OAAAA,GAAU,IAAIC,MAAAA,CAClB,MACAC,GAAAA,MAAAA,CAAOC,IAAI,CAACL,YAAAA,CAAAA,CACTM,GAAG,CAAC,CAACC,GAAAA,GAAAA;QACJ,OAAOA,GAAAA,CAAIC,OAAO,CAAC,uBAAyB,EAAA,MAAA,CAAA,CAAA;KAE7CC,CAAAA,CAAAA,IAAI,CAAC,GAAA,CAAA,GACR,MACA,EAAA,GAAA,CAAA,CAAA;IAGF,OAAO;QACLC,IAAM,EAAA,kBAAA;QAENC,SAAUC,CAAAA,CAAAA,IAAY,EAAEC,EAAU,EAAA;AAChC,YAAA,IAAId,KAAKc,EAAK,CAAA,EAAA;gBACZ,MAAMC,CAAAA,GAAI,IAAIjB,WAAYe,CAAAA,IAAAA,CAAAA,CAAAA;AAC1B,gBAAA,IAAIG,WAAc,GAAA,KAAA,CAAA;gBAElB,IAAIC,KAAAA,CAAAA;AAEJ,gBAAA,MAAQA,KAAQd,GAAAA,OAAAA,CAAQe,IAAI,CAACL,IAAQ,CAAA,CAAA;oBACnCG,WAAc,GAAA,IAAA,CAAA;oBACd,MAAMG,KAAAA,GAAQF,MAAMG,KAAK,CAAA;oBACzB,MAAM,CAACC,UAAYC,EAAAA,YAAAA,CAAa,GAAGL,KAAAA,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IAAI,EACJwI,GAAG,EAMJ,EAAA;AACC,IAAA,IAAIxI,IAAM,EAAA;AACR,QAAA,OAAOc,OAAQuB,CAAAA,IAAAA,EAAM,MAAQ,EAAA,CAAC,EAAE9D,IAAAA,CAAK,CAAC,EAAEyB,IAAK,CAAA,CAAC,EAAEwI,GAAAA,CAAI,CAAC,CAAA,CAAA;KAChD,MAAA;QACL,OAAO1H,OAAAA,CAAQuB,MAAM,MAAQ,EAAA,CAAC,EAAE9D,IAAK,CAAA,CAAC,EAAEiK,GAAAA,CAAI,CAAC,CAAA,CAAA;AAC/C,KAAA;AACF;;;;"} \ No newline at end of file diff --git a/dist/tsconfig.tsbuildinfo b/dist/tsconfig.tsbuildinfo deleted file mode 100644 index 3ebe744..0000000 --- a/dist/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"program":{"fileNames":["../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es5.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2023.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.esnext.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.dom.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2022.intl.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2023.array.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.es2023.collection.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.esnext.disposable.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.esnext.decorators.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/.pnpm/@types+estree@1.0.3/node_modules/@types/estree/index.d.ts","../node_modules/.pnpm/@rollup+pluginutils@5.0.5_rollup@4.1.4/node_modules/@rollup/pluginutils/types/index.d.ts","../node_modules/.pnpm/rollup@4.1.4/node_modules/rollup/dist/rollup.d.ts","../node_modules/.pnpm/@rollup+plugin-commonjs@25.0.5_rollup@4.1.4/node_modules/@rollup/plugin-commonjs/types/index.d.ts","../@types/plugin-commonjs/index.d.ts","../node_modules/.pnpm/@rollup+plugin-node-resolve@15.2.3_rollup@4.1.4/node_modules/@rollup/plugin-node-resolve/types/index.d.ts","../@types/plugin-node-resolve/index.d.ts","../src/rollup/utils.ts","../node_modules/.pnpm/magic-string@0.30.5/node_modules/magic-string/dist/magic-string.es.d.mts","../src/rollup/plugins/replace.ts","../src/rollup/plugins/import-meta.ts","../src/rollup/plugins/inline.ts","../node_modules/.pnpm/@starbeam-dev+core@1.0.2/node_modules/@starbeam-dev/core/dist/index.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/assert.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/assert/strict.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/globals.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/async_hooks.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/buffer.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/child_process.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/cluster.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/console.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/constants.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/crypto.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/dgram.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/dns.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/dns/promises.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/domain.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/dom-events.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/events.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/fs.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/fs/promises.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/http.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/http2.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/https.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/inspector.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/module.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/net.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/os.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/path.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/perf_hooks.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/process.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/punycode.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/querystring.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/readline.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/readline/promises.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/repl.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/stream.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/stream/promises.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/stream/consumers.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/stream/web.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/string_decoder.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/test.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/timers.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/timers/promises.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/tls.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/trace_events.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/tty.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/url.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/util.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/v8.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/vm.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/wasi.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/worker_threads.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/zlib.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/globals.global.d.ts","../node_modules/.pnpm/@types+node@18.18.5/node_modules/@types/node/index.d.ts","../node_modules/.pnpm/@types+fs-extra@8.1.5/node_modules/@types/fs-extra/index.d.ts","../node_modules/.pnpm/@types+minimatch@5.1.2/node_modules/@types/minimatch/index.d.ts","../node_modules/.pnpm/@types+glob@7.2.0/node_modules/@types/glob/index.d.ts","../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/types/index.d.ts","../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts","../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/settings.d.ts","../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/async.d.ts","../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/index.d.ts","../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/types/index.d.ts","../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts","../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/settings.d.ts","../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts","../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/index.d.ts","../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/types/index.d.ts","../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.d.ts","../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts","../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/async.d.ts","../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/async.d.ts","../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/index.d.ts","../node_modules/.pnpm/fast-glob@3.3.1/node_modules/fast-glob/out/types/index.d.ts","../node_modules/.pnpm/fast-glob@3.3.1/node_modules/fast-glob/out/settings.d.ts","../node_modules/.pnpm/fast-glob@3.3.1/node_modules/fast-glob/out/managers/tasks.d.ts","../node_modules/.pnpm/fast-glob@3.3.1/node_modules/fast-glob/out/index.d.ts","../node_modules/.pnpm/globby@10.0.1/node_modules/globby/index.d.ts","../node_modules/.pnpm/rollup-plugin-copy@3.5.0/node_modules/rollup-plugin-copy/index.d.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/typescript.d.ts","../src/constants.ts","../src/rollup/plugins/external.ts","../node_modules/.pnpm/@swc+types@0.1.5/node_modules/@swc/types/index.d.ts","../node_modules/.pnpm/@swc+core@1.3.93_@swc+helpers@0.5.3/node_modules/@swc/core/spack.d.ts","../node_modules/.pnpm/@swc+core@1.3.93_@swc+helpers@0.5.3/node_modules/@swc/core/index.d.ts","../node_modules/.pnpm/get-tsconfig@4.7.2/node_modules/get-tsconfig/dist/index.d.mts","../src/rollup/ts.ts","../node_modules/.pnpm/helpertypes@0.0.19/node_modules/helpertypes/dist/index.d.ts","../node_modules/.pnpm/rollup-plugin-ts@3.4.5_@swc+core@1.3.93_@swc+helpers@0.5.3_rollup@4.1.4_typescript@5.2.2/node_modules/rollup-plugin-ts/dist/esm/index.d.ts","../src/rollup/plugins/typescript.ts","../src/rollup/rollup.ts","../src/index.ts","../node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/lib/lib.esnext.full.d.ts"],"fileInfos":[{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false,"affectsGlobalScope":true},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false},{"version":1,"signature":false}],"root":[[1,173]],"options":{"declaration":true,"emitDeclarationOnly":false,"inlineSourceMap":false,"inlineSources":false,"module":99,"noEmitHelpers":false,"noEmitOnError":false,"noImplicitAny":true,"noPropertyAccessFromIndexSignature":true,"noUncheckedIndexedAccess":true,"outDir":"../64e2a259","outFile":"..","skipLibCheck":true,"sourceMap":true,"strict":true,"target":99,"tsBuildInfoFile":"./tsconfig.tsbuildinfo"},"fileIdsList":[[71,127],[73,127],[127,142,143],[127,143,144,145,146],[127,134,143,145],[127,142,144],[98,127,134],[98,127,134,138],[127,138,139,140,141],[127,138,140],[127,139],[115,127,134,147,148,149,152],[127,148,149,151],[97,127,134,147,148,149,150],[127,149],[127,147,148],[127,134,147],[69,70,127],[70,127],[68,127],[127],[127,163,164],[127,163],[97,98,127,134,136],[81,127],[84,127],[85,90,118,127],[86,97,98,105,115,126,127],[86,87,97,105,127],[88,127],[89,90,98,106,127],[90,115,123,127],[91,93,97,105,127],[92,127],[93,94,127],[97,127],[95,97,127],[84,97,127],[97,98,99,115,126,127],[97,98,99,112,115,118,127],[127,131],[93,97,100,105,115,126,127],[97,98,100,101,105,115,123,126,127],[100,102,115,123,126,127],[81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133],[97,103,127],[104,126,127,131],[93,97,105,115,127],[106,127],[107,127],[84,108,127],[109,125,127,131],[110,127],[111,127],[97,112,113,127],[112,114,127,129],[85,97,115,116,117,118,127],[85,115,117,127],[115,116,127],[118,127],[119,127],[84,115,127],[97,121,122,127],[121,122,127],[90,105,115,123,127],[124,127],[105,125,127],[85,100,111,126,127],[90,127],[115,127,128],[104,127,129],[127,130],[85,90,97,99,108,115,126,127,129,131],[115,127,132],[127,134,154,155,156],[127,154,155],[127,154],[127,134,153],[127,137,157],[70,127,135,158],[70,127,160,168],[80,127,160],[78,79,127,171],[75,80,107,127,161],[75,77,127],[75,98,127],[70,75,76,127],[75,80,104,127,165,166,167,169],[70,75,78,80,86,107,127,159,162,170],[127,166]],"referencedMap":[[72,1],[74,2],[144,3],[147,4],[146,5],[145,6],[143,7],[139,8],[142,9],[141,10],[140,11],[138,7],[153,12],[152,13],[151,14],[150,15],[149,16],[148,17],[71,18],[73,19],[69,20],[80,21],[165,22],[164,23],[163,21],[68,21],[135,7],[137,24],[136,21],[81,25],[82,25],[84,26],[85,27],[86,28],[87,29],[88,30],[89,31],[90,32],[91,33],[92,34],[93,35],[94,35],[96,36],[95,37],[97,38],[98,39],[99,40],[83,41],[133,21],[100,42],[101,43],[102,44],[134,45],[103,46],[104,47],[105,48],[106,49],[107,50],[108,51],[109,52],[110,53],[111,54],[112,55],[113,55],[114,56],[115,57],[117,58],[116,59],[118,60],[119,61],[120,62],[121,63],[122,64],[123,65],[124,66],[125,67],[126,68],[127,69],[128,70],[129,71],[130,72],[131,73],[132,74],[157,75],[156,76],[155,77],[154,78],[166,21],[158,79],[168,21],[76,21],[159,80],[169,81],[70,21],[66,21],[67,21],[12,21],[13,21],[17,21],[16,21],[2,21],[18,21],[19,21],[20,21],[21,21],[22,21],[23,21],[24,21],[25,21],[3,21],[4,21],[26,21],[30,21],[27,21],[28,21],[29,21],[31,21],[32,21],[33,21],[5,21],[34,21],[35,21],[36,21],[37,21],[6,21],[41,21],[38,21],[39,21],[40,21],[42,21],[7,21],[43,21],[48,21],[49,21],[44,21],[45,21],[46,21],[47,21],[8,21],[53,21],[50,21],[51,21],[52,21],[54,21],[9,21],[55,21],[56,21],[57,21],[60,21],[58,21],[59,21],[61,21],[62,21],[10,21],[1,21],[11,21],[65,21],[64,21],[173,21],[63,21],[15,21],[14,21],[160,21],[161,82],[172,83],[162,84],[78,85],[79,86],[77,87],[170,88],[171,89],[167,90],[75,19]],"exportedModulesMap":[],"changeFileSet":[72,74,144,147,146,145,143,139,142,141,140,138,153,152,151,150,149,148,71,73,69,80,165,164,163,68,135,137,136,81,82,84,85,86,87,88,89,90,91,92,93,94,96,95,97,98,99,83,133,100,101,102,134,103,104,105,106,107,108,109,110,111,112,113,114,115,117,116,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,157,156,155,154,166,158,168,76,159,169,70,66,67,12,13,17,16,2,18,19,20,21,22,23,24,25,3,4,26,30,27,28,29,31,32,33,5,34,35,36,37,6,41,38,39,40,42,7,43,48,49,44,45,46,47,8,53,50,51,52,54,9,55,56,57,60,58,59,61,62,10,1,11,65,64,173,63,15,14,160,161,172,162,78,79,77,170,171,167,75]},"version":"5.2.2"} \ No newline at end of file diff --git a/package.json b/package.json index 3ee9f83..a2e50f1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@starbeam-dev/compile", "type": "module", - "version": "1.1.0", + "version": "1.3.0", "description": "A rollup plugin for building packages that use starbeam-dev", "main": "dist/index.js", "types": "dist/index.d.ts",