unplugin-atscript 0.1.38 → 0.1.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +29 -88
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,116 +1,57 @@
1
- # Atscript Unplugin
1
+ <p align="center">
2
+ <img src="https://atscript.moost.org/logo.svg" alt="Atscript" width="120" />
3
+ </p>
2
4
 
3
- An Unplugin for processing `.as` files using [Atscript](https://github.com/moostjs/atscript). This plugin enables seamless integration of Atscript into modern build tools like Vite and Rollup. Thanks to Unplugin, it also supports Webpack and other bundlers.
5
+ <h1 align="center">unplugin-atscript</h1>
4
6
 
5
- ## Features
6
-
7
- - Supports `.as` file resolution and transformation
8
- - Loads and processes `.as` files with Atscript
9
- - Generates JavaScript output
10
- - Compatible with Vite, Rollup, Rolldown, Webpack, Rspack, esbuild, and Farm
11
- - Separate entry point for each bundler — import only what you need
7
+ <p align="center">
8
+ <strong>Define your models once</strong> — get TypeScript types, runtime validation, and DB metadata from a single <code>.as</code> model.
9
+ </p>
12
10
 
13
- ## Installation
11
+ <p align="center">
12
+ <a href="https://atscript.moost.org">Documentation</a> · <a href="https://atscript.moost.org/packages/typescript/build-setup">Build Setup Guide</a>
13
+ </p>
14
14
 
15
- ```sh
16
- npm install -D unplugin-atscript @atscript/typescript
17
- ```
15
+ ---
18
16
 
19
- or
17
+ Build tool plugin that compiles `.as` files during development. Works with Vite, Webpack, Rollup, Rolldown, esbuild, Rspack, and Farm via [Unplugin](https://unplugin.unjs.io/).
20
18
 
21
- ```sh
22
- yarn add --dev unplugin-atscript @atscript/typescript
23
- ```
24
-
25
- or
19
+ ## Installation
26
20
 
27
- ```sh
28
- pnpm add -D unplugin-atscript @atscript/typescript
21
+ ```bash
22
+ pnpm add -D unplugin-atscript @atscript/typescript @atscript/core
29
23
  ```
30
24
 
31
- ## Usage
32
-
33
- ### Vite
25
+ ## Quick Start
34
26
 
35
27
  ```ts
36
28
  // vite.config.ts
37
- import { defineConfig } from 'vite'
38
29
  import atscript from 'unplugin-atscript/vite'
30
+ export default { plugins: [atscript()] }
39
31
 
40
- export default defineConfig({
41
- plugins: [atscript()],
42
- })
43
- ```
44
-
45
- ### Rollup
46
-
47
- ```ts
48
32
  // rollup.config.js
49
33
  import atscript from 'unplugin-atscript/rollup'
34
+ export default { plugins: [atscript()] }
50
35
 
51
- export default {
52
- input: 'src/main.ts',
53
- output: {
54
- dir: 'dist',
55
- format: 'esm',
56
- },
57
- plugins: [atscript()],
58
- }
59
- ```
60
-
61
- ### Webpack
62
-
63
- ```js
64
36
  // webpack.config.js
65
37
  const atscript = require('unplugin-atscript/webpack')
66
-
67
- module.exports = {
68
- plugins: [atscript()],
69
- }
70
- ```
71
-
72
- ### esbuild
73
-
74
- ```js
75
- import atscript from 'unplugin-atscript/esbuild'
76
- import { build } from 'esbuild'
77
-
78
- build({
79
- plugins: [atscript()],
80
- })
81
- ```
82
-
83
- ### Rolldown
84
-
85
- ```js
86
- import atscript from 'unplugin-atscript/rolldown'
87
-
88
- export default {
89
- plugins: [atscript()],
90
- }
38
+ module.exports = { plugins: [atscript()] }
91
39
  ```
92
40
 
93
- ### Rspack / Farm
94
-
95
- Use `unplugin-atscript/rspack` or `unplugin-atscript/farm` respectively — same pattern as above.
41
+ Also available: `unplugin-atscript/esbuild`, `unplugin-atscript/rolldown`, `unplugin-atscript/rspack`, `unplugin-atscript/farm`.
96
42
 
97
- ## How It Works
98
-
99
- 1. Resolves `.as` files in the project.
100
- 2. Loads the Atscript configuration.
101
- 3. Uses `@atscript/core` and `@atscript/typescript` to parse and transform `.as` files into JavaScript.
102
- 4. Outputs the generated JavaScript for further processing.
103
-
104
- ## Configuration
43
+ ## Features
105
44
 
106
- The plugin automatically loads the Atscript configuration from your project. You can define additional options in your Atscript configuration file (`atscript.config.{js,mjs,cjs,ts,mts,cts}`).
45
+ - Universal bundler support via dedicated entry points
46
+ - Automatic `atscript.config.*` loading
47
+ - Strict validation — build fails on `.as` errors by default (`strict: false` to disable)
48
+ - Tree-shaking aware — marks non-mutating modules as side-effect-free
107
49
 
108
- ### Plugin Options
50
+ ## Documentation
109
51
 
110
- | Option | Type | Default | Description |
111
- | -------- | --------- | ------- | ------------------------------------------------------------------ |
112
- | `strict` | `boolean` | `true` | When `true`, throws an error if any `.as` document has diagnostics |
52
+ - [Build Setup Guide](https://atscript.moost.org/packages/typescript/build-setup)
53
+ - [Full Documentation](https://atscript.moost.org)
113
54
 
114
55
  ## License
115
56
 
116
- ISC
57
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unplugin-atscript",
3
- "version": "0.1.38",
3
+ "version": "0.1.39",
4
4
  "description": "Atscript: Configuration and build plugins.",
5
5
  "keywords": [
6
6
  "annotations",
@@ -80,8 +80,8 @@
80
80
  "vitest": "3.2.4"
81
81
  },
82
82
  "peerDependencies": {
83
- "@atscript/core": "^0.1.38",
84
- "@atscript/typescript": "^0.1.38"
83
+ "@atscript/core": "^0.1.39",
84
+ "@atscript/typescript": "^0.1.39"
85
85
  },
86
86
  "build": [
87
87
  {},