@gjuchault/typescript-library-starter
Advanced tools
Comparing version 5.0.2 to 5.0.3
@@ -11,4 +11,8 @@ { | ||
"skipFiles": ["<node_internals>/**", "**/node_modules/**"], | ||
"program": "${workspaceRoot}/node_modules/tsx/dist/cli.mjs", | ||
"args": ["--inspect", "--test", "${relativeFile}"], | ||
"program": "${relativeFile}", | ||
"runtimeArgs": [ | ||
"--import=@nitrogql/esbuild-register", | ||
"--inspect", | ||
"--test" | ||
], | ||
"smartStep": true, | ||
@@ -15,0 +19,0 @@ "console": "integratedTerminal" |
@@ -7,4 +7,8 @@ { | ||
"type": "shell", | ||
"command": "${workspaceRoot}/node_modules/tsx/dist/cli.mjs", | ||
"args": ["--test", "${relativeFile}"], | ||
"command": "node", | ||
"args": [ | ||
"--import=@nitrogql/esbuild-register", | ||
"--test", | ||
"${relativeFile}" | ||
], | ||
"presentation": { | ||
@@ -11,0 +15,0 @@ "clear": true, |
import { createRequire } from 'module'; | ||
import { fileURLToPath } from 'url'; | ||
const require = createRequire(import.meta.url); | ||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
import { createRequire as createRequire0f6a3633c3944a0fa29dfc1f68ecf39b } from 'module'; | ||
import { fileURLToPath as fileURLToPath0f6a3633c3944a0fa29dfc1f68ecf39b } from 'url'; | ||
import { dirname as dirname0f6a3633c3944a0fa29dfc1f68ecf39b } from 'path'; | ||
// using var here to allow subsequent override by authors of this | ||
// library that would be using the same ESM trick | ||
var require = createRequire0f6a3633c3944a0fa29dfc1f68ecf39b(import.meta.url); | ||
var __filename = fileURLToPath0f6a3633c3944a0fa29dfc1f68ecf39b(import.meta.url); | ||
var __dirname = dirname0f6a3633c3944a0fa29dfc1f68ecf39b(__filename); | ||
@@ -8,0 +12,0 @@ |
@@ -1,2 +0,2 @@ | ||
## [5.0.2](https://github.com/gjuchault/typescript-library-starter/compare/v5.0.1...v5.0.2) (2024-01-05) | ||
## [5.0.3](https://github.com/gjuchault/typescript-library-starter/compare/v5.0.2...v5.0.3) (2024-01-10) | ||
@@ -6,2 +6,3 @@ | ||
* always generate esm-compatibility banner ([52575a2](https://github.com/gjuchault/typescript-library-starter/commit/52575a2d0bd011136a61fb2e36022a606370b01a)) | ||
* **build:** dynamic require banner ([80c0be0](https://github.com/gjuchault/typescript-library-starter/commit/80c0be06c354a47a7b137dfbb0da3fcd1c2d4d10)) | ||
* **vscode:** launch & tasks to not use tsx ([405d13f](https://github.com/gjuchault/typescript-library-starter/commit/405d13f1b32e4cf6d2e65bd13ec2cca0aa89079c)) |
{ | ||
"name": "@gjuchault/typescript-library-starter", | ||
"version": "5.0.2", | ||
"version": "5.0.3", | ||
"description": "Yet another typescript library starter template", | ||
@@ -62,5 +62,5 @@ "keywords": [ | ||
"@types/prompts": "^2.4.9", | ||
"@typescript-eslint/eslint-plugin": "^6.17.0", | ||
"@typescript-eslint/parser": "^6.17.0", | ||
"c8": "^8.0.1", | ||
"@typescript-eslint/eslint-plugin": "^6.18.1", | ||
"@typescript-eslint/parser": "^6.18.1", | ||
"c8": "^9.0.0", | ||
"cspell": "^8.3.2", | ||
@@ -67,0 +67,0 @@ "esbuild": "^0.19.11", |
import path from "node:path"; | ||
import url from "node:url"; | ||
import { build as esbuild } from "esbuild"; | ||
import { randomUUID } from "node:crypto"; | ||
@@ -9,2 +10,4 @@ const srcPath = path.join(process.cwd(), "src"); | ||
async function build() { | ||
const buildId = randomUUID().replace(/-/g, ""); | ||
return esbuild({ | ||
@@ -21,7 +24,11 @@ platform: "node", | ||
js: ` | ||
import { createRequire } from 'module'; | ||
import { fileURLToPath } from 'url'; | ||
const require = createRequire(import.meta.url); | ||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
import { createRequire as createRequire${buildId} } from 'module'; | ||
import { fileURLToPath as fileURLToPath${buildId} } from 'url'; | ||
import { dirname as dirname${buildId} } from 'path'; | ||
// using var here to allow subsequent override by authors of this | ||
// library that would be using the same ESM trick | ||
var require = createRequire${buildId}(import.meta.url); | ||
var __filename = fileURLToPath${buildId}(import.meta.url); | ||
var __dirname = dirname${buildId}(__filename); | ||
`, | ||
@@ -28,0 +35,0 @@ }, |
Sorry, the diff of this file is not supported yet
35210
581