Advertisement · 728 × 90

Posts by Hiroki Osame

Preview
GitHub - privatenumber/npm-pkg-settings: Programmatic access to npm package publish settings Programmatic access to npm package publish settings - privatenumber/npm-pkg-settings

Made a JS API & CLI for npm package settings

Now you can easily update Trusted Publisher and Publishing Access settings from the CLI or in bulk with a script

github.com/privatenumber/npm-pkg-settings

1 month ago 0 0 0 0
Preview
GitHub - privatenumber/doctor-json: Surgically edit JSON & JSONC strings while preserving whitespace, comments, and formatting Surgically edit JSON & JSONC strings while preserving whitespace, comments, and formatting - privatenumber/doctor-json

New package: doctor-json 👨🏻‍⚕️

An util to manipulate JSON/JSONC while preserving their formatting and comments

The API is so simple—manipulate the parsed object just like you would any plain object, and stringify!

github.com/privatenumber/doctor-json

1 month ago 2 0 0 0
Preview
GitHub - privatenumber/poof: Fast, non-blocking rm -rf alternative. Deletes files instantly while cleanup runs in the background. Fast, non-blocking rm -rf alternative. Deletes files instantly while cleanup runs in the background. - privatenumber/poof

Made a little tool because I've wasted too much time waiting for `rm -rf node_modules` in large repos

Now I can just do `poof node_modules` 💨

github.com/privatenumber/poof

3 months ago 2 1 0 0
Preview
GitHub - privatenumber/minification-benchmarks: 🏃‍♂️🏃‍♀️🏃 JS minification benchmarks: babel-minify, esbuild, terser, uglify-js, swc, google closure compiler, tdewolff/minify, oxc-minify 🏃‍♂️🏃‍♀️🏃 JS minification benchmarks: babel-minify, esbuild, terser, uglify-js, swc, google closure compiler, tdewolff/minify, oxc-minify - privatenumber/minification-benchmarks

`oxc-minify` is now the recommended minifier when using @rolldown.rs!
While continuously tweaking the performance, the minifier is already outperforming `esbuild` in terms of speed and size.

Check out the benchmark by @hirok.io for perf comparison.

github.com/privatenumbe...

11 months ago 12 2 2 0
Preview
Prototyping with AI models - GitHub Docs Find and experiment with AI models for free.

Yep!

Limit depends on the model:
docs.github.com/en/github-mo...

1 year ago 2 0 0 0

It's so crazy I can do this for free now

If you're interested in how I do this, I'm querying GPT 4o on @github.com Models via GH Actions on every PR 🙏

Here's the system prompt:
github.com/privatenumbe...

1 year ago 2 0 1 0
Post image

🤖 Minification Benchmarks now includes an AI analysis with clear recommendations

No more manual analysis—read which minifier is best for your needs

It's also really entertaining to read:
github.com/privatenumbe...

1 year ago 5 1 1 0
Documentation - Modules - Reference Module syntax and compiler options reference

Hmm yeah I think the conversation happened around there

I think it was kind of a hidden exchange on a commit or something...

The closest thing I could find was in the docs where imports is mentioned as a standard replacement for paths:

www.typescriptlang.org/docs/handboo....

1 year ago 1 0 0 0

I vaguely remember a TypeScript discussion where they were considering deprecating tsconfig#paths in favor of package.json#imports (but concluded it was too early?)

I searched around but couldn't find it...

Does this ring a bell for anyone?

1 year ago 1 0 1 0
Advertisement
Post image

dtsroll is a Type Script declaration file (.d.ts) bundler

Use it to:
- Tree-shake unused types
- Bundle in private monorepo deps
- Improve type-checking perf

👉 github.com/privatenumber/dtsroll

1 year ago 57 6 1 0
Post image

Great end to 2024 🎉

🌟 10k GitHub stars
⬇️ 19.5M downloads a month

Thank you everyone ❤️

1 year ago 9 1 0 0

Very cool! Thanks for making this Kevin 🙌

1 year ago 1 0 0 0

Good point!

Hope that Issue gains more momentum soon

Import Attributes have been supported and stable for a while now

1 year ago 1 0 0 0
Preview
Static Asset Handling Next Generation Frontend Tooling

Thanks for sharing! I didn’t know it had better web support

Yep, bundlers conventionally use query parameters for this: vite.dev/guide/assets

But ImportAttributes has been around for a while now and can work seamlessly across platforms. I wonder why it hasn't caught on

1 year ago 1 0 1 0
Post image

In your TS project, enabling verbatimModuleSyntax is highly recommended for predictable compilation

If you haven't yet because of the errors it produces, I made an auto-fixer:
github.com/privatenumbe...

1 year ago 53 7 0 2
Modules: ECMAScript modules | Node.js v23.5.0 Documentation

Why haven't Import Attributes taken off? Seems it stopped at JSON support

It would be great to be able to import text files and create a run-time dependency on it:
```ts
import fileContent from './file.txt' with { type: 'text' }
```

nodejs.org/api/esm.html...

1 year ago 10 0 4 0

You’re killing it 🔥

1 year ago 1 0 0 0
Advertisement

Thank you and HNY!

1 year ago 1 0 0 0
Post image

Good year 😊

1 year ago 24 0 1 1
Preview
GitHub - privatenumber/vite-css-modules: Vite plugin for correct CSS Modules behavior Vite plugin for correct CSS Modules behavior. Contribute to privatenumber/vite-css-modules development by creating an account on GitHub.

vite-css-modules now supports Vite 6!

👉 github.com/privatenumber/vite-css-modules

1 year ago 45 3 1 0

Unsure what you mean by "tree-shake the external dependencies"

Externalized deps are excluded from the bundle, so it's never tree-shaken

1 year ago 0 0 0 0
Preview
Tree Shaking | webpack webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable of transforming, bundling, or packaging just about any resource or asset.

Webpack relies heavily on Terser to handle dead code elimination: webpack.js.org/guides/tree-...

SWC works as an alternative because it's the Rust port of Terser: github.com/swc-project/...

1 year ago 1 0 0 0
Preview
Think twice before importing package source files Importing source files from packages during development can cost you more than it saves

Are you using tsx to import source files across workspace packages?

You may be making expensive trade-offs without realizing it

Here's a breakdown of the risks and better alternatives:

👉 hirok.io/posts/importing-source-files-in-dev

1 year ago 6 1 1 0
Preview
GitHub - privatenumber/pkgroll: 📦 Zero-config package bundler for Node.js + TypeScript 📦 Zero-config package bundler for Node.js + TypeScript - privatenumber/pkgroll

Do yourself a favor and delete those hacks & brittle build steps you cobbled together, for your library to be consumable from both esm & cjs.
Then simply make sure your package.json declares the entrypoints you want & let pkgroll by @hirok.io do the rest!
What a delightful little tool ❤️

1 year ago 6 1 2 0
Preview
Change Request: PostCSS syntax support · Issue #29 · eslint/css Environment ESLint version: Latest (Possible to include the version on the Code Explorer?) @eslint/css version: Latest (Possible to include the version on the Code Explorer?) Node version: N/A npm ...

Hey PostCSS experts, folks have requested the ability to parse PostCSS-specific syntax in ESLint, but I really don't know how to accomplish that. Your comments on this issue would be appreciated:
github.com/eslint/css/i...

1 year ago 4 1 0 0

Love the distinction between link and file:// hard linking

I supported this in my ‘link’ package as “publish mode”

Is there a Watch mode to keep file:// dependencies up to date during development? (e.g. new files)

1 year ago 1 0 0 0
Advertisement

I think this makes my point

A beginner shouldn't need to understand all that to wrap their head around
useEffect(() => {}, []) === onMounted(() => {})

This is about empathizing with beginners, not trivializing concepts we already get

1 year ago 0 0 1 0

That would trigger on server as well, which may be undesired

And may even build up server memory via closure

1 year ago 0 0 1 0

Yeah, things make sense once they click

But I think theres room for improvement in how long it takes to get there

With unsemantic conventions like this, there’s more to learn before a beginner can read code without pausing to check the docs

1 year ago 1 0 0 0

What if you’re not dealing with a DOM element?

In the case I saw, it was used to trigger i18n initialization

Not sure why it had to be on mount—maybe to distinguish from server?

1 year ago 0 0 1 0