Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Oct 23, 2023
1 parent 7b16ef6 commit 27261c2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"fix": "run-p lint format",
"lint": "deno lint",
"format": "deno fmt",
"build": "unbuild",
"build": "unbuild && bun run ./scripts/deno.ts",
"test": "npm run test:typecheck && npm run test:unit",
"test:unit": "NODE_OPTIONS=--experimental-vm-modules vitest run ./src",
"test:typecheck": "vitest typecheck --config ./vitest.type.config.ts --run",
Expand Down
6 changes: 6 additions & 0 deletions scripts/deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,26 @@ async function main() {
throw new Error(`not found ${destPath}`)
}

console.log('copy some source files to denoland hosting directries 🦕 ...')

// copy docs
for (const p of ['README.md', 'LICENSE']) {
fs.copyFile(resolve(projectPath, p), resolve(destPath, p))
console.log(`${resolve(projectPath, p)} -> ${resolve(destPath, p)}`)
}

// copy source files
for (const target of TARGETS) {
fs.copyFile(resolve(sourcePath, target), resolve(destPath, target))
console.log(`${resolve(sourcePath, target)} -> ${resolve(destPath, target)}`)
}

// add `npm:` prefix
const webCode = await fs.readFile(resolve(destPath, 'web.ts'), 'utf-8')
const replacedWebCode = webCode.replace('from \'cookie-es\'', 'from \'npm:cookie-es\'')
await fs.writeFile(resolve(destPath, 'web.ts'), replacedWebCode, 'utf8')

console.log('... 🦕 done!')
}

main().catch((err) => {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.vitest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": ["./tsconfig.json"],
"exclude": ["./playground"]
"exclude": ["./playground", "./deno"]
}

0 comments on commit 27261c2

Please sign in to comment.