Comparing version 5.0.5 to 5.1.0
{ | ||
"name": "ipjs", | ||
"version": "5.0.5", | ||
"version": "5.1.0", | ||
"description": "Universal JavaScript build and packaging system", | ||
@@ -5,0 +5,0 @@ "main": "src/build.js", |
@@ -58,2 +58,4 @@ import { promises as fs, existsSync } from 'fs' | ||
exports['.'] = { import: this.file(toURL(json.main || './index.js')) } | ||
} else if (typeof json.exports === 'string') { | ||
exports['.'] = { import: this.file(toURL(json.exports)) } | ||
} else { | ||
@@ -168,2 +170,6 @@ for (const [key, value] of Object.entries(json.exports)) { | ||
async stubFiles (dist, overrides) { | ||
if (typeof overrides === 'string') { | ||
overrides = { '.': overrides } | ||
} | ||
await Promise.all( | ||
@@ -170,0 +176,0 @@ Object.keys(overrides).map(async (file) => { |
import build from '../src/build.js' | ||
import tempy from 'tempy' | ||
import { promises as fs } from 'fs' | ||
import { fileURLToPath, pathToFileURL } from 'url' | ||
import rmtree from '@tgrajewski/rmtree' | ||
import { deepStrictEqual as same } from 'assert' | ||
import verify from './fixtures/verify.js' | ||
const eol = Buffer.from('\n')[0] | ||
const strip = buff => { | ||
if (buff[buff.byteLength - 1] === eol) { | ||
return buff.slice(0, buff.byteLength -2) | ||
} | ||
return buff | ||
} | ||
export default async test => { | ||
@@ -21,18 +11,2 @@ const url = new URL('fixtures/pkg-kitchensink/input', import.meta.url) | ||
const verify = async (comp, input) => { | ||
const files = await fs.readdir(comp) | ||
for (const file of files) { | ||
const url = new URL(comp + '/' + file) | ||
const inputURL = new URL(input + '/' + file) | ||
const stat = await fs.stat(url) | ||
if (stat.isDirectory()) { | ||
await verify(url, inputURL) | ||
} else { | ||
const valid = strip(await fs.readFile(url)) | ||
const data = strip(await fs.readFile(inputURL)) | ||
same(valid.toString(), data.toString()) | ||
} | ||
} | ||
} | ||
test('pkg-kitchensink', async test => { | ||
@@ -39,0 +13,0 @@ const dist = pathToFileURL(await tempy.directory()) |
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
60950
125
1587