Updated Build Config

This commit is contained in:
2025-08-16 09:58:40 +05:30
parent 4319823c76
commit 1c2198537a
6 changed files with 127 additions and 49 deletions
+1
View File
@@ -0,0 +1 @@
@wrnexus:registry=https://registry.workroot.in/repository/npm/
+29
View File
@@ -0,0 +1,29 @@
---
## 4) `LICENSE` (MIT)
> Replace the year/name.
```text
MIT License
Copyright (c) 2025 Your Name
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
+14 -38
View File
@@ -1,43 +1,19 @@
# Astro Starter Kit: Minimal
# @wrnexus/astro
```sh
npm create astro@latest -- --template minimal
```
Form + field components for **Astro** with Tailwind utilities and Zod-ready validation hooks.
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
-`<Form />` — submit handling + client validation plumbing
-`<Field />` — text/email/password/number/textarea/select/date/time/file/checkbox/radio/switch
-`<MultiSelect />` — searchable, checkbox-driven multi select dropdown
-`<Button />`, `<Icon />` helpers
- 🎯 Works with your Tailwind tokens (e.g., `bg-primary`, `text-foreground`, `border-border`)
- 🧪 Zod integration: pass `schemaName` to `<Form />` and expose a schema as `window[schemaName]`
## 🚀 Project Structure
---
Inside of your Astro project, you'll see the following folders and files:
## Installation
```text
/
├── public/
├── src/
│ └── pages/
│ └── index.astro
└── package.json
```
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
Any static assets, like images, can be placed in the `public/` directory.
## 🧞 Commands
All commands are run from the root of the project, from a terminal:
| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI |
## 👀 Want to learn more?
Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
```bash
pnpm add @wrnexus/astro
# or
npm i @wrnexus/astro
+45 -11
View File
@@ -10,28 +10,63 @@
"type": "git",
"url": "https://git.workroot.in/WorkRoot/Astro-UI.git"
},
"bugs": {
"url": "https://git.workroot.in/WorkRoot/Astro-UI/issues"
},
"keywords": [
"astro",
"astro-component",
"astro-component-library",
"astro-ui-library",
"astro-ui"
"forms",
"tailwindcss",
"zod",
"ui",
"components"
],
"sideEffects": false,
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./components/*": "./src/components/*",
"./utils/*": "./src/utils/*"
},
"files": [
"src",
"dist",
"README.md",
"LICENSE"
],
"peerDependencies": {
"astro": ">=4.0.0",
"class-variance-authority": ">=0.7.0",
"tailwindcss": ">=3.4.0"
},
"peerDependenciesMeta": {
"tailwindcss": {
"optional": true
}
},
"engines": {
"node": ">=18.17"
},
"scripts": {
"dev": "astro dev",
"build": "astro build",
"build": "node ./scripts/make-dist.mjs",
"preview": "astro preview",
"astro": "astro",
"check": "astro check",
"build:prod": "astro check && astro build"
},
"exports": {
"./*": "./src/components/*"
"build:prod": "astro check && astro build",
"prepublishOnly": "npm run verify",
"verify": "node -e \"console.log('✅ ready to publish')\"",
"version:patch": "npm version patch -m \"chore(release): %s\"",
"version:minor": "npm version minor -m \"chore(release): %s\"",
"version:major": "npm version major -m \"chore(release): %s\"",
"release:canary": "npm version prerelease --preid=canary && npm publish --tag canary",
"release": "npm publish --access public"
},
"dependencies": {
"@tailwindcss/vite": "^4.1.12",
"astro": "^5.13.0",
"tailwindcss": "^4.1.12",
"zod": "^3.25.76"
},
"devDependencies": {
@@ -39,7 +74,6 @@
"@iconify/json": "^2.2.373",
"@iconify/utils": "^3.0.1",
"@tailwindcss/forms": "^0.5.10",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"tailwind-merge": "^3.3.1"
}
+30
View File
@@ -0,0 +1,30 @@
// scripts/make-dist.mjs
import fs from "node:fs";
import path from "node:path";
const distDir = path.resolve("dist");
if (!fs.existsSync(distDir)) fs.mkdirSync(distDir, { recursive: true });
const indexJs = `/* Auto-generated by scripts/make-dist.mjs */
export { default as Button } from "../src/components/Button.astro";
export { default as Form } from "../src/components/Form.astro";
export { default as Field } from "../src/components/Field.astro";
export { default as MultiSelect } from "../src/components/MultiSelect.astro";
export { default as Icon } from "../src/components/Icon.astro";
export { cn } from "../src/utils/cn.js";
`;
const indexDts = `/* Auto-generated types (lightweight) */
/// <reference types="astro/client" />
export const Button: any;
export const Form: any;
export const Field: any;
export const MultiSelect: any;
export const Icon: any;
export function cn(...classes: Array<string | number | false | null | undefined>): string;
`;
fs.writeFileSync(path.join(distDir, "index.js"), indexJs, "utf8");
fs.writeFileSync(path.join(distDir, "index.d.ts"), indexDts, "utf8");
console.log("🧱 Wrote dist/index.js and dist/index.d.ts");
+8
View File
@@ -0,0 +1,8 @@
export { default as Button } from "./components/Button.astro";
export { default as Form } from "./components/Form.astro";
export { default as Field } from "./components/Field.astro";
export { default as MultiSelect } from "./components/MultiSelect.astro";
export { default as Icon } from "./components/Icon.astro";
// Utils
export { cn } from "./utils/cn";