Comparing version 3.2.1 to 3.3.0
12
cli.js
@@ -57,5 +57,11 @@ #!/usr/bin/env node | ||
commands.publish = async args => { | ||
const pkg = await commands.build(args) | ||
await fs.copyFile(pkg.cwd + '/README.md', pkg.dist + '/README.md').catch(() => {}) | ||
spawnSync('npm', ['publish', pkg.dist, '--verbose'], { stdio: 'inherit' }) | ||
const cwd = process.cwd() // we do not support positional options for cwd in publish | ||
const packagejson = JSON.parse(await fs.readFile(cwd + '/package.json')) | ||
if (packagejson.scripts.build) { | ||
spawnSync('npm', ['run', 'build'], { stdio: 'inherit' }) | ||
} else { | ||
await commands.build(args) | ||
await fs.copyFile(cwd + '/README.md', cwd + '/dist/README.md').catch(() => {}) | ||
} | ||
spawnSync('npm', ['publish', cwd + '/dist', '--verbose'], { stdio: 'inherit' }) | ||
} | ||
@@ -62,0 +68,0 @@ |
{ | ||
"name": "ipjs", | ||
"version": "3.2.1", | ||
"version": "3.3.0", | ||
"description": "Universal JavaScript build and packaging system", | ||
@@ -5,0 +5,0 @@ "main": "src/build.js", |
@@ -1,2 +0,2 @@ | ||
const walk = (node, imports=new Set()) => { | ||
const walk = (node, imports = new Set()) => { | ||
if (!node) return | ||
@@ -6,3 +6,3 @@ if (node.type === 'ImportExpression') { | ||
} | ||
for (const [ key, value ] of Object.entries(node)) { | ||
for (const [key, value] of Object.entries(node)) { | ||
if (Array.isArray(value)) value.forEach(v => walk(v, imports)) | ||
@@ -9,0 +9,0 @@ else if (typeof value === 'object') walk(value, imports) |
@@ -141,3 +141,3 @@ import { promises as fs } from 'fs' | ||
const onwarn = warning => { | ||
const skips = [ 'PREFER_NAMED_EXPORTS' ] | ||
const skips = ['PREFER_NAMED_EXPORTS'] | ||
if (skips.includes(warning.code)) { | ||
@@ -144,0 +144,0 @@ // noop |
@@ -108,3 +108,3 @@ import { parse } from 'acorn' | ||
if (!path.startsWith(cwd)) throw new Error('File is not in source directory') | ||
let rel = path.slice(cwd.length + 1) | ||
const rel = path.slice(cwd.length + 1) | ||
await writeFile(new URL(dist + '/esm/browser-' + rel), this.esmBrowser) | ||
@@ -111,0 +111,0 @@ await writeFile(new URL(dist + '/esm/node-' + rel), this.esmNode) |
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
50547
1376