Comparing version 1.7.0 to 1.8.0
@@ -25,6 +25,6 @@ import chalk from 'chalk'; | ||
} | ||
setFolderDialect('.tshy-build-tmp/' + d, 'commonjs'); | ||
setFolderDialect('.tshy-build/' + d, 'commonjs'); | ||
for (const [override, orig] of pf?.map.entries() ?? []) { | ||
const stemFrom = resolve(`.tshy-build-tmp/${d}`, relative(resolve('src'), resolve(override))).replace(/\.cts$/, ''); | ||
const stemTo = resolve(`.tshy-build-tmp/${d}`, relative(resolve('src'), resolve(orig))).replace(/\.tsx?$/, ''); | ||
const stemFrom = resolve(`.tshy-build/${d}`, relative(resolve('src'), resolve(override))).replace(/\.cts$/, ''); | ||
const stemTo = resolve(`.tshy-build/${d}`, relative(resolve('src'), resolve(orig))).replace(/\.tsx?$/, ''); | ||
unlinkSync(`${stemTo}.js.map`); | ||
@@ -31,0 +31,0 @@ unlinkSync(`${stemTo}.d.ts.map`); |
@@ -25,6 +25,6 @@ import chalk from 'chalk'; | ||
} | ||
setFolderDialect('.tshy-build-tmp/' + d, 'esm'); | ||
setFolderDialect('.tshy-build/' + d, 'esm'); | ||
for (const [override, orig] of pf?.map.entries() ?? []) { | ||
const stemFrom = resolve(`.tshy-build-tmp/${d}`, relative(resolve('src'), resolve(override))).replace(/\.mts$/, ''); | ||
const stemTo = resolve(`.tshy-build-tmp/${d}`, relative(resolve('src'), resolve(orig))).replace(/\.tsx?$/, ''); | ||
const stemFrom = resolve(`.tshy-build/${d}`, relative(resolve('src'), resolve(override))).replace(/\.mts$/, ''); | ||
const stemTo = resolve(`.tshy-build/${d}`, relative(resolve('src'), resolve(orig))).replace(/\.tsx?$/, ''); | ||
unlinkSync(`${stemTo}.js.map`); | ||
@@ -31,0 +31,0 @@ unlinkSync(`${stemTo}.d.ts.map`); |
@@ -6,3 +6,3 @@ import * as console from './console.js'; | ||
import { unlink as unlinkImports } from './unbuilt-imports.js'; | ||
import { unlink as unlinkSelfDep } from './self-dep.js'; | ||
import { unlink as unlinkSelfDep } from './self-link.js'; | ||
import pkg from './package.js'; | ||
@@ -9,0 +9,0 @@ export default (res) => { |
import chalk from 'chalk'; | ||
import { rimrafSync } from 'rimraf'; | ||
import { syncContentSync } from 'sync-content'; | ||
@@ -7,11 +6,12 @@ import bins from './bins.js'; | ||
import { buildESM } from './build-esm.js'; | ||
import cleanBuildTmp from './clean-build-tmp.js'; | ||
import * as console from './console.js'; | ||
import dialects from './dialects.js'; | ||
import { link as linkImports, save as saveImports, unlink as unlinkImports, } from './unbuilt-imports.js'; | ||
import pkg from './package.js'; | ||
import { link as linkSelfDep, unlink as unlinkSelfDep, } from './self-dep.js'; | ||
import { link as linkSelfDep, unlink as unlinkSelfDep, } from './self-link.js'; | ||
import './tsconfig.js'; | ||
import { link as linkImports, save as saveImports, unlink as unlinkImports, } from './unbuilt-imports.js'; | ||
import writePackage from './write-package.js'; | ||
export default async () => { | ||
rimrafSync('.tshy-build-tmp'); | ||
cleanBuildTmp(); | ||
linkSelfDep(pkg, 'src'); | ||
@@ -26,5 +26,5 @@ await linkImports(pkg, 'src'); | ||
console.debug(chalk.cyan.dim('moving to ./dist')); | ||
syncContentSync('.tshy-build-tmp', 'dist'); | ||
console.debug(chalk.cyan.dim('removing build temp dir')); | ||
rimrafSync('.tshy-build-tmp'); | ||
syncContentSync('.tshy-build', 'dist'); | ||
console.debug(chalk.cyan.dim('cleaning build temp dir')); | ||
cleanBuildTmp(); | ||
linkSelfDep(pkg, 'dist'); | ||
@@ -31,0 +31,0 @@ if (pkg.imports) { |
@@ -6,11 +6,7 @@ // prevent the use of verbatimModuleSyntax: true when | ||
// are jsonc. | ||
import { resolve } from 'path'; | ||
import ts from 'typescript'; | ||
import * as console from './console.js'; | ||
import fail from './fail.js'; | ||
const { readFile } = ts.sys; | ||
import readTypescriptConfig from './read-typescript-config.js'; | ||
export default () => { | ||
const configPath = resolve('tsconfig.json'); | ||
const readResult = ts.readConfigFile(configPath, readFile); | ||
const config = ts.parseJsonConfigFileContent(readResult.config, ts.sys, process.cwd()); | ||
const config = readTypescriptConfig(); | ||
if (config.options.verbatimModuleSyntax) { | ||
@@ -17,0 +13,0 @@ fail('verbatimModuleSyntax detected'); |
@@ -53,3 +53,3 @@ import chalk from 'chalk'; | ||
compilerOptions: { | ||
outDir: '../.tshy-build-tmp/' + | ||
outDir: '../.tshy-build/' + | ||
(dialect === 'cjs' ? 'commonjs' : dialect), | ||
@@ -73,3 +73,3 @@ }, | ||
compilerOptions: { | ||
outDir: '../.tshy-build-tmp/' + dialect, | ||
outDir: '../.tshy-build/' + dialect, | ||
}, | ||
@@ -76,0 +76,0 @@ }; |
{ | ||
"name": "tshy", | ||
"version": "1.7.0", | ||
"version": "1.8.0", | ||
"description": "TypeScript HYbridizer - Hybrid (CommonJS/ESM) TypeScript node package builder", | ||
@@ -5,0 +5,0 @@ "author": "Isaac Z. Schlueter <i@izs.me> (https://izs.me)", |
@@ -94,3 +94,3 @@ # tshy - TypeScript HYbridizer | ||
This doesn't mean you shouldn't care about it. It mean that you | ||
This doesn't mean you shouldn't care about it. It means that you | ||
_should_ take it into consideration always, whether you are using | ||
@@ -457,2 +457,6 @@ a hybrid build or not. | ||
If the `selfLink` config is not explicitly set, and creating the | ||
symlink fails (common on Windows systems where `fs.symlink()` may | ||
require elevated permissions), then the error will be ignored. | ||
### Old Style Exports | ||
@@ -649,3 +653,3 @@ | ||
Code is built in `./.tshy-build-tmp` and then copied over only if | ||
Code is built in `./.tshy-build` and then copied over only if | ||
the build succeeds. This makes it work in monorepo cases where | ||
@@ -656,2 +660,6 @@ you may have packages that depend on one another and are all | ||
If you use `"incremental": true` in your tsconfig, then this | ||
folder will persist, so that TSC can benefit from the | ||
`.tsbuildinfo` files it creates in there. | ||
## Exports Management | ||
@@ -658,0 +666,0 @@ |
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
167040
135
1308
802
10