Comparing version 1.16.0 to 1.16.1
@@ -10,4 +10,4 @@ // merge tshy.imports with package.json imports | ||
k, | ||
typeof v === 'string' && v.startsWith('./src/') | ||
? './' + | ||
typeof v === 'string' && v.startsWith('./src/') ? | ||
'./' + | ||
v | ||
@@ -14,0 +14,0 @@ .substring('./src/'.length) |
@@ -39,8 +39,5 @@ // Remove the .tshy-build folder, but ONLY if | ||
} | ||
const inputSearch = ext === '.js' || ext === '.d.ts' | ||
? ['.tsx', '.ts'] | ||
: ext === '.mjs' || ext === '.d.mts' | ||
? ['.mts'] | ||
: ext === '.cjs' || ext === '.d.cts' | ||
? ['.cts'] | ||
const inputSearch = ext === '.js' || ext === '.d.ts' ? ['.tsx', '.ts'] | ||
: ext === '.mjs' || ext === '.d.mts' ? ['.mts'] | ||
: ext === '.cjs' || ext === '.d.cts' ? ['.cts'] | ||
: []; | ||
@@ -47,0 +44,0 @@ inputSearch.push(ext); |
@@ -36,9 +36,7 @@ // get the config and package and stuff | ||
const match = (e, pattern) => pattern.some(m => m.match(e)); | ||
const parsePattern = (p) => Array.isArray(p) | ||
? p.map(p => new Minimatch(p.replace(/^\.\//, ''))) | ||
const parsePattern = (p) => Array.isArray(p) ? | ||
p.map(p => new Minimatch(p.replace(/^\.\//, ''))) | ||
: parsePattern([p]); | ||
const getConfig = (pkg, sources) => { | ||
const tshy = validConfig(pkg.tshy) | ||
? pkg.tshy | ||
: {}; | ||
const tshy = validConfig(pkg.tshy) ? pkg.tshy : {}; | ||
let exportsConfig = tshy.exports; | ||
@@ -56,8 +54,6 @@ if (typeof exportsConfig === 'string' || | ||
// index is main, anything else is a subpath | ||
const sp = /^\.\/src\/index.([mc]?[jt]s|[jt]sx)$/.test(e) | ||
? '.' | ||
: './' + | ||
e | ||
.replace(/^\.\/src\//, '') | ||
.replace(/\.([mc]?[tj]s|[jt]sx)$/, ''); | ||
const sp = /^\.\/src\/index.([mc]?[jt]s|[jt]sx)$/.test(e) ? '.' : ('./' + | ||
e | ||
.replace(/^\.\/src\//, '') | ||
.replace(/\.([mc]?[tj]s|[jt]sx)$/, '')); | ||
exp[sp] = `./${e}`; | ||
@@ -64,0 +60,0 @@ } |
@@ -22,10 +22,6 @@ import { relative, resolve } from 'node:path/posix'; | ||
const rel = relative(resolve('./src'), resolve(polyfills.get(pf)?.map.get(s) ?? s)); | ||
const target = liveDev | ||
? rel | ||
: rel.replace(/\.([mc]?)tsx?$/, '.$1js'); | ||
return !s || !s.startsWith('./src/') | ||
? s | ||
: dialects.includes(type) | ||
? `./dist/${dialect}/${target}` | ||
: undefined; | ||
const target = liveDev ? rel : rel.replace(/\.([mc]?)tsx?$/, '.$1js'); | ||
return (!s || !s.startsWith('./src/') ? s | ||
: dialects.includes(type) ? `./dist/${dialect}/${target}` | ||
: undefined); | ||
} | ||
@@ -66,12 +62,13 @@ return resolveExport(s, [condition]); | ||
if (target) { | ||
exp[d] = liveDev | ||
? { | ||
source, | ||
default: target, | ||
} | ||
: { | ||
source, | ||
types: target.replace(/\.js$/, '.d.ts'), | ||
default: target, | ||
}; | ||
exp[d] = | ||
liveDev ? | ||
{ | ||
source, | ||
default: target, | ||
} | ||
: { | ||
source, | ||
types: target.replace(/\.js$/, '.d.ts'), | ||
default: target, | ||
}; | ||
} | ||
@@ -85,12 +82,13 @@ } | ||
if (target) { | ||
exp[d] = liveDev | ||
? { | ||
source, | ||
default: target, | ||
} | ||
: { | ||
source, | ||
types: target.replace(/\.js$/, '.d.ts'), | ||
default: target, | ||
}; | ||
exp[d] = | ||
liveDev ? | ||
{ | ||
source, | ||
default: target, | ||
} | ||
: { | ||
source, | ||
types: target.replace(/\.js$/, '.d.ts'), | ||
default: target, | ||
}; | ||
} | ||
@@ -101,24 +99,26 @@ } | ||
if (impTarget) { | ||
exp.import = liveDev | ||
? { | ||
source: s, | ||
default: impTarget, | ||
} | ||
: { | ||
source: s, | ||
types: impTarget.replace(/\.(m?)js$/, '.d.$1ts'), | ||
default: impTarget, | ||
}; | ||
exp.import = | ||
liveDev ? | ||
{ | ||
source: s, | ||
default: impTarget, | ||
} | ||
: { | ||
source: s, | ||
types: impTarget.replace(/\.(m?)js$/, '.d.$1ts'), | ||
default: impTarget, | ||
}; | ||
} | ||
if (reqTarget) { | ||
exp.require = liveDev | ||
? { | ||
source: s, | ||
default: reqTarget, | ||
} | ||
: { | ||
source: s, | ||
types: reqTarget.replace(/\.(c?)js$/, '.d.$1ts'), | ||
default: reqTarget, | ||
}; | ||
exp.require = | ||
liveDev ? | ||
{ | ||
source: s, | ||
default: reqTarget, | ||
} | ||
: { | ||
source: s, | ||
types: reqTarget.replace(/\.(c?)js$/, '.d.$1ts'), | ||
default: reqTarget, | ||
}; | ||
} | ||
@@ -125,0 +125,0 @@ } |
@@ -33,8 +33,8 @@ import chalk from 'chalk'; | ||
const build = () => ({ | ||
extends: config.project === undefined | ||
? '../tsconfig.json' | ||
extends: config.project === undefined ? | ||
'../tsconfig.json' | ||
: join('..', config.project), | ||
compilerOptions: { | ||
target: readTypescriptConfig().options.target === undefined | ||
? 'es2022' | ||
target: readTypescriptConfig().options.target === undefined ? | ||
'es2022' | ||
: undefined, | ||
@@ -41,0 +41,0 @@ rootDir: '../src', |
@@ -77,8 +77,6 @@ // this is the thing that supports top-level package.json imports | ||
const df = dirname(l); | ||
const dfrel = df === '.' | ||
? '' | ||
: df | ||
.split('/') | ||
.map(() => '../') | ||
.join(''); | ||
const dfrel = df === '.' ? '' : (df | ||
.split('/') | ||
.map(() => '../') | ||
.join('')); | ||
const dest = dir + '/' + l; | ||
@@ -85,0 +83,0 @@ const src = rel + '/' + dfrel + l; |
{ | ||
"name": "tshy", | ||
"version": "1.16.0", | ||
"version": "1.16.1", | ||
"description": "TypeScript HYbridizer - Hybrid (CommonJS/ESM) TypeScript node package builder", | ||
@@ -18,3 +18,3 @@ "author": "Isaac Z. Schlueter <i@izs.me> (https://izs.me)", | ||
"mkdirp": "^3.0.1", | ||
"polite-json": "^4.0.1", | ||
"polite-json": "^5.0.0", | ||
"resolve-import": "^1.4.5", | ||
@@ -54,3 +54,3 @@ "rimraf": "^5.0.1", | ||
"@types/node": "^20.12.7", | ||
"prettier": "^2.8.8", | ||
"prettier": "^3.3.2", | ||
"tap": "^19.2.1", | ||
@@ -60,2 +60,3 @@ "typedoc": "^0.26.2" | ||
"prettier": { | ||
"experimentalTernaries": true, | ||
"semi": false, | ||
@@ -62,0 +63,0 @@ "printWidth": 70, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
208014
1561
+ Addedpolite-json@5.0.0(transitive)
- Removedpolite-json@4.0.1(transitive)
Updatedpolite-json@^5.0.0