Skip to content

Commit 3420cca

Browse files
committed
fix #174
1 parent 0e0542a commit 3420cca

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [2.3.1] - Unreleased
8+
### Fixed
9+
- Types for Node [#174]
10+
711
## [2.3.0] - 2025-12-25
812
### Added
913
- New `default` tag to assign fallback content to a variable [#164], [#166].
@@ -115,7 +119,9 @@ Vento 2.0 is now dependency-free and compatible with browsers without a build st
115119
[#164]: https://github.com/ventojs/vento/issues/164
116120
[#166]: https://github.com/ventojs/vento/issues/166
117121
[#167]: https://github.com/ventojs/vento/issues/167
122+
[#174]: https://github.com/ventojs/vento/issues/174
118123

124+
[2.3.1]: https://github.com/ventojs/vento/compare/v2.3.0...HEAD
119125
[2.3.0]: https://github.com/ventojs/vento/compare/v2.2.0...v2.3.0
120126
[2.2.0]: https://github.com/ventojs/vento/compare/v2.1.1...v2.2.0
121127
[2.1.1]: https://github.com/ventojs/vento/compare/v2.1.0...v2.1.1

_scripts/build_npm.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,26 @@ for await (const { path } of walk("_npm", { exts: [".js"] })) {
9292
Deno.writeTextFile(path, code.replaceAll(/\.ts";/g, '.js";'));
9393
}
9494

95+
// Some fine-tuning replacements: https://github.com/ventojs/vento/issues/174
96+
const replacements = new Map<string, string>([
97+
[
98+
'import { type Token } from "./tokenizer.d.ts";',
99+
'import type { Token } from "./tokenizer.d.ts";',
100+
],
101+
[
102+
'import { Environment, type Loader } from "./core/environment.d.ts";',
103+
'import type { Environment, Loader } from "./core/environment.d.ts";',
104+
],
105+
]);
106+
95107
// Replace .ts extensions with .d.ts in the imports of TypeScript files
96108
for await (const { path } of walk("_npm", { exts: [".ts"] })) {
97-
const code = await Deno.readTextFile(path);
98-
Deno.writeTextFile(path, code.replaceAll(/\.ts";/g, '.d.ts";'));
109+
let code = Deno.readTextFileSync(path).replaceAll(/\.ts";/g, '.d.ts";');
110+
for (const [search, replace] of replacements) {
111+
code = code.replace(search, replace);
112+
}
113+
114+
Deno.writeTextFile(path, code);
99115
}
100116

101117
// Remove the TypeScript files

0 commit comments

Comments
 (0)