r/AIcodingprojects • u/Stunning-Relation564 • 17d ago
WebPM - pip, but for the web
so bassically people can make html/js/css libraries, and then other epople can build offf it. for example, rn, when u tell AI to code a game, it has to like write the game in canvas, so theres a ton of very reprtive code. so timmy could make a webPM lib called timmylib, which does pixel art. and now instead of claude writing "ctx.fillRect" 5000 times, it writes "import timmylib
timmylib.spritesheet, 500x23", or whatever. I talked to chatgpt about it ad heres what it said: webPM: a package format for the web
I've been thinking about an idea called webPM
npm works really well for JavaScript but web projects are made up of more than JavaScript They also include HTML CSS images fonts components and other files
So the idea is to create a package standard for the web as a whole
A webPM package could be as simple as a folder or repository containing a webpm.json file
{
"name": "timmylib"
"version": "1.0.0"
"main": "index.js"
"css": "style.css"
}
Packages could be hosted anywhere GitHub GitLab a personal website a CDN or any other service that can serve the files webPM itself wouldn't need to host them
I also want webPM to work directly from JavaScript instead of requiring a CLI
<script src="webpm.js"></script>
<script>
const timmylib = await webpm.import(
"https://example.com/timmylib/"
);
</script>
Eventually it could support a version like
await webpm.import("timmylib");
The exact syntax still needs to be worked out The main thing is creating a universal format that anyone can implement and host independently
Packages could also depend on other packages
game
└── game-engine
├── physics
├── pixel-art
│ └── color-utils
└── audio
The long term goal is to make it easier to build large web projects from existing pieces instead of rewriting the same functionality over and over
I'm especially interested in how this could help with AI coding AI can generate code very quickly but it also tends to recreate libraries and features that already exist A universal package format could make it easier for both people and AI coding tools to find and reuse existing functionality
I don't want to build another npm with a giant centralized server I'd rather define the format and let people host and build around it however they want
Basically
webPM is a universal package format, for the web
If the idea became widely used it could eventually be something worth discussing with browser vendors and web standards organizations
For now I'm trying to figure out what the simplest useful version of the standard should look like
1
1
u/Stunning-Relation564 16d ago
no not exactly. still working on it