Skip to content

Commit

Permalink
chore(deps): Replace / prune various dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
darkobits committed Jul 12, 2023
1 parent 461f6d2 commit f8d8a65
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 46 deletions.
4 changes: 2 additions & 2 deletions nr.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { nr } from '@darkobits/ts';
import { withDefaultPackageScripts } from '@darkobits/ts';


export default nr(({ script, command, isCI }) => {
export default withDefaultPackageScripts(({ script, command, isCI }) => {
script('test.smoke', [[
// ----- [Smoke Tests] CJS Host Package --------------------------------

Expand Down
39 changes: 10 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@
"deepmerge": "^4.3.1",
"esbuild": "^0.18.11",
"esbuild-node-externals": "^1.8.0",
"fs-extra": "^11.1.1",
"get-tsconfig": "^4.6.2",
"read-pkg-up": "^10.0.0",
"tsconfck": "^2.1.1",
"yargs": "^17.7.2"
},
"devDependencies": {
"@darkobits/ts": "~0.18.8",
"@types/fs-extra": "^11.0.1"
"@darkobits/ts": "~0.18.8"
}
}
23 changes: 12 additions & 11 deletions src/lib/configuration/strategies/esbuild.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import fs from 'fs/promises';
import path from 'path';

import { TsconfigPathsPlugin } from '@esbuild-plugins/tsconfig-paths';
import * as esbuild from 'esbuild';
import { nodeExternalsPlugin } from 'esbuild-node-externals';
import fs from 'fs-extra';
import * as tsConfck from 'tsconfck';
import { getTsconfig } from 'get-tsconfig';


import log from 'lib/log';

Expand Down Expand Up @@ -83,14 +84,13 @@ export async function esbuildStrategy<M = any>(filePath: string, pkgInfo: Packag

// If the user has a TypeScript configuration file, enable TypeScript
// features.
const tsConfigFilePath = await tsConfck.find(filePath);

if (tsConfigFilePath) {
log.verbose(prefix, 'Using TypeScript configuration:', log.chalk.green(tsConfigFilePath));
buildOptions.tsconfig = tsConfigFilePath;
buildOptions.plugins?.push(TsconfigPathsPlugin({
tsconfig: tsConfigFilePath
}));
const tsConfigResult = getTsconfig(filePath);

if (tsConfigResult) {
const tsconfig = tsConfigResult.path;
log.verbose(prefix, 'Using TypeScript configuration:', log.chalk.green(tsconfig));
buildOptions.tsconfig = tsconfig;
buildOptions.plugins?.push(TsconfigPathsPlugin({ tsconfig }));
}

// Transpile the input file.
Expand All @@ -114,6 +114,7 @@ export async function esbuildStrategy<M = any>(filePath: string, pkgInfo: Packag
);
} finally {
// Remove the temporary file.
if (await fs.exists(tempFilePath)) await fs.remove(tempFilePath);
await fs.access(tempFilePath, fs.constants.F_OK)
.then(() => fs.unlink(tempFilePath));
}
}

0 comments on commit f8d8a65

Please sign in to comment.