Comparing version 3.3.1 to 3.4.0
{ | ||
"name": "ipjs", | ||
"version": "3.3.1", | ||
"version": "3.4.0", | ||
"description": "Universal JavaScript build and packaging system", | ||
@@ -5,0 +5,0 @@ "main": "src/build.js", |
@@ -10,6 +10,8 @@ import { promises as fs } from 'fs' | ||
const docFileRegex = /^(readme|license)/i | ||
const copy = o => JSON.parse(JSON.stringify(o)) | ||
const vals = Object.values | ||
const { writeFile, mkdir, unlink, readdir, readFile } = fs | ||
const { writeFile, mkdir, unlink, readdir, readFile, copyFile } = fs | ||
@@ -73,2 +75,3 @@ class Package { | ||
let promises = [...this.files.values()] | ||
this.docFiles = new Map((await this.getDocFiles()).map(f => [f, toURL(f)])) | ||
if (this.includeTests) { | ||
@@ -106,2 +109,6 @@ const testFiles = await this.getTestFiles() | ||
async getDocFiles () { | ||
return (await readdir(this.cwd)).filter(f => docFileRegex.test(f)) | ||
} | ||
async getTestFiles () { | ||
@@ -162,7 +169,9 @@ const files = await readdir(this.cwd) | ||
rmtree(fileURLToPath(dist)) | ||
await mkdir(dist) | ||
await mkdir(new URL(dist + '/cjs')) | ||
await mkdir(new URL(dist + '/cjs'), { recursive: true }) | ||
await mkdir(new URL(dist + '/esm')) | ||
const pending = [...this.files.values()].map(p => p.then(f => f.deflate(dist))) | ||
for (const [f, url] of this.docFiles) { | ||
pending.push(copyFile(url, new URL(`${dist}/${f}`))) | ||
} | ||
if (this.includeTests) { | ||
@@ -169,0 +178,0 @@ pending.push(...[...this.testFiles.values()].map(p => p.then(f => f.deflate(dist)))) |
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
50662
1379