diff --git a/Makefile b/Makefile index a1dcd19..e6839e1 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ build.monobundle: $(BUN) install lint: - $(BUNX) @biomejs/biome check --max-diagnostics=1 --apply . + $(BUNX) turbo run lint --filter=monobundle --force test: $(BUN) test diff --git a/biome.json b/biome.json deleted file mode 100644 index 0ebb705..0000000 --- a/biome.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", - "extends": ["./node_modules/@innoai-tech/devconfig/biome.json"] -} diff --git a/bun.lockb b/bun.lockb index ceeca36..e1bf40d 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/cmd/webappserve/example/base/__built__/index.0c15a522.js b/cmd/webappserve/example/base/__built__/index.0c15a522.js index 6b2af48..3254c92 100644 --- a/cmd/webappserve/example/base/__built__/index.0c15a522.js +++ b/cmd/webappserve/example/base/__built__/index.0c15a522.js @@ -1 +1 @@ -alert("hello") \ No newline at end of file +alert("hello"); diff --git a/cmd/webappserve/example/normal/__built__/index.0c15a522.js b/cmd/webappserve/example/normal/__built__/index.0c15a522.js index 6b2af48..3254c92 100644 --- a/cmd/webappserve/example/normal/__built__/index.0c15a522.js +++ b/cmd/webappserve/example/normal/__built__/index.0c15a522.js @@ -1 +1 @@ -alert("hello") \ No newline at end of file +alert("hello"); diff --git a/nodedevpkg/devconfig/biome.json b/nodedevpkg/devconfig/biome.json deleted file mode 100644 index 0798d4f..0000000 --- a/nodedevpkg/devconfig/biome.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "vcs": { - "clientKind": "git", - "enabled": true, - "useIgnoreFile": true - }, - "files": { - "ignore": ["*.d.ts", "*.js", "*.mjs"] - }, - "linter": { - "enabled": true, - "rules": { - "recommended": true, - "suspicious": { - "noExplicitAny": "off" - }, - "complexity": { - "useLiteralKeys": "off", - "noBannedTypes": "off" - } - } - } -} diff --git a/nodedevpkg/monobundle/package.json b/nodedevpkg/monobundle/package.json index c8fb8cf..ca7653e 100644 --- a/nodedevpkg/monobundle/package.json +++ b/nodedevpkg/monobundle/package.json @@ -1,6 +1,6 @@ { "name": "@innoai-tech/monobundle", - "version": "0.12.0", + "version": "0.12.1", "monobundle": { "exports": { ".": "./src/index.ts", @@ -14,13 +14,13 @@ "@innoai-tech/lodash": "workspace:^", "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-node-resolve": "^15.2.3", - "browserslist": "^4.22.2", + "browserslist": "^4.23.0", "chalk": "^5.3.0", - "esbuild": "^0.19.11", - "globby": "^14.0.0", + "esbuild": "^0.20.1", + "globby": "^14.0.1", "js-yaml": "^4.1.0", "minimatch": "^9.0.3", - "rollup": "^4.9.5", + "rollup": "^4.12.0", "rollup-plugin-dts": "^6.1.0", "yargs": "^17.7.2" }, @@ -56,7 +56,7 @@ "directory": "nodedevpkg/monobundle" }, "scripts": { - "lint": "bunx --bun @biomejs/biome check --apply .", + "lint": "bunx --bun prettier --write . ", "build": "bun ./src/bin/index.ts", "prepublishOnly": "bun run build" }, diff --git a/nodedevpkg/monobundle/src/autoExternal.ts b/nodedevpkg/monobundle/src/autoExternal.ts index 19984b2..484e589 100644 --- a/nodedevpkg/monobundle/src/autoExternal.ts +++ b/nodedevpkg/monobundle/src/autoExternal.ts @@ -8,187 +8,187 @@ import type { Project } from "./pm"; const builtIns = process.binding("natives"); const isPkgUsed = (pkg: string, id: string) => { - return id === pkg || `@types/${id}` === pkg || id.startsWith(`${pkg}/`); + return id === pkg || `@types/${id}` === pkg || id.startsWith(`${pkg}/`); }; export type Package = { - name: string; - dependencies?: Record; - peerDependencies?: Record; + name: string; + dependencies?: Record; + peerDependencies?: Record; }; export const loadWorkspace = async (project: Project, localPkg: Package) => { - const workspaces = await project.pm.workspaces(project.root); - - const m = new Map>(); - - if (workspaces) { - const packageJSONs = await globby( - workspaces.map((b) => `${b}/package.json`), - { - cwd: project.root, - }, - ); - - for (const f of packageJSONs) { - let pkg = JSON.parse( - String(await readFile(join(`${project.root}`, f))), - ) as Package; - - // localPkg may be changed - if (localPkg.name === pkg.name) { - pkg = localPkg; - } - - const dep = new Set(); - - if (pkg.name) { - dep.add(pkg.name); - } - - if (pkg.dependencies) { - for (const d in pkg.dependencies) { - dep.add(d); - } - } - - if (pkg.peerDependencies) { - for (const d in pkg.peerDependencies) { - dep.add(d); - } - } - - m.set(pkg.name, dep); - } - } - - return m; + const workspaces = await project.pm.workspaces(project.root); + + const m = new Map>(); + + if (workspaces) { + const packageJSONs = await globby( + workspaces.map((b) => `${b}/package.json`), + { + cwd: project.root, + }, + ); + + for (const f of packageJSONs) { + let pkg = JSON.parse( + String(await readFile(join(`${project.root}`, f))), + ) as Package; + + // localPkg may be changed + if (localPkg.name === pkg.name) { + pkg = localPkg; + } + + const dep = new Set(); + + if (pkg.name) { + dep.add(pkg.name); + } + + if (pkg.dependencies) { + for (const d in pkg.dependencies) { + dep.add(d); + } + } + + if (pkg.peerDependencies) { + for (const d in pkg.peerDependencies) { + dep.add(d); + } + } + + m.set(pkg.name, dep); + } + } + + return m; }; export const createAutoExternal = async ( - project: Project, - pkg: Package, - opts: { - logger?: ReturnType; - sideDeps?: string[]; - }, + project: Project, + pkg: Package, + opts: { + logger?: ReturnType; + sideDeps?: string[]; + }, ) => { - const logger = opts.logger; - const sideDeps = opts.sideDeps || []; - - const isSideDep = (pkgName: string) => { - if (sideDeps.length === 0) { - return false; - } - return sideDeps.some( - (glob) => pkgName === glob || minimatch(pkgName, glob), - ); - }; - - const usedPkgs = new Set(); - - const w = await loadWorkspace(project, pkg); - - const dep = new Set(); - - const collect = (pkgName: string) => { - const pkgDep = w.get(pkgName); - - if (pkgDep) { - for (const d of pkgDep) { - dep.add(d); - - if (d !== pkgName) { - collect(d); - } - } - } - }; - - collect(pkg.name); - - const builtins = Object.keys(builtIns); - - const warningAndGetUnused = () => { - const used = [...usedPkgs.keys()]; - - const unused = { - deps: {} as { [k: string]: boolean }, - peerDeps: {} as { [k: string]: boolean }, - }; - - for (const d of dep) { - if (isSideDep(d)) { - continue; - } - - if (!used.some((id) => isPkgUsed(d, id))) { - unused.deps[d] = true; - unused.peerDeps[d] = true; - } - } - - return unused; - }; - - const collector = new Set(); - - const autoExternal = (validate = true) => { - return { - name: "auto-external", - - options(opts: InputOptions) { - return { - ...opts, - external( - id: string, - importer: string | undefined, - isResolved: boolean, - ) { - if ( - typeof opts.external === "function" && - opts.external(id, importer, isResolved) - ) { - return true; - } - - if (Array.isArray(opts.external) && opts.external.includes(id)) { - return true; - } - - if (!(id.startsWith(".") || id.startsWith("/"))) { - const isDep = [...dep.keys()].some((d) => id.startsWith(d)); - const isBuiltIn = builtins.some((b) => id.startsWith(b)); - - if (isDep) { - usedPkgs.add(id); - } - - if (isBuiltIn || isDep) { - return true; - } - - if (validate) { - if (!collector.has(id)) { - collector.add(id); - - logger?.danger( - `"${id}" is not in dependencies or peerDependencies, and will be bundled.`, - ); - } - } - - return false; - } - - return false; - }, - }; - }, - }; - }; - - autoExternal.warningAndGetUnused = warningAndGetUnused; - - return autoExternal; + const logger = opts.logger; + const sideDeps = opts.sideDeps || []; + + const isSideDep = (pkgName: string) => { + if (sideDeps.length === 0) { + return false; + } + return sideDeps.some( + (glob) => pkgName === glob || minimatch(pkgName, glob), + ); + }; + + const usedPkgs = new Set(); + + const w = await loadWorkspace(project, pkg); + + const dep = new Set(); + + const collect = (pkgName: string) => { + const pkgDep = w.get(pkgName); + + if (pkgDep) { + for (const d of pkgDep) { + dep.add(d); + + if (d !== pkgName) { + collect(d); + } + } + } + }; + + collect(pkg.name); + + const builtins = Object.keys(builtIns); + + const warningAndGetUnused = () => { + const used = [...usedPkgs.keys()]; + + const unused = { + deps: {} as { [k: string]: boolean }, + peerDeps: {} as { [k: string]: boolean }, + }; + + for (const d of dep) { + if (isSideDep(d)) { + continue; + } + + if (!used.some((id) => isPkgUsed(d, id))) { + unused.deps[d] = true; + unused.peerDeps[d] = true; + } + } + + return unused; + }; + + const collector = new Set(); + + const autoExternal = (validate = true) => { + return { + name: "auto-external", + + options(opts: InputOptions) { + return { + ...opts, + external( + id: string, + importer: string | undefined, + isResolved: boolean, + ) { + if ( + typeof opts.external === "function" && + opts.external(id, importer, isResolved) + ) { + return true; + } + + if (Array.isArray(opts.external) && opts.external.includes(id)) { + return true; + } + + if (!(id.startsWith(".") || id.startsWith("/"))) { + const isDep = [...dep.keys()].some((d) => id.startsWith(d)); + const isBuiltIn = builtins.some((b) => id.startsWith(b)); + + if (isDep) { + usedPkgs.add(id); + } + + if (isBuiltIn || isDep) { + return true; + } + + if (validate) { + if (!collector.has(id)) { + collector.add(id); + + logger?.danger( + `"${id}" is not in dependencies or peerDependencies, and will be bundled.`, + ); + } + } + + return false; + } + + return false; + }, + }; + }, + }; + }; + + autoExternal.warningAndGetUnused = warningAndGetUnused; + + return autoExternal; }; diff --git a/nodedevpkg/monobundle/src/bin/index.ts b/nodedevpkg/monobundle/src/bin/index.ts index 07585e1..f756154 100644 --- a/nodedevpkg/monobundle/src/bin/index.ts +++ b/nodedevpkg/monobundle/src/bin/index.ts @@ -2,16 +2,16 @@ import yargs from "yargs"; import { bundle } from "../bundle"; (async () => { - const opt = await yargs(process.argv.slice(2)).option("dryRun", { - alias: "dry-run", - type: "boolean", - }).argv; + const opt = await yargs(process.argv.slice(2)).option("dryRun", { + alias: "dry-run", + type: "boolean", + }).argv; - await bundle({ - ...opt, - ...(opt._.length > 0 ? { cwd: opt._[0] } : {}), - } as any); + await bundle({ + ...opt, + ...(opt._.length > 0 ? { cwd: opt._[0] } : {}), + } as any); })().catch((err) => { - console.error(err); - process.exit(1); + console.error(err); + process.exit(1); }); diff --git a/nodedevpkg/monobundle/src/bootstrap.ts b/nodedevpkg/monobundle/src/bootstrap.ts index 0b0e2cd..e6e9b1e 100644 --- a/nodedevpkg/monobundle/src/bootstrap.ts +++ b/nodedevpkg/monobundle/src/bootstrap.ts @@ -6,139 +6,139 @@ import { readFile, writeFile } from "fs/promises"; import { globby } from "globby"; import type { Project } from "./pm"; import { - type MonoBundleOptions, - entryAlias, - writeFormattedJsonFile, + type MonoBundleOptions, + entryAlias, + writeFormattedJsonFile, } from "./util"; const imlFromPackageJSON = (rpath: string, pkg: any) => { - return join(rpath, `${pkg.name.replace("/", "__")}.iml`); + return join(rpath, `${pkg.name.replace("/", "__")}.iml`); }; const patchRootPackage = async ( - project: Project, - pkgs: { [k: string]: any }, + project: Project, + pkgs: { [k: string]: any }, ) => { - await writeFile( - join(project.root, ".idea/modules.xml"), - ` + await writeFile( + join(project.root, ".idea/modules.xml"), + ` ${map(pkgs, (pkg, dir) => { - const filename = join( - "$PROJECT_DIR$", - imlFromPackageJSON(relative(project.root, dir), pkg), - ); - return ``; + const filename = join( + "$PROJECT_DIR$", + imlFromPackageJSON(relative(project.root, dir), pkg), + ); + return ``; }).join("\n")} `, - ); + ); }; const orderKeys = (o: T) => { - const orderedKeys = [ - "name", - "version", - "monobundle", - "dependencies", - "peerDependencies", - "devDependencies", - ...keys(o).sort(), - ]; - return pick(o, orderedKeys); + const orderedKeys = [ + "name", + "version", + "monobundle", + "dependencies", + "peerDependencies", + "devDependencies", + ...keys(o).sort(), + ]; + return pick(o, orderedKeys); }; const getExportsAndBin = (options?: MonoBundleOptions) => { - const pkg = {} as { bin?: {}; exports?: {} }; - - forEach(options?.exports, (entryFile, e) => { - const distName = entryAlias(e); - - if (startsWith(e, "bin:")) { - set(pkg, ["bin", distName], `./${distName}.mjs`); - return; - } - - set(pkg, ["exports", e], { - // bun must on first - bun: entryFile, - import: { - types: `./${distName}.d.ts`, - default: `./${distName}.mjs`, - }, - }); - }); - - return pkg; + const pkg = {} as { bin?: {}; exports?: {} }; + + forEach(options?.exports, (entryFile, e) => { + const distName = entryAlias(e); + + if (startsWith(e, "bin:")) { + set(pkg, ["bin", distName], `./${distName}.mjs`); + return; + } + + set(pkg, ["exports", e], { + // bun must on first + bun: entryFile, + import: { + types: `./${distName}.d.ts`, + default: `./${distName}.mjs`, + }, + }); + }); + + return pkg; }; const patchMonoPackage = async ( - project: Project, - monoRoot: string, - directory: string, - pkg: any, - rootPkg: any, + project: Project, + monoRoot: string, + directory: string, + pkg: any, + rootPkg: any, ) => { - const defaultScripts = project.pm.defaults().scripts; - - const scripts = { - ...(pkg.scripts || {}), - }; - - if (get(pkg, ["monobundle"])) { - scripts.lint = get( - pkg, - ["monobundle", "pipeline", "lint"], - defaultScripts.lint, - ); - scripts.build = - get(pkg, ["monobundle", "pipeline", "build"], defaultScripts.build) || - undefined; - scripts.test = - get(pkg, ["monobundle", "pipeline", "test"], defaultScripts.test) || - undefined; - scripts.prepublishOnly = scripts.build - ? `${project.pm.bin.run} build` - : undefined; - } - - const exportsAndBin = getExportsAndBin(get(pkg, ["monobundle"])); - - await writeFormattedJsonFile( - join(monoRoot, "package.json"), - orderKeys({ - ...pkg, - ...exportsAndBin, - scripts, - type: "module", - license: "MIT", - repository: rootPkg.repository - ? { - ...rootPkg.repository, - directory, - } - : undefined, - publishConfig: - !pkg.private && rootPkg.publishConfig - ? { - ...rootPkg.publishConfig, - } - : undefined, - }), - ); + const defaultScripts = project.pm.defaults().scripts; + + const scripts = { + ...(pkg.scripts || {}), + }; + + if (get(pkg, ["monobundle"])) { + scripts.lint = get( + pkg, + ["monobundle", "pipeline", "lint"], + defaultScripts.lint, + ); + scripts.build = + get(pkg, ["monobundle", "pipeline", "build"], defaultScripts.build) || + undefined; + scripts.test = + get(pkg, ["monobundle", "pipeline", "test"], defaultScripts.test) || + undefined; + scripts.prepublishOnly = scripts.build + ? `${project.pm.bin.run} build` + : undefined; + } + + const exportsAndBin = getExportsAndBin(get(pkg, ["monobundle"])); + + await writeFormattedJsonFile( + join(monoRoot, "package.json"), + orderKeys({ + ...pkg, + ...exportsAndBin, + scripts, + type: "module", + license: "MIT", + repository: rootPkg.repository + ? { + ...rootPkg.repository, + directory, + } + : undefined, + publishConfig: + !pkg.private && rootPkg.publishConfig + ? { + ...rootPkg.publishConfig, + } + : undefined, + }), + ); }; export const addImiFile = async (monoRoot: string, pkg: any) => { - const isGoMod = existsSync(join(monoRoot, "go.mod")); - const isCueMod = existsSync(join(monoRoot, "cue.mod")); + const isGoMod = existsSync(join(monoRoot, "go.mod")); + const isCueMod = existsSync(join(monoRoot, "cue.mod")); - await writeFile( - join(monoRoot, `${imlFromPackageJSON("", pkg)}`), - ` + await writeFile( + join(monoRoot, `${imlFromPackageJSON("", pkg)}`), + ` ${isGoMod ? `` : ""} @@ -150,60 +150,60 @@ export const addImiFile = async (monoRoot: string, pkg: any) => { ${ - isCueMod - ? ` + isCueMod + ? ` ` - : "" - } + : "" + } `, - ); + ); }; export const bootstrap = async (project: Project) => { - if (process.env["CI"] && process.env["CI"] !== "0") { - return; - } - - const workspaces = await project.pm.workspaces(project.root); - - const packageJsonFiles = await globby( - [ - `${project.root}/package.json`, - ...workspaces.map((p) => `${p}/package.json`), - ], - { - cwd: project.root, - absolute: true, - }, - ); - - const packages: { [k: string]: any } = {}; - - for (const p of packageJsonFiles) { - const packageJSON = JSON.parse(String(await readFile(p))); - - const monoRoot = dirname(p); - const rpath = relative(project.root, monoRoot); - - packages[rpath] = packageJSON; - - if (rpath) { - await patchMonoPackage( - project, - monoRoot, - rpath, - packageJSON, - packages[""], - ); - } - - await addImiFile(monoRoot, packageJSON); - } - - await patchRootPackage(project, packages); + if (process.env["CI"] && process.env["CI"] !== "0") { + return; + } + + const workspaces = await project.pm.workspaces(project.root); + + const packageJsonFiles = await globby( + [ + `${project.root}/package.json`, + ...workspaces.map((p) => `${p}/package.json`), + ], + { + cwd: project.root, + absolute: true, + }, + ); + + const packages: { [k: string]: any } = {}; + + for (const p of packageJsonFiles) { + const packageJSON = JSON.parse(String(await readFile(p))); + + const monoRoot = dirname(p); + const rpath = relative(project.root, monoRoot); + + packages[rpath] = packageJSON; + + if (rpath) { + await patchMonoPackage( + project, + monoRoot, + rpath, + packageJSON, + packages[""], + ); + } + + await addImiFile(monoRoot, packageJSON); + } + + await patchRootPackage(project, packages); }; diff --git a/nodedevpkg/monobundle/src/bundle.ts b/nodedevpkg/monobundle/src/bundle.ts index 523fe0d..cf48da5 100644 --- a/nodedevpkg/monobundle/src/bundle.ts +++ b/nodedevpkg/monobundle/src/bundle.ts @@ -1,11 +1,11 @@ import { basename, dirname, extname, join, relative } from "path"; import { - has, - isEmpty, - keys, - map, - mapKeys, - mapValues, + has, + isEmpty, + keys, + map, + mapKeys, + mapValues, } from "@innoai-tech/lodash"; import commonjs from "@rollup/plugin-commonjs"; import { nodeResolve } from "@rollup/plugin-node-resolve"; @@ -22,9 +22,9 @@ import { patchShebang } from "./patchShebang"; import { resolveProjectRoot } from "./pm"; import { tsc } from "./tsc"; import { - type MonoBundleOptions, - entryAlias, - writeFormattedJsonFile, + type MonoBundleOptions, + entryAlias, + writeFormattedJsonFile, } from "./util"; const tsconfigFile = "tsconfig.monobundle.json"; @@ -32,197 +32,197 @@ const tsconfigFile = "tsconfig.monobundle.json"; type ResolveRollupOptions = () => Promise; export const bundle = async ({ - cwd = process.cwd(), - dryRun, + cwd = process.cwd(), + dryRun, }: { - cwd?: string; - dryRun?: boolean; + cwd?: string; + dryRun?: boolean; }) => { - const project = resolveProjectRoot(cwd); + const project = resolveProjectRoot(cwd); - if (!project) { - throw new Error("must run in some monorepo"); - } + if (!project) { + throw new Error("must run in some monorepo"); + } - if (project.root === cwd) { - return await bootstrap(project); - } + if (project.root === cwd) { + return await bootstrap(project); + } - const pkg = JSON.parse(String(await readFile(join(cwd, "package.json")))) as { - [k: string]: any; - }; + const pkg = JSON.parse(String(await readFile(join(cwd, "package.json")))) as { + [k: string]: any; + }; - // skip if monobundle not defined - if (!(has(pkg, ["monobundle"]) && pkg["monobundle"].exports)) { - return; - } + // skip if monobundle not defined + if (!(has(pkg, ["monobundle"]) && pkg["monobundle"].exports)) { + return; + } - await writeFile( - join(cwd, ".gitignore"), - ` + await writeFile( + join(cwd, ".gitignore"), + ` .turbo/ target/ dist/ *.mjs *.d.ts `, - ); - - const options: MonoBundleOptions = pkg["monobundle"] || {}; - - const logger = createLogger(pkg["name"]); - - const inputs = mapValues( - mapKeys(options.exports, (_, k) => { - return entryAlias(k); - }), - (entry, _) => join(cwd, entry), - ); - - const outputBase: OutputOptions = { - dir: cwd, - format: "es", - }; - - pkg["peerDependencies"] = { - ...(pkg["peerDependencies"] ?? {}), - "core-js": "*", - }; - - const autoExternal = await createAutoExternal(project, pkg as any, { - logger, - sideDeps: options["sideDeps"] as any, - }); - - const buildTargets = getBuildTargets( - (pkg as any).browserslist ?? ["defaults"], - ); - - const resolveRollupOptions: ResolveRollupOptions[] = [ - () => { - return Promise.resolve({ - input: inputs, - output: { - ...outputBase, - entryFileNames: "[name].mjs", - chunkFileNames: "[name]-[hash].mjs", - }, - plugins: [ - autoExternal(), - nodeResolve({ - extensions: [".ts", ".tsx", ".mjs", "", ".js", ".jsx"], - }), - commonjs(), - esbuild({ - tsconfig: tsconfigFile, - target: map(buildTargets, (v, k) => `${k}${v}`), - }), - patchShebang((chunkName) => { - return !!options.exports?.[ - `bin:${basename(chunkName, extname(chunkName))}` - ]; - }, options.engine), - ], - }); - }, - - async () => { - const files = await globby(["*.mjs", "*.d.ts"]); - - for (const f of files) { - if (outputFiles[f]) { - continue; - } - await unlink(join(cwd, f)); - } - - await tsc(cwd, ".turbo/types", tsconfigFile); - - const indexForDts = mapValues(inputs, (input) => { - const f = join(cwd, ".turbo/types", relative(join(cwd, "src"), input)); - return `${join(dirname(f), basename(f, extname(f)))}.d.ts`; - }); - - return { - input: indexForDts, - output: { - ...outputBase, - entryFileNames: "[name].d.ts", - chunkFileNames: "[name]-[hash].d.ts", - }, - plugins: [ - autoExternal(), - dts({ - tsconfig: tsconfigFile, - respectExternal: true, - }) as any, - ], - }; - }, - ]; - - logger.warning(`bundling (target: ${JSON.stringify(buildTargets)})`); - - const outputFiles: { [k: string]: boolean } = {}; - - for (const resolveRollupOption of resolveRollupOptions) { - const rollupOption = await resolveRollupOption(); - - const files = await rollup(rollupOption).then((bundle) => { - return Promise.all( - ([] as OutputOptions[]) - .concat(rollupOption.output ?? []) - .map((output) => { - if (dryRun) { - return []; - } - return bundle.write(output).then((ret) => { - if (output.dir) { - return (ret.output || []).map((o) => - join(relative(cwd, output.dir ?? ""), o.fileName), - ); - } - return relative(cwd, output.file ?? ""); - }); - }), - ); - }); - - for (const f of files.flat()) { - outputFiles[f] = true; - } - } - - logger.success("bundled", ...keys(outputFiles)); - - const unused = autoExternal.warningAndGetUnused(); - - for (const dep in unused.peerDeps) { - pkg["peerDependencies"][dep] = undefined; - } - - for (const dep in unused.deps) { - pkg["dependencies"][dep] = undefined; - } - - await writeFormattedJsonFile(join(cwd, "package.json"), { - ...pkg, - dependencies: isEmpty(pkg["dependencies"]) - ? undefined - : (pkg["dependencies"] as { [k: string]: string }), - peerDependencies: isEmpty(pkg["peerDependencies"]) - ? undefined - : (pkg["peerDependencies"] as { [k: string]: string }), - devDependencies: isEmpty(pkg["devDependencies"]) - ? undefined - : (pkg["devDependencies"] as { [k: string]: string }), - files: ["*.mjs", "*.d.ts", "src/*", "!/**/__tests__"], - type: "module", - // FIXME remote all old entries - types: undefined, - main: undefined, - module: undefined, - }); - - return; + ); + + const options: MonoBundleOptions = pkg["monobundle"] || {}; + + const logger = createLogger(pkg["name"]); + + const inputs = mapValues( + mapKeys(options.exports, (_, k) => { + return entryAlias(k); + }), + (entry, _) => join(cwd, entry), + ); + + const outputBase: OutputOptions = { + dir: cwd, + format: "es", + }; + + pkg["peerDependencies"] = { + ...(pkg["peerDependencies"] ?? {}), + "core-js": "*", + }; + + const autoExternal = await createAutoExternal(project, pkg as any, { + logger, + sideDeps: options["sideDeps"] as any, + }); + + const buildTargets = getBuildTargets( + (pkg as any).browserslist ?? ["defaults"], + ); + + const resolveRollupOptions: ResolveRollupOptions[] = [ + () => { + return Promise.resolve({ + input: inputs, + output: { + ...outputBase, + entryFileNames: "[name].mjs", + chunkFileNames: "[name]-[hash].mjs", + }, + plugins: [ + autoExternal(), + nodeResolve({ + extensions: [".ts", ".tsx", ".mjs", "", ".js", ".jsx"], + }), + commonjs(), + esbuild({ + tsconfig: tsconfigFile, + target: map(buildTargets, (v, k) => `${k}${v}`), + }), + patchShebang((chunkName) => { + return !!options.exports?.[ + `bin:${basename(chunkName, extname(chunkName))}` + ]; + }, options.engine), + ], + }); + }, + + async () => { + const files = await globby(["*.mjs", "*.d.ts"]); + + for (const f of files) { + if (outputFiles[f]) { + continue; + } + await unlink(join(cwd, f)); + } + + await tsc(cwd, ".turbo/types", tsconfigFile); + + const indexForDts = mapValues(inputs, (input) => { + const f = join(cwd, ".turbo/types", relative(join(cwd, "src"), input)); + return `${join(dirname(f), basename(f, extname(f)))}.d.ts`; + }); + + return { + input: indexForDts, + output: { + ...outputBase, + entryFileNames: "[name].d.ts", + chunkFileNames: "[name]-[hash].d.ts", + }, + plugins: [ + autoExternal(), + dts({ + tsconfig: tsconfigFile, + respectExternal: true, + }) as any, + ], + }; + }, + ]; + + logger.warning(`bundling (target: ${JSON.stringify(buildTargets)})`); + + const outputFiles: { [k: string]: boolean } = {}; + + for (const resolveRollupOption of resolveRollupOptions) { + const rollupOption = await resolveRollupOption(); + + const files = await rollup(rollupOption).then((bundle) => { + return Promise.all( + ([] as OutputOptions[]) + .concat(rollupOption.output ?? []) + .map((output) => { + if (dryRun) { + return []; + } + return bundle.write(output).then((ret) => { + if (output.dir) { + return (ret.output || []).map((o) => + join(relative(cwd, output.dir ?? ""), o.fileName), + ); + } + return relative(cwd, output.file ?? ""); + }); + }), + ); + }); + + for (const f of files.flat()) { + outputFiles[f] = true; + } + } + + logger.success("bundled", ...keys(outputFiles)); + + const unused = autoExternal.warningAndGetUnused(); + + for (const dep in unused.peerDeps) { + pkg["peerDependencies"][dep] = undefined; + } + + for (const dep in unused.deps) { + pkg["dependencies"][dep] = undefined; + } + + await writeFormattedJsonFile(join(cwd, "package.json"), { + ...pkg, + dependencies: isEmpty(pkg["dependencies"]) + ? undefined + : (pkg["dependencies"] as { [k: string]: string }), + peerDependencies: isEmpty(pkg["peerDependencies"]) + ? undefined + : (pkg["peerDependencies"] as { [k: string]: string }), + devDependencies: isEmpty(pkg["devDependencies"]) + ? undefined + : (pkg["devDependencies"] as { [k: string]: string }), + files: ["*.mjs", "*.d.ts", "src/*", "!/**/__tests__"], + type: "module", + // FIXME remote all old entries + types: undefined, + main: undefined, + module: undefined, + }); + + return; }; diff --git a/nodedevpkg/monobundle/src/esbuild.ts b/nodedevpkg/monobundle/src/esbuild.ts index 178e633..5bb7762 100644 --- a/nodedevpkg/monobundle/src/esbuild.ts +++ b/nodedevpkg/monobundle/src/esbuild.ts @@ -5,101 +5,101 @@ import type { Plugin } from "rollup"; import ts from "typescript"; const defaultLoaders: { [ext: string]: Loader } = { - ".js": "js", - ".jsx": "jsx", - ".ts": "ts", - ".tsx": "tsx", + ".js": "js", + ".jsx": "jsx", + ".ts": "ts", + ".tsx": "tsx", }; type CompilerOptions = { - alwaysStrict?: boolean; - importsNotUsedAsValues?: string; - jsx?: string; - jsxFactory?: string; - jsxFragmentFactory?: string; - jsxImportSource?: string; - preserveValueImports?: boolean; - target?: string; - useDefineForClassFields?: boolean; + alwaysStrict?: boolean; + importsNotUsedAsValues?: string; + jsx?: string; + jsxFactory?: string; + jsxFragmentFactory?: string; + jsxImportSource?: string; + preserveValueImports?: boolean; + target?: string; + useDefineForClassFields?: boolean; }; const loadTsCompilerOptions = ( - cwd: string, - tsconfigFile: string, + cwd: string, + tsconfigFile: string, ): CompilerOptions => { - const configFileName = ts.findConfigFile( - cwd, - ts.sys.fileExists, - tsconfigFile, - ); + const configFileName = ts.findConfigFile( + cwd, + ts.sys.fileExists, + tsconfigFile, + ); - if (configFileName) { - const o = ts.parseJsonConfigFileContent( - ts.readConfigFile(configFileName, ts.sys.readFile).config, - ts.sys, - cwd, - ).options; + if (configFileName) { + const o = ts.parseJsonConfigFileContent( + ts.readConfigFile(configFileName, ts.sys.readFile).config, + ts.sys, + cwd, + ).options; - return { - alwaysStrict: o.alwaysStrict, - jsxFactory: o.jsxFactory, - jsxFragmentFactory: o.jsxFragmentFactory, - jsxImportSource: o.jsxImportSource, - preserveValueImports: o.preserveValueImports, - useDefineForClassFields: o.useDefineForClassFields, - target: o.target ? toLower(ts.ScriptTarget[o.target]) : undefined, - importsNotUsedAsValues: o.importsNotUsedAsValues - ? toLower(ts.ImportsNotUsedAsValues[o.importsNotUsedAsValues]) - : undefined, - jsx: o.jsx ? kebabCase(ts.JsxEmit[o.jsx]) : undefined, - } as CompilerOptions; - } + return { + alwaysStrict: o.alwaysStrict, + jsxFactory: o.jsxFactory, + jsxFragmentFactory: o.jsxFragmentFactory, + jsxImportSource: o.jsxImportSource, + preserveValueImports: o.preserveValueImports, + useDefineForClassFields: o.useDefineForClassFields, + target: o.target ? toLower(ts.ScriptTarget[o.target]) : undefined, + importsNotUsedAsValues: o.importsNotUsedAsValues + ? toLower(ts.ImportsNotUsedAsValues[o.importsNotUsedAsValues]) + : undefined, + jsx: o.jsx ? kebabCase(ts.JsxEmit[o.jsx]) : undefined, + } as CompilerOptions; + } - return {}; + return {}; }; export const esbuild = ({ - loaders, - tsconfig, - ...options + loaders, + tsconfig, + ...options }: TransformOptions & { - tsconfig: string; - loaders?: Record; + tsconfig: string; + loaders?: Record; }): Plugin => { - const cwd = process.cwd(); + const cwd = process.cwd(); - const compilerOptions = loadTsCompilerOptions(cwd, tsconfig); + const compilerOptions = loadTsCompilerOptions(cwd, tsconfig); - const allLoaders = { - ...defaultLoaders, - ...loaders, - }; + const allLoaders = { + ...defaultLoaders, + ...loaders, + }; - return { - name: "monobundle/esbuild", + return { + name: "monobundle/esbuild", - async transform(code, id) { - const ext = extname(id); - const loader = allLoaders[ext]; + async transform(code, id) { + const ext = extname(id); + const loader = allLoaders[ext]; - if (!loader) { - return null; - } + if (!loader) { + return null; + } - const result = await transform(code, { - ...options, - tsconfigRaw: { compilerOptions: compilerOptions as any }, - loader, - target: options.target || "defaults", - sourcefile: id, - }); + const result = await transform(code, { + ...options, + tsconfigRaw: { compilerOptions: compilerOptions as any }, + loader, + target: options.target || "defaults", + sourcefile: id, + }); - return ( - result.code && { - code: result.code, - map: result.map || null, - } - ); - }, - }; + return ( + result.code && { + code: result.code, + map: result.map || null, + } + ); + }, + }; }; diff --git a/nodedevpkg/monobundle/src/getTarget.ts b/nodedevpkg/monobundle/src/getTarget.ts index 505ba8e..ed77a65 100644 --- a/nodedevpkg/monobundle/src/getTarget.ts +++ b/nodedevpkg/monobundle/src/getTarget.ts @@ -1,30 +1,30 @@ import browserslist from "browserslist"; const SUPPORTED_BUILD_TARGETS = [ - "es", - "node", - "chrome", - "edge", - "firefox", - "ios", - "safari", + "es", + "node", + "chrome", + "edge", + "firefox", + "ios", + "safari", ]; export function getBuildTargets(target: string | string[]) { - const getEveryTar = browserslist(target).reverse(); + const getEveryTar = browserslist(target).reverse(); - const sep = " "; + const sep = " "; - const targets: Record = {}; + const targets: Record = {}; - for (const tar of getEveryTar) { - for (const selTar of SUPPORTED_BUILD_TARGETS) { - const parts = tar.split(sep) as [string, string]; - if (tar.startsWith(selTar + sep) && !targets[parts[0]]) { - targets[parts[0]] = parts[1]; - } - } - } + for (const tar of getEveryTar) { + for (const selTar of SUPPORTED_BUILD_TARGETS) { + const parts = tar.split(sep) as [string, string]; + if (tar.startsWith(selTar + sep) && !targets[parts[0]]) { + targets[parts[0]] = parts[1]; + } + } + } - return targets; + return targets; } diff --git a/nodedevpkg/monobundle/src/log.ts b/nodedevpkg/monobundle/src/log.ts index 94ca2ed..700c7a4 100644 --- a/nodedevpkg/monobundle/src/log.ts +++ b/nodedevpkg/monobundle/src/log.ts @@ -1,18 +1,18 @@ import chalk from "chalk"; export const createLogger = (name: string) => { - return { - info: (...args: any[]) => { - console.log(`[${name}]`, ...args); - }, - success: (...args: any[]) => { - console.log(`[${name}]`, chalk.green(...args)); - }, - warning: (...args: any[]) => { - console.log(`[${name}]`, chalk.yellow(...args)); - }, - danger: (...args: any[]) => { - console.log(`[${name}]`, chalk.red(...args)); - }, - }; + return { + info: (...args: any[]) => { + console.log(`[${name}]`, ...args); + }, + success: (...args: any[]) => { + console.log(`[${name}]`, chalk.green(...args)); + }, + warning: (...args: any[]) => { + console.log(`[${name}]`, chalk.yellow(...args)); + }, + danger: (...args: any[]) => { + console.log(`[${name}]`, chalk.red(...args)); + }, + }; }; diff --git a/nodedevpkg/monobundle/src/patchShebang.ts b/nodedevpkg/monobundle/src/patchShebang.ts index c8dd9f1..55b2fd9 100644 --- a/nodedevpkg/monobundle/src/patchShebang.ts +++ b/nodedevpkg/monobundle/src/patchShebang.ts @@ -1,19 +1,19 @@ import type { Plugin } from "rollup"; export const patchShebang = ( - isBin: (fileName: string) => boolean, - engine = "node", + isBin: (fileName: string) => boolean, + engine = "node", ): Plugin => { - return { - name: "monobundle/patch-shebang", - async renderChunk(code: string, c) { - if (isBin(c.fileName)) { - return `#!/usr/bin/env ${engine} + return { + name: "monobundle/patch-shebang", + async renderChunk(code: string, c) { + if (isBin(c.fileName)) { + return `#!/usr/bin/env ${engine} ${code}`; - } + } - return null; - }, - }; + return null; + }, + }; }; diff --git a/nodedevpkg/monobundle/src/pm.ts b/nodedevpkg/monobundle/src/pm.ts index d583c96..74927b5 100644 --- a/nodedevpkg/monobundle/src/pm.ts +++ b/nodedevpkg/monobundle/src/pm.ts @@ -4,96 +4,96 @@ import { readFile } from "fs/promises"; import { load as loadYAML } from "js-yaml"; export interface ProjectManager { - bin: { - main: string; - run: string; - exec: string; - }; - isProjectRoot: (p: string) => boolean; - workspaces: (p: string) => Promise; - defaults: () => { - scripts: { - build?: string; - lint?: string; - test?: string; - }; - }; + bin: { + main: string; + run: string; + exec: string; + }; + isProjectRoot: (p: string) => boolean; + workspaces: (p: string) => Promise; + defaults: () => { + scripts: { + build?: string; + lint?: string; + test?: string; + }; + }; } const projectManagers: { [name: string]: ProjectManager } = { - bun: { - bin: { - main: "bun", - run: "bun run", - exec: "bunx", - }, - isProjectRoot: (p: string) => { - return ( - existsSync(join(p, "./bunfig.toml")) || - existsSync(join(p, "./bun.lockb")) - ); - }, - workspaces: async (root: string) => { - const packageJSON = JSON.parse( - String(await readFile(join(root, "./package.json"))), - ) as { workspaces?: string[] }; + bun: { + bin: { + main: "bun", + run: "bun run", + exec: "bunx", + }, + isProjectRoot: (p: string) => { + return ( + existsSync(join(p, "./bunfig.toml")) || + existsSync(join(p, "./bun.lockb")) + ); + }, + workspaces: async (root: string) => { + const packageJSON = JSON.parse( + String(await readFile(join(root, "./package.json"))), + ) as { workspaces?: string[] }; - return packageJSON.workspaces ?? []; - }, - defaults: () => { - return { - scripts: { - build: "bunx --bun monobundle", - lint: "bunx --bun @biomejs/biome check --apply .", - }, - }; - }, - }, - pnpm: { - bin: { - main: "pnpm", - run: "pnpm run", - exec: "pnpm exec", - }, - isProjectRoot: (p: string) => { - return existsSync(join(p, "./pnpm-workspace.yaml")); - }, - workspaces: async (root: string) => { - const workspaceConfig = loadYAML( - String(await readFile(join(root, "./pnpm-workspace.yaml"))), - ) as { packages?: string[] }; + return packageJSON.workspaces ?? []; + }, + defaults: () => { + return { + scripts: { + build: "bunx --bun monobundle", + lint: "bunx --bun prettier --write . ", + }, + }; + }, + }, + pnpm: { + bin: { + main: "pnpm", + run: "pnpm run", + exec: "pnpm exec", + }, + isProjectRoot: (p: string) => { + return existsSync(join(p, "./pnpm-workspace.yaml")); + }, + workspaces: async (root: string) => { + const workspaceConfig = loadYAML( + String(await readFile(join(root, "./pnpm-workspace.yaml"))), + ) as { packages?: string[] }; - return workspaceConfig.packages ?? []; - }, - defaults: () => { - return { - scripts: { - build: "monobundle", - lint: "biome check --apply .", - test: "vitest --run --passWithNoTests --dir .", - }, - }; - }, - }, + return workspaceConfig.packages ?? []; + }, + defaults: () => { + return { + scripts: { + build: "monobundle", + lint: "biome check --apply .", + test: "vitest --run --passWithNoTests --dir .", + }, + }; + }, + }, }; export interface Project { - root: string; - pm: ProjectManager; + root: string; + pm: ProjectManager; } export const resolveProjectRoot = (p: string): Project | null => { - for (const name in projectManagers) { - const pm = projectManagers[name] as ProjectManager; - if (pm.isProjectRoot(p)) { - return { - root: p, - pm: pm, - }; - } - } - if (existsSync(join(p, ".git"))) { - return null; - } - return resolveProjectRoot(join(p, "../")); + for (const name in projectManagers) { + const pm = projectManagers[name] as ProjectManager; + if (pm.isProjectRoot(p)) { + return { + root: p, + pm: pm, + }; + } + } + if (existsSync(join(p, ".git"))) { + return null; + } + return resolveProjectRoot(join(p, "../")); }; diff --git a/nodedevpkg/monobundle/src/tsc.ts b/nodedevpkg/monobundle/src/tsc.ts index 6452c8b..baed727 100644 --- a/nodedevpkg/monobundle/src/tsc.ts +++ b/nodedevpkg/monobundle/src/tsc.ts @@ -1,44 +1,44 @@ import { spawn } from "child_process"; export const tsc = async ( - projectRoot: string, - outDir: string, - tsconfig: string, + projectRoot: string, + outDir: string, + tsconfig: string, ): Promise => { - const ps = spawn( - "tsc", - [ - "--incremental", - "--emitDeclarationOnly", - "--baseUrl", - ".", - "--outDir", - outDir, - "-p", - tsconfig, - ], - { - cwd: projectRoot, - }, - ); + const ps = spawn( + "tsc", + [ + "--incremental", + "--emitDeclarationOnly", + "--baseUrl", + ".", + "--outDir", + outDir, + "-p", + tsconfig, + ], + { + cwd: projectRoot, + }, + ); - return new Promise((resolve, reject) => { - ps.stdout.on("data", (data) => { - if (data) { - reject(`${data}`); - } - }); + return new Promise((resolve, reject) => { + ps.stdout.on("data", (data) => { + if (data) { + reject(`${data}`); + } + }); - ps.stderr?.on("data", (data) => { - console.error(`${data}`); - }); + ps.stderr?.on("data", (data) => { + console.error(`${data}`); + }); - ps.on("close", (code) => { - if (code !== 0) { - reject(); - return; - } - resolve(); - }); - }); + ps.on("close", (code) => { + if (code !== 0) { + reject(); + return; + } + resolve(); + }); + }); }; diff --git a/nodedevpkg/monobundle/src/util.ts b/nodedevpkg/monobundle/src/util.ts index 9cf2dbc..564bc02 100644 --- a/nodedevpkg/monobundle/src/util.ts +++ b/nodedevpkg/monobundle/src/util.ts @@ -2,26 +2,26 @@ import { startsWith, trimStart } from "@innoai-tech/lodash"; import { writeFile } from "fs/promises"; export const writeFormattedJsonFile = async (path: string, v: any) => { - return await writeFile(path, `${JSON.stringify(v, null, 2)}\n`); + return await writeFile(path, `${JSON.stringify(v, null, 2)}\n`); }; export const entryAlias = (entry: string) => { - if (entry === ".") { - return "index"; - } - if (startsWith(entry, "bin:")) { - return entry.slice(4); - } - return trimStart(entry, "./"); + if (entry === ".") { + return "index"; + } + if (startsWith(entry, "bin:")) { + return entry.slice(4); + } + return trimStart(entry, "./"); }; export interface MonoBundleOptions { - pipeline: { - lint: string | boolean; - test: string | boolean; - build: string | boolean; - }; - engine?: string; - exports: { [k: string]: string }; - sideDeps: { [k: string]: string }; + pipeline: { + lint: string | boolean; + test: string | boolean; + build: string | boolean; + }; + engine?: string; + exports: { [k: string]: string }; + sideDeps: { [k: string]: string }; } diff --git a/nodedevpkg/monobundle/tsconfig.monobundle.json b/nodedevpkg/monobundle/tsconfig.monobundle.json index 245c0f5..2296be1 100644 --- a/nodedevpkg/monobundle/tsconfig.monobundle.json +++ b/nodedevpkg/monobundle/tsconfig.monobundle.json @@ -1,6 +1,6 @@ { - "extends": "@innoai-tech/devconfig/tsconfig.json", - "compilerOptions": { - "rootDir": "./src" - } + "extends": "@innoai-tech/devconfig/tsconfig.json", + "compilerOptions": { + "rootDir": "./src" + } } diff --git a/nodedevpkg/purebundle/Cargo.lock b/nodedevpkg/purebundle/Cargo.lock index ab3aa13..6ad3096 100644 --- a/nodedevpkg/purebundle/Cargo.lock +++ b/nodedevpkg/purebundle/Cargo.lock @@ -29,9 +29,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ "getrandom", "once_cell", @@ -58,21 +58,20 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" [[package]] name = "ast_node" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c09c69dffe06d222d072c878c3afe86eee2179806f20503faec97250268b4c24" +checksum = "c3e3e06ec6ac7d893a0db7127d91063ad7d9da8988f8a1a256f03729e6eec026" dependencies = [ - "pmutil", "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.38", + "syn 2.0.50", ] [[package]] @@ -109,9 +108,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.13.1" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "better_scoped_tls" @@ -130,9 +129,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "bitvec" @@ -168,9 +167,9 @@ dependencies = [ [[package]] name = "bytecheck_derive" -version = "0.6.11" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" dependencies = [ "proc-macro2", "quote", @@ -188,9 +187,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12024c4645c97566567129c204f65d5815a8c9aecf30fcbe682b2fe034996d36" +checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" dependencies = [ "serde", ] @@ -203,21 +202,32 @@ checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.20", + "semver 1.0.22", "serde", "serde_json", "thiserror", ] [[package]] -name = "cc" -version = "1.0.83" +name = "cargo_metadata" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ - "libc", + "camino", + "cargo-platform", + "semver 1.0.22", + "serde", + "serde_json", + "thiserror", ] +[[package]] +name = "cc" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9fa1897e4325be0d68d48df6aa1a71ac2ed4d27723887e7754192705350730" + [[package]] name = "cfg-if" version = "1.0.0" @@ -226,9 +236,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -245,9 +255,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "debugid" @@ -259,15 +269,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "deranged" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" -dependencies = [ - "powerfmt", -] - [[package]] name = "diff" version = "0.1.13" @@ -292,35 +293,21 @@ dependencies = [ [[package]] name = "either" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "enum-iterator" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7add3873b5dd076766ee79c8e406ad1a472c385476b9e38849f8eec24f1be689" -dependencies = [ - "enum-iterator-derive", -] +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] -name = "enum-iterator-derive" -version = "1.2.1" +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eecf8589574ce9b895052fa12d69af7a233f99e6107f5cb8dd1044f2a17bfdcb" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.38", -] +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.5" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", "windows-sys", @@ -334,23 +321,22 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] [[package]] name = "from_variant" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03ec5dc38ee19078d84a692b1c41181ff9f94331c76cee66ff0208c770b5e54f" +checksum = "3a0b11eeb173ce52f84ebd943d42e58813a2ebb78a6a3ff0a243b71c5199cd7b" dependencies = [ - "pmutil", "proc-macro2", "swc_macros_common", - "syn 2.0.38", + "syn 2.0.50", ] [[package]] @@ -371,32 +357,20 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "libc", "wasi", ] -[[package]] -name = "getset" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e45727250e75cc04ff2846a66397da8ef2b3db8e40e0cef4df67950a07621eb9" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "glob" @@ -413,6 +387,12 @@ dependencies = [ "ahash", ] +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + [[package]] name = "hermit-abi" version = "0.1.19" @@ -424,9 +404,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" [[package]] name = "hex" @@ -434,11 +414,24 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hstr" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17fafeca18cf0927e23ea44d7a5189c10536279dfe9094e0dfa953053fbb5377" +dependencies = [ + "new_debug_unreachable", + "once_cell", + "phf", + "rustc-hash", + "smallvec", +] + [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -452,38 +445,37 @@ checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" [[package]] name = "indexmap" -version = "1.9.3" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" dependencies = [ - "autocfg", - "hashbrown", + "equivalent", + "hashbrown 0.14.3", ] [[package]] name = "is-macro" -version = "0.3.0" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4467ed1321b310c2625c5aa6c1b1ffc5de4d9e42668cf697a08fb033ee8265e" +checksum = "59a85abdc13717906baccb5a1e435556ce0df215f242892f721dff62bf25288f" dependencies = [ "Inflector", - "pmutil", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.50", ] [[package]] name = "is_ci" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "lazy_static" @@ -493,21 +485,21 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.149" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "linux-raw-sys" -version = "0.4.10" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -530,9 +522,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "miette" @@ -567,9 +559,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] @@ -604,19 +596,18 @@ dependencies = [ [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] @@ -627,24 +618,24 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.3", + "hermit-abi 0.3.6", "libc", ] [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "overload" @@ -670,39 +661,38 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets", + "windows-targets 0.48.5", ] [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "phf" -version = "0.10.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ "phf_macros", "phf_shared", - "proc-macro-hack", ] [[package]] name = "phf_generator" -version = "0.10.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" dependencies = [ "phf_shared", "rand", @@ -710,23 +700,22 @@ dependencies = [ [[package]] name = "phf_macros" -version = "0.10.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" dependencies = [ "phf_generator", "phf_shared", - "proc-macro-hack", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.50", ] [[package]] name = "phf_shared" -version = "0.10.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" dependencies = [ "siphasher", ] @@ -745,27 +734,9 @@ checksum = "52a40bc70c2c58040d2d8b167ba9a5ff59fc9dab7ad44771cfde3dcfde7a09c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.50", ] -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "precomputed-hash" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" - [[package]] name = "pretty_assertions" version = "1.4.0" @@ -776,41 +747,11 @@ dependencies = [ "yansi", ] -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro-hack" -version = "0.5.20+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" - [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -856,9 +797,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -875,18 +816,6 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", "rand_core", ] @@ -895,28 +824,25 @@ name = "rand_core" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "regex" -version = "1.10.2" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.3", + "regex-automata 0.4.5", "regex-syntax 0.8.2", ] @@ -931,9 +857,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -954,15 +880,15 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "relative-path" -version = "1.9.0" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c707298afce11da2efef2f600116fa93ffa7a032b5d7b628aa17711ec81383ca" +checksum = "e898588f33fdd5b9420719948f9f2a32c922a246964576f71ba7f24f80610fbc" [[package]] name = "rend" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" +checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" dependencies = [ "bytecheck", ] @@ -975,7 +901,7 @@ checksum = "0200c8230b013893c0b2d6213d6ec64ed2b9be2e0e016682b7224ff82cff5c58" dependencies = [ "bitvec", "bytecheck", - "hashbrown", + "hashbrown 0.12.3", "ptr_meta", "rend", "rkyv_derive", @@ -986,9 +912,9 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.7.42" +version = "0.7.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2e06b915b5c230a17d7a736d1e2e63ee753c256a8614ef3f5147b13a4f5541d" +checksum = "a7dddfff8de25e6f62b9d64e6e432bf1c6736c57d20323e15ee10435fbda7c65" dependencies = [ "proc-macro2", "quote", @@ -1018,11 +944,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.19" +version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "errno", "libc", "linux-raw-sys", @@ -1037,9 +963,9 @@ checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "scoped-tls" @@ -1070,9 +996,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.20" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" dependencies = [ "serde", ] @@ -1085,29 +1011,29 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.189" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.189" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.50", ] [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ "itoa", "ryu", @@ -1115,10 +1041,10 @@ dependencies = [ ] [[package]] -name = "sha-1" -version = "0.10.1" +name = "sha2" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -1148,9 +1074,9 @@ checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "smallvec" -version = "1.11.1" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "smartstring" @@ -1185,12 +1111,6 @@ dependencies = [ "url", ] -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - [[package]] name = "stacker" version = "0.1.15" @@ -1210,43 +1130,16 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "string_cache" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" -dependencies = [ - "new_debug_unreachable", - "once_cell", - "parking_lot", - "phf_shared", - "precomputed-hash", - "serde", -] - -[[package]] -name = "string_cache_codegen" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" -dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro2", - "quote", -] - [[package]] name = "string_enum" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fa4d4f81d7c05b9161f8de839975d3326328b8ba2831164b465524cc2f55252" +checksum = "1b650ea2087d32854a0f20b837fc56ec987a1cb4f758c9757e1171ee9812da63" dependencies = [ - "pmutil", "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.38", + "syn 2.0.50", ] [[package]] @@ -1279,25 +1172,23 @@ dependencies = [ [[package]] name = "swc_atoms" -version = "0.6.0" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebf7a12229f0c0efb654a6a0f8cbfd94fbd320a57c764857a82d8abe9342b450" +checksum = "7d538eaaa6f085161d088a04cf0a3a5a52c5a7f2b3bd9b83f73f058b0ed357c0" dependencies = [ "bytecheck", + "hstr", "once_cell", "rkyv", "rustc-hash", "serde", - "string_cache", - "string_cache_codegen", - "triomphe", ] [[package]] name = "swc_common" -version = "0.33.0" +version = "0.33.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "490e199e25d2aa3fbef675524fa81408651f4e7178b51110470ddd1b3e3bbe75" +checksum = "c85e8b15d0fb87691e27c8f3cf953748db3ccd2a39e165d6d5275a48fb0d29e3" dependencies = [ "anyhow", "ast_node", @@ -1316,7 +1207,6 @@ dependencies = [ "serde", "siphasher", "sourcemap", - "string_cache", "swc_atoms", "swc_eq_ignore_macros", "swc_visit", @@ -1328,9 +1218,9 @@ dependencies = [ [[package]] name = "swc_core" -version = "0.86.2" +version = "0.90.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "659e2bfe8e0967c04fb94c16ac02f1135029304bae573f92f9d7239a54c30484" +checksum = "229d3ae620f7ed70f7974aab8c254018102c4e5d8e7d8ced4a36f43b00f76dcb" dependencies = [ "once_cell", "swc_atoms", @@ -1348,14 +1238,15 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "0.110.0" +version = "0.112.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cbbf9918976a7e7fbdb4f76fe659d08e291a8b56b524b424183fc67d1189679" +checksum = "36226eb87bfd2f5620bde04f149a4b869ab34e78496d60cb0d8eb9da765d0732" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "bytecheck", "is-macro", "num-bigint", + "phf", "rkyv", "scoped-tls", "string_enum", @@ -1366,9 +1257,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "0.146.1" +version = "0.148.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fba119c76654599b71099a0150094f5790f00db63aab6cda1790e731f42c98f" +checksum = "88f901a40a060bd3a94fdcaa4f78a800c6d6b401d26972533203426e1e2ca9e4" dependencies = [ "memchr", "num-bigint", @@ -1385,26 +1276,27 @@ dependencies = [ [[package]] name = "swc_ecma_codegen_macros" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcdff076dccca6cc6a0e0b2a2c8acfb066014382bc6df98ec99e755484814384" +checksum = "394b8239424b339a12012ceb18726ed0244fce6bf6345053cb9320b2791dcaa5" dependencies = [ - "pmutil", "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.38", + "syn 2.0.50", ] [[package]] name = "swc_ecma_parser" -version = "0.141.1" +version = "0.143.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26e535c623db7beb04ba8ebfa821c287b72a23f9fb523990b54db6c1355c990" +checksum = "20823cac99a9adbd4c03fb5e126aaccbf92446afedad99252a0e1fc76e2ffc43" dependencies = [ "either", + "new_debug_unreachable", "num-bigint", "num-traits", + "phf", "serde", "smallvec", "smartstring", @@ -1418,25 +1310,25 @@ dependencies = [ [[package]] name = "swc_ecma_testing" -version = "0.22.0" +version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c456e2c330c0049f77780cd412e61d9c9d0ae7ff9b6c0e4f8262270b7c718e" +checksum = "e1279bd6336c901852146c05a0dbae09f78056b0ab32ffa64b5a1088da073d48" dependencies = [ "anyhow", "hex", - "sha-1", + "sha2", "testing", "tracing", ] [[package]] name = "swc_ecma_transforms_base" -version = "0.134.5" +version = "0.137.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b344b5ef77734ffa9288b3b92e73ed25a7d5a0d7b0e70c348cbbcc0073172040" +checksum = "15c0cd971fde2a51edf5a433c2b0ecde4ba94fd9207734a321650d484fa3c364" dependencies = [ "better_scoped_tls", - "bitflags 2.4.1", + "bitflags 2.4.2", "indexmap", "once_cell", "phf", @@ -1454,9 +1346,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_testing" -version = "0.137.5" +version = "0.140.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a88d1e6665952d99807c740a98242078c58282f81143b566289effab61bb34" +checksum = "71cdceefa2345e68976b6cc26afd9967112b3c313cb9c0cb184da9adc76e0754" dependencies = [ "ansi_term", "anyhow", @@ -1464,7 +1356,7 @@ dependencies = [ "hex", "serde", "serde_json", - "sha-1", + "sha2", "sourcemap", "swc_common", "swc_ecma_ast", @@ -1480,9 +1372,9 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "0.124.4" +version = "0.127.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d5dd053e9a21c433504664d7083869c9d02394eb5141b101c81067067536471" +checksum = "14482e455df85486d68a51533a31645d511e56df93a35cadf0eabbe7abe96b98" dependencies = [ "indexmap", "num_cpus", @@ -1498,9 +1390,9 @@ dependencies = [ [[package]] name = "swc_ecma_visit" -version = "0.96.0" +version = "0.98.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47081acd84cdb2d49d6340ed3204e17738b444da10a3e1dd1eb3d7c8e4d47091" +checksum = "df0127694c36d656ea9eab5c170cdd8ab398246ae2a335de26961c913a4aca47" dependencies = [ "num-bigint", "swc_atoms", @@ -1512,21 +1404,20 @@ dependencies = [ [[package]] name = "swc_eq_ignore_macros" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05a95d367e228d52484c53336991fdcf47b6b553ef835d9159db4ba40efb0ee8" +checksum = "695a1d8b461033d32429b5befbf0ad4d7a2c4d6ba9cd5ba4e0645c615839e8e4" dependencies = [ - "pmutil", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.50", ] [[package]] name = "swc_error_reporters" -version = "0.17.0" +version = "0.17.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "015cbdf2b13ccc76eb12d1702a90fb9aae7b3cddacaf2c56a1b1a4a02f9fcd81" +checksum = "5a76d4fb0aae65d68fd03b44d8ee0d66fa6b08c5fe0d9bb34c150ec0cad5a998" dependencies = [ "anyhow", "miette", @@ -1537,14 +1428,13 @@ dependencies = [ [[package]] name = "swc_macros_common" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a273205ccb09b51fabe88c49f3b34c5a4631c4c00a16ae20e03111d6a42e832" +checksum = "50176cfc1cbc8bb22f41c6fe9d1ec53fbe057001219b5954961b8ad0f336fce9" dependencies = [ - "pmutil", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.50", ] [[package]] @@ -1558,20 +1448,20 @@ dependencies = [ [[package]] name = "swc_plugin_macro" -version = "0.9.15" +version = "0.9.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "785309d342a69df4c929ee59e14e36889ca832f1d2a3c1d03c47c93126c72dbc" +checksum = "3232db481484070637b20a155c064096c0ea1ba04fa2247b89b618661b3574f4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.50", ] [[package]] name = "swc_plugin_proxy" -version = "0.39.0" +version = "0.41.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55e32ea3aeb4930d0b6fcf1f052d33a4bb115a9d58e32bf3baade3316ef6bdd3" +checksum = "3c1a30d289547b936d33a8e5222e049c89b9c84ab706aac0a5c224ecf1b21bcb" dependencies = [ "better_scoped_tls", "rkyv", @@ -1589,14 +1479,14 @@ checksum = "ff9719b6085dd2824fd61938a881937be14b08f95e2d27c64c825a9f65e052ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.50", ] [[package]] name = "swc_visit" -version = "0.5.7" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e87c337fbb2d191bf371173dea6a957f01899adb8f189c6c31b122a6cfc98fc3" +checksum = "358e246dedeb4ae8efacebcce1360dc2f9b6c0b4c1ad8b737cc60f5b6633691a" dependencies = [ "either", "swc_visit_macros", @@ -1604,16 +1494,16 @@ dependencies = [ [[package]] name = "swc_visit_macros" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f322730fb82f3930a450ac24de8c98523af7d34ab8cb2f46bcb405839891a99" +checksum = "fbbbb9d77d5112f90ed7ea00477135b16c4370c872b93a0b63b766e8710650ad" dependencies = [ "Inflector", "pmutil", "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.38", + "syn 2.0.50", ] [[package]] @@ -1629,9 +1519,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.38" +version = "2.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" dependencies = [ "proc-macro2", "quote", @@ -1646,22 +1536,21 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.8.0" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" dependencies = [ "cfg-if", "fastrand", - "redox_syscall", "rustix", "windows-sys", ] [[package]] name = "termcolor" -version = "1.3.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] @@ -1678,16 +1567,17 @@ dependencies = [ [[package]] name = "testing" -version = "0.35.0" +version = "0.35.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e149694212e0152671c616dc21e4029a0f39710085f32705b2fb07fda89e437f" +checksum = "bd2a7fea73e3b4693c08cbdf71806e4a51effdcbe82bebdb12532b49784232e8" dependencies = [ "ansi_term", - "cargo_metadata", + "cargo_metadata 0.15.4", "difference", "once_cell", "pretty_assertions", "regex", + "serde", "serde_json", "swc_common", "swc_error_reporters", @@ -1698,19 +1588,18 @@ dependencies = [ [[package]] name = "testing_macros" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1c15b796025051a07f1ac695ee0cac0883f05a0d510c9d171ef8d31a992e6a5" +checksum = "f9d3864d4184569c1428645a51a304b3b6e8d3094cd61fb3cce8dfdd9f6d0f72" dependencies = [ "anyhow", "glob", "once_cell", - "pmutil", "proc-macro2", "quote", "regex", "relative-path", - "syn 2.0.38", + "syn 2.0.50", ] [[package]] @@ -1726,63 +1615,34 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.49" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.49" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.50", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", ] -[[package]] -name = "time" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" -dependencies = [ - "deranged", - "itoa", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" -dependencies = [ - "time-core", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -1800,9 +1660,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tracing" -version = "0.1.39" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2ef2af84856a50c1d430afce2fdded0a4ec7eda868db86409b4543df0797f9" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ "pin-project-lite", "tracing-attributes", @@ -1817,7 +1677,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.50", ] [[package]] @@ -1832,20 +1692,20 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] [[package]] name = "tracing-subscriber" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "matchers", "nu-ansi-term", @@ -1859,16 +1719,6 @@ dependencies = [ "tracing-log", ] -[[package]] -name = "triomphe" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee8098afad3fb0c54a9007aab6804558410503ad676d4633f9c2559a00ac0f" -dependencies = [ - "serde", - "stable_deref_trait", -] - [[package]] name = "typed-arena" version = "2.0.2" @@ -1883,9 +1733,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-id" @@ -1907,9 +1757,9 @@ checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] @@ -1922,9 +1772,9 @@ checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -1933,9 +1783,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.4.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" [[package]] name = "valuable" @@ -1945,17 +1795,14 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "vergen" -version = "7.5.1" +version = "8.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f21b881cd6636ece9735721cf03c1fe1e774fe258683d084bb2812ab67435749" +checksum = "e27d6bdd219887a9eadd19e1c34f32e47fa332301184935c6d9bca26f3cca525" dependencies = [ "anyhow", - "cfg-if", - "enum-iterator", - "getset", + "cargo_metadata 0.18.1", + "regex", "rustversion", - "thiserror", - "time", ] [[package]] @@ -2003,11 +1850,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-sys" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets", + "windows-targets 0.52.3", ] [[package]] @@ -2016,13 +1863,28 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" +dependencies = [ + "windows_aarch64_gnullvm 0.52.3", + "windows_aarch64_msvc 0.52.3", + "windows_i686_gnu 0.52.3", + "windows_i686_msvc 0.52.3", + "windows_x86_64_gnu 0.52.3", + "windows_x86_64_gnullvm 0.52.3", + "windows_x86_64_msvc 0.52.3", ] [[package]] @@ -2031,42 +1893,84 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" + [[package]] name = "windows_i686_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" + [[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" + [[package]] name = "wyz" version = "0.5.1" diff --git a/nodedevpkg/purebundle/Cargo.toml b/nodedevpkg/purebundle/Cargo.toml index 50eae18..b67858f 100644 --- a/nodedevpkg/purebundle/Cargo.toml +++ b/nodedevpkg/purebundle/Cargo.toml @@ -11,7 +11,7 @@ lto = true [dependencies] serde = { version = "1", features = ["derive"] } -swc_core = { version = "0.86.2", features = ["ecma_plugin_transform", "__parser"] } +swc_core = { version = "0.90.11", features = ["ecma_plugin_transform", "__parser"] } swc_ecma_utils = { version = "0" } [dev-dependencies] diff --git a/nodedevpkg/purebundle/index.d.ts b/nodedevpkg/purebundle/index.d.ts index 87ed5e5..7d435f2 100644 --- a/nodedevpkg/purebundle/index.d.ts +++ b/nodedevpkg/purebundle/index.d.ts @@ -1,19 +1,22 @@ -export function usePlugin(opts: {}): [string, any] +export function usePlugin(opts: {}): [string, any]; -import { TransformConfig } from "@swc/core" +import { TransformConfig } from "@swc/core"; -export function transform(code: string, opts: { - filename?: string, - minify?: boolean, - annotatePure?: boolean, - env?: { - targets?: string | string[] | { [K: string]: string } - mode?: string, - coreJs?: string, - exclude?: string[], - include?: string[], - } -}): Promise<{ - code: string; - map?: string; -}> +export function transform( + code: string, + opts: { + filename?: string; + minify?: boolean; + annotatePure?: boolean; + env?: { + targets?: string | string[] | { [K: string]: string }; + mode?: string; + coreJs?: string; + exclude?: string[]; + include?: string[]; + }; + }, +): Promise<{ + code: string; + map?: string; +}>; diff --git a/nodedevpkg/purebundle/index.mjs b/nodedevpkg/purebundle/index.mjs index 7bb73c0..56c2bd8 100644 --- a/nodedevpkg/purebundle/index.mjs +++ b/nodedevpkg/purebundle/index.mjs @@ -5,39 +5,41 @@ import { transform as trans } from "@swc/core"; const __dirname = fileURLToPath(new URL(".", import.meta.url)); export const usePlugin = (opts = {}) => [ - join(__dirname, "./target/wasm32-wasi/release/purebundle.wasm"), - opts + join(__dirname, "./target/wasm32-wasi/release/purebundle.wasm"), + opts, ]; export async function transform(code, opts = {}) { - return ( - await trans(code, { - filename: opts.filename, - swcrc: false, - module: { - type: "es6" - }, - env: opts.env ?? { - targets: "defaults" - }, - minify: opts.minify ?? false, - jsc: { - minify: opts.minify ? { - compress: true, - mangle: true - } : undefined, - parser: { - syntax: "typescript", - dynamicImport: true, - tsx: false - }, - transform: {}, - externalHelpers: false, - experimental: opts.annotatePure ? { - plugins: [usePlugin({})] - } : undefined - }, - isModule: true - }) - ); + return await trans(code, { + filename: opts.filename, + swcrc: false, + module: { + type: "es6", + }, + env: opts.env ?? { + targets: "defaults", + }, + minify: opts.minify ?? false, + jsc: { + minify: opts.minify + ? { + compress: true, + mangle: true, + } + : undefined, + parser: { + syntax: "typescript", + dynamicImport: true, + tsx: false, + }, + transform: {}, + externalHelpers: false, + experimental: opts.annotatePure + ? { + plugins: [usePlugin({})], + } + : undefined, + }, + isModule: true, + }); } diff --git a/nodedevpkg/purebundle/package.json b/nodedevpkg/purebundle/package.json index 65f6646..2b3c31e 100644 --- a/nodedevpkg/purebundle/package.json +++ b/nodedevpkg/purebundle/package.json @@ -1,8 +1,8 @@ { "name": "@innoai-tech/purebundle", - "version": "0.2.12", + "version": "0.3.0", "dependencies": { - "@swc/core": "1.3.103" + "@swc/core": "1.4.2" }, "exports": { ".": { diff --git a/nodepkg/config/package.json b/nodepkg/config/package.json index 5d4af3b..86e6de8 100644 --- a/nodepkg/config/package.json +++ b/nodepkg/config/package.json @@ -1,6 +1,6 @@ { "name": "@innoai-tech/config", - "version": "0.5.3", + "version": "0.5.4", "monobundle": { "exports": { ".": "./src/index.ts", @@ -10,7 +10,7 @@ }, "dependencies": { "@innoai-tech/lodash": "workspace:^", - "esbuild": "^0.19.11" + "esbuild": "^0.20.1" }, "peerDependencies": { "vite": "^5.0.11" @@ -56,7 +56,7 @@ "scripts": { "build": "bunx --bun monobundle", "prepublishOnly": "bun run build", - "lint": "bunx --bun @biomejs/biome check --apply . ." + "lint": "bunx --bun prettier --write . " }, "sideEffects": false, "type": "module" diff --git a/nodepkg/fetcher/package.json b/nodepkg/fetcher/package.json index 40dcab1..a8a9729 100644 --- a/nodepkg/fetcher/package.json +++ b/nodepkg/fetcher/package.json @@ -36,7 +36,7 @@ "scripts": { "build": "bunx --bun monobundle", "prepublishOnly": "bun run build", - "lint": "bunx --bun @biomejs/biome check --apply . ." + "lint": "bunx --bun prettier --write . " }, "sideEffects": false, "type": "module" diff --git a/nodepkg/fetcher/src/fetchers/fetcher.ts b/nodepkg/fetcher/src/fetchers/fetcher.ts index cd13687..9335f22 100644 --- a/nodepkg/fetcher/src/fetchers/fetcher.ts +++ b/nodepkg/fetcher/src/fetchers/fetcher.ts @@ -1,75 +1,75 @@ import type { - Fetcher, - FetcherCreatorOptions, - FetcherErrorResponse, - FetcherResponse, - RequestConfig + Fetcher, + FetcherCreatorOptions, + FetcherErrorResponse, + FetcherResponse, + RequestConfig, } from "../fetcher"; export const createFetcher = ({ - paramsSerializer, - transformRequestBody - }: FetcherCreatorOptions): Fetcher => { - return { - toHref: (requestConfig: RequestConfig) => { - let search = paramsSerializer(requestConfig.params); + paramsSerializer, + transformRequestBody, +}: FetcherCreatorOptions): Fetcher => { + return { + toHref: (requestConfig: RequestConfig) => { + let search = paramsSerializer(requestConfig.params); - if (search.length && !search.startsWith("?")) { - search = "?" + search; - } + if (search.length && !search.startsWith("?")) { + search = "?" + search; + } - return `${requestConfig.url}${search}`; - }, - request: (requestConfig: RequestConfig) => { - const reqInit: RequestInit = { - method: requestConfig.method, - headers: requestConfig.headers || {}, - body: transformRequestBody( - requestConfig.body, - requestConfig.headers || {} - ) - }; + return `${requestConfig.url}${search}`; + }, + request: (requestConfig: RequestConfig) => { + const reqInit: RequestInit = { + method: requestConfig.method, + headers: requestConfig.headers || {}, + body: transformRequestBody( + requestConfig.body, + requestConfig.headers || {}, + ), + }; - return fetch( - `${requestConfig.url}?${paramsSerializer(requestConfig.params)}`, - reqInit - ) - .then(async (res) => { - let body: any; + return fetch( + `${requestConfig.url}?${paramsSerializer(requestConfig.params)}`, + reqInit, + ) + .then(async (res) => { + let body: any; - if (res.headers.get("Content-Type")?.includes("application/json")) { - body = await res.json(); - } else if ( - res.headers - .get("Content-Type") - ?.includes("application/octet-stream") - ) { - body = await res.blob(); - } else { - body = await res.text(); - } + if (res.headers.get("Content-Type")?.includes("application/json")) { + body = await res.json(); + } else if ( + res.headers + .get("Content-Type") + ?.includes("application/octet-stream") + ) { + body = await res.blob(); + } else { + body = await res.text(); + } - const resp: any = { - config: requestConfig, - status: res.status, - headers: {} - }; + const resp: any = { + config: requestConfig, + status: res.status, + headers: {}, + }; - for (const [key, value] of res.headers) { - resp.headers[key] = value; - } + for (const [key, value] of res.headers) { + resp.headers[key] = value; + } - resp.body = body as TRespData; + resp.body = body as TRespData; - return resp as FetcherResponse; - }) - .then((resp) => { - if (resp.status >= 400) { - (resp as FetcherErrorResponse).error = resp.body; - throw resp; - } - return resp; - }); - } - }; + return resp as FetcherResponse; + }) + .then((resp) => { + if (resp.status >= 400) { + (resp as FetcherErrorResponse).error = resp.body; + throw resp; + } + return resp; + }); + }, + }; }; diff --git a/package.json b/package.json index 9fab31f..7f9f0b6 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "nodepkg/*", "nodedevpkg/*" ], + "packageManager": "bun@1.0.28", "engines": { "bun": ">= 1" }, @@ -17,14 +18,15 @@ "devDependencies": { "@innoai-tech/devconfig": "workspace:*", "@innoai-tech/monobundle": "workspace:*", - "@biomejs/biome": "^1.5.2", - "bun-types": "^1.0.22", - "core-js": "^3.35.0", - "esbuild": "^0.19.11", - "jsdom": "^23.2.0", + "bun-types": "^1.0.28", + "core-js": "^3.36.0", + "esbuild": "^0.20.1", + "jsdom": "^24.0.0", + "prettier": "^3.2.5", "rxjs": "^7.8.1", - "turbo": "^1.11.3", + "turbo": "^1.12.4", "typescript": "^5.3.3", - "vite": "^5.0.11" - } + "vite": "^5.1.4" + }, + "prettier": {} }