Comparing version 0.1.12 to 0.1.13
@@ -5,2 +5,9 @@ # Changelog | ||
### [0.1.13](https://github.com/unjs/unbuild/compare/v0.1.12...v0.1.13) (2021-04-16) | ||
### Bug Fixes | ||
* rollup config fixes (inline related) ([ae8a3d3](https://github.com/unjs/unbuild/commit/ae8a3d31438f1ea5b1f006a050e94fe335646cf3)) | ||
### [0.1.12](https://github.com/unjs/unbuild/compare/v0.1.11...v0.1.12) (2021-04-09) | ||
@@ -7,0 +14,0 @@ |
@@ -16,3 +16,3 @@ 'use strict'; | ||
const commonjs = require('@rollup/plugin-commonjs'); | ||
const nodeResolve = require('@rollup/plugin-node-resolve'); | ||
const pluginNodeResolve = require('@rollup/plugin-node-resolve'); | ||
const alias = require('@rollup/plugin-alias'); | ||
@@ -26,3 +26,3 @@ const esbuild = require('rollup-plugin-esbuild'); | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; } | ||
@@ -39,3 +39,2 @@ const Module__default = /*#__PURE__*/_interopDefaultLegacy(Module); | ||
const commonjs__default = /*#__PURE__*/_interopDefaultLegacy(commonjs); | ||
const nodeResolve__default = /*#__PURE__*/_interopDefaultLegacy(nodeResolve); | ||
const alias__default = /*#__PURE__*/_interopDefaultLegacy(alias); | ||
@@ -47,3 +46,3 @@ const esbuild__default = /*#__PURE__*/_interopDefaultLegacy(esbuild); | ||
async function ensuredir(path) { | ||
await mkdirp__default['default'](upath.dirname(path)); | ||
await mkdirp__default(upath.dirname(path)); | ||
} | ||
@@ -53,6 +52,6 @@ async function symlink(from, to, force = true) { | ||
if (force) { | ||
await fsp__default['default'].unlink(to).catch(() => { | ||
await fsp__default.unlink(to).catch(() => { | ||
}); | ||
} | ||
await fsp__default['default'].symlink(from, to); | ||
await fsp__default.symlink(from, to); | ||
} | ||
@@ -86,6 +85,6 @@ function dumpObject(obj) { | ||
if (unusedDependencies.size) { | ||
consola__default['default'].warn("Potential unused dependencies found:", Array.from(unusedDependencies).map((id) => chalk__default['default'].cyan(id)).join(", ")); | ||
consola__default.warn("Potential unused dependencies found:", Array.from(unusedDependencies).map((id) => chalk__default.cyan(id)).join(", ")); | ||
} | ||
if (implicitDependnecies.size && !ctx.inlineDependencies) { | ||
consola__default['default'].warn("Potential implicit dependencies found:", Array.from(implicitDependnecies).map((id) => chalk__default['default'].cyan(id)).join(", ")); | ||
consola__default.warn("Potential implicit dependencies found:", Array.from(implicitDependnecies).map((id) => chalk__default.cyan(id)).join(", ")); | ||
} | ||
@@ -128,3 +127,3 @@ } | ||
rollupOptions.plugins = rollupOptions.plugins || []; | ||
rollupOptions.plugins.push(dts__default['default']({ | ||
rollupOptions.plugins.push(dts__default({ | ||
respectExternal: true | ||
@@ -151,3 +150,5 @@ })); | ||
exports: "auto", | ||
preferConst: true | ||
preferConst: true, | ||
externalLiveBindings: false, | ||
freeze: false | ||
}, | ||
@@ -160,3 +161,5 @@ { | ||
exports: "auto", | ||
preferConst: true | ||
preferConst: true, | ||
externalLiveBindings: false, | ||
freeze: false | ||
} | ||
@@ -174,3 +177,3 @@ ], | ||
if (!isExplicitExternal) { | ||
consola__default['default'].warn(`Inlining implicit external ${id}`); | ||
consola__default.warn(`Inlining implicit external ${id}`); | ||
} | ||
@@ -185,17 +188,29 @@ return isExplicitExternal; | ||
plugins: [ | ||
alias__default['default']({ | ||
alias__default({ | ||
[ctx.pkg.name]: ctx.rootDir | ||
}), | ||
nodeResolve__default['default']({ | ||
pluginNodeResolve.nodeResolve({ | ||
extensions, | ||
preferBuiltins: true | ||
}), | ||
esbuild__default['default']({ | ||
target: "node12", | ||
loaders: { | ||
".json": "json" | ||
{ | ||
name: "json", | ||
transform(json, id) { | ||
if (!id || id[0] === "\0" || !id.endsWith(".json")) { | ||
return null; | ||
} | ||
return { | ||
code: "module.exports = " + json, | ||
map: null | ||
}; | ||
} | ||
}, | ||
esbuild__default({ | ||
target: "node12" | ||
}), | ||
commonjs__default['default']({ | ||
extensions | ||
commonjs__default({ | ||
extensions, | ||
ignore: [ | ||
...ctx.externals | ||
] | ||
}) | ||
@@ -208,3 +223,3 @@ ] | ||
for (const entry of ctx.entries.filter((entry2) => entry2.builder === "untyped")) { | ||
const _require = jiti__default['default'](ctx.rootDir, { | ||
const _require = jiti__default(ctx.rootDir, { | ||
interopDefault: true, | ||
@@ -214,3 +229,3 @@ transformOptions: { | ||
plugins: [ | ||
untypedPlugin__default['default'] | ||
untypedPlugin__default | ||
] | ||
@@ -224,3 +239,3 @@ } | ||
const schema = untyped.resolveSchema(srcConfig, defaults); | ||
await mkdirp__default['default'](genDir); | ||
await mkdirp__default(genDir); | ||
await fsp.writeFile(upath.resolve(genDir, `${entry.name}.md`), untyped.generateMarkdown(schema)); | ||
@@ -260,3 +275,3 @@ await fsp.writeFile(upath.resolve(genDir, `${entry.name}.schema.json`), JSON.stringify(schema, null, 2)); | ||
rootDir = upath.resolve(process.cwd(), rootDir || "."); | ||
const _require = jiti__default['default'](rootDir); | ||
const _require = jiti__default(rootDir); | ||
let buildConfigFile; | ||
@@ -269,3 +284,3 @@ try { | ||
const pkg = _require("./package.json"); | ||
const ctx = defu__default['default'](buildConfig, { | ||
const ctx = defu__default(buildConfig, { | ||
pkg, | ||
@@ -276,3 +291,3 @@ rootDir, | ||
devDependencies: [], | ||
externals: [...Module__default['default'].builtinModules], | ||
externals: [...Module__default.builtinModules], | ||
srcDir: "src", | ||
@@ -307,6 +322,6 @@ outDir: "dist", | ||
ctx.externals.push(...ctx.dependencies); | ||
consola__default['default'].info(chalk__default['default'].cyan(`${ctx.stub ? "Stubbing" : "Building"} ${pkg.name}`)); | ||
consola__default.info(chalk__default.cyan(`${ctx.stub ? "Stubbing" : "Building"} ${pkg.name}`)); | ||
if (process.env.DEBUG) { | ||
consola__default['default'].info(`${chalk__default['default'].bold("Root dir:")} ${ctx.rootDir} | ||
${chalk__default['default'].bold("Entries:")} | ||
consola__default.info(`${chalk__default.bold("Root dir:")} ${ctx.rootDir} | ||
${chalk__default.bold("Entries:")} | ||
${ctx.entries.map((entry) => " " + dumpObject(entry)).join("\n ")} | ||
@@ -319,4 +334,4 @@ `); | ||
}); | ||
await util.promisify(rimraf__default['default'])(outDir); | ||
await mkdirp__default['default'](outDir); | ||
await util.promisify(rimraf__default)(outDir); | ||
await mkdirp__default(outDir); | ||
} | ||
@@ -329,14 +344,14 @@ await typesBuild(ctx); | ||
} | ||
consola__default['default'].success(chalk__default['default'].green("Build succeed for " + pkg.name)); | ||
consola__default.success(chalk__default.green("Build succeed for " + pkg.name)); | ||
for (const entry of ctx.buildEntries) { | ||
consola__default['default'].log(` ${chalk__default['default'].bold(entry.path)} (` + [ | ||
entry.bytes && `size: ${chalk__default['default'].cyan(prettyBytes__default['default'](entry.bytes))}`, | ||
entry.exports && `exports: ${chalk__default['default'].gray(entry.exports.join(", "))}`, | ||
entry.chunks && `chunks: ${chalk__default['default'].gray(entry.chunks.join(", "))}` | ||
consola__default.log(` ${chalk__default.bold(entry.path)} (` + [ | ||
entry.bytes && `size: ${chalk__default.cyan(prettyBytes__default(entry.bytes))}`, | ||
entry.exports && `exports: ${chalk__default.gray(entry.exports.join(", "))}`, | ||
entry.chunks && `chunks: ${chalk__default.gray(entry.chunks.join(", "))}` | ||
].filter(Boolean).join(", ") + ")"); | ||
} | ||
validateDependencies(ctx); | ||
consola__default['default'].log(""); | ||
consola__default.log(""); | ||
} | ||
exports.build = build; |
@@ -28,3 +28,3 @@ 'use strict'; | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; } | ||
@@ -34,3 +34,3 @@ const mri__default = /*#__PURE__*/_interopDefaultLegacy(mri); | ||
async function main() { | ||
const args = mri__default['default'](process.argv.splice(2)); | ||
const args = mri__default(process.argv.splice(2)); | ||
const rootDir = path.resolve(process.cwd(), args._[0] || "."); | ||
@@ -37,0 +37,0 @@ await build.build(rootDir, args.stub).catch((err) => { |
{ | ||
"name": "unbuild", | ||
"version": "0.1.12", | ||
"version": "0.1.13", | ||
"description": "An unified javascript build system", | ||
@@ -30,2 +30,3 @@ "repository": "unjs/unbuild", | ||
"@rollup/plugin-commonjs": "^18.0.0", | ||
"@rollup/plugin-json": "^4.1.0", | ||
"@rollup/plugin-node-resolve": "^11.2.1", | ||
@@ -32,0 +33,0 @@ "chalk": "^4.1.0", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33126
762
21
+ Added@rollup/plugin-json@^4.1.0
+ Added@rollup/plugin-json@4.1.0(transitive)