unplugin-atscript 0.1.37 → 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.
- package/README.md +29 -88
- package/dist/esbuild.cjs +1 -1
- package/dist/esbuild.mjs +1 -1
- package/dist/farm.cjs +1 -1
- package/dist/farm.mjs +1 -1
- package/dist/rolldown.cjs +1 -1
- package/dist/rolldown.mjs +1 -1
- package/dist/rollup.cjs +1 -1
- package/dist/rollup.mjs +1 -1
- package/dist/rspack.cjs +1 -1
- package/dist/rspack.mjs +1 -1
- package/dist/vite.cjs +1 -1
- package/dist/vite.d.ts +2 -2
- package/dist/vite.mjs +1 -1
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -1,116 +1,57 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://atscript.moost.org/logo.svg" alt="Atscript" width="120" />
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<h1 align="center">unplugin-atscript</h1>
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
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
|
-
|
|
16
|
-
npm install -D unplugin-atscript @atscript/typescript
|
|
17
|
-
```
|
|
15
|
+
---
|
|
18
16
|
|
|
19
|
-
|
|
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
|
-
|
|
22
|
-
yarn add --dev unplugin-atscript @atscript/typescript
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
or
|
|
19
|
+
## Installation
|
|
26
20
|
|
|
27
|
-
```
|
|
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
|
-
##
|
|
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
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
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
|
-
|
|
50
|
+
## Documentation
|
|
109
51
|
|
|
110
|
-
|
|
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
|
-
|
|
57
|
+
MIT
|
package/dist/esbuild.cjs
CHANGED
package/dist/esbuild.mjs
CHANGED
package/dist/farm.cjs
CHANGED
package/dist/farm.mjs
CHANGED
package/dist/rolldown.cjs
CHANGED
|
@@ -74,7 +74,7 @@ const unpluginFactory = (opts) => {
|
|
|
74
74
|
};
|
|
75
75
|
|
|
76
76
|
//#endregion
|
|
77
|
-
//#region packages/unplugin/src/rolldown.ts
|
|
77
|
+
//#region packages/unplugin/src/adapters/rolldown.ts
|
|
78
78
|
var rolldown_default = (0, unplugin.createRolldownPlugin)(unpluginFactory);
|
|
79
79
|
|
|
80
80
|
//#endregion
|
package/dist/rolldown.mjs
CHANGED
package/dist/rollup.cjs
CHANGED
package/dist/rollup.mjs
CHANGED
package/dist/rspack.cjs
CHANGED
package/dist/rspack.mjs
CHANGED
package/dist/vite.cjs
CHANGED
package/dist/vite.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as vite from 'vite';
|
|
2
2
|
|
|
3
3
|
interface atscriptPluginOptions {
|
|
4
4
|
/**
|
|
@@ -8,6 +8,6 @@ interface atscriptPluginOptions {
|
|
|
8
8
|
strict?: boolean;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
declare const _default: (options?: atscriptPluginOptions | undefined) =>
|
|
11
|
+
declare const _default: (options?: atscriptPluginOptions | undefined) => vite.Plugin<any> | vite.Plugin<any>[];
|
|
12
12
|
|
|
13
13
|
export { _default as default };
|
package/dist/vite.mjs
CHANGED
package/dist/webpack.cjs
CHANGED
package/dist/webpack.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unplugin-atscript",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.39",
|
|
4
4
|
"description": "Atscript: Configuration and build plugins.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"annotations",
|
|
@@ -80,44 +80,44 @@
|
|
|
80
80
|
"vitest": "3.2.4"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
|
-
"@atscript/core": "^0.1.
|
|
84
|
-
"@atscript/typescript": "^0.1.
|
|
83
|
+
"@atscript/core": "^0.1.39",
|
|
84
|
+
"@atscript/typescript": "^0.1.39"
|
|
85
85
|
},
|
|
86
86
|
"build": [
|
|
87
87
|
{},
|
|
88
88
|
{
|
|
89
89
|
"entries": [
|
|
90
|
-
"src/vite.ts"
|
|
90
|
+
"src/adapters/vite.ts"
|
|
91
91
|
]
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
94
|
"entries": [
|
|
95
|
-
"src/rollup.ts"
|
|
95
|
+
"src/adapters/rollup.ts"
|
|
96
96
|
]
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
"entries": [
|
|
100
|
-
"src/rolldown.ts"
|
|
100
|
+
"src/adapters/rolldown.ts"
|
|
101
101
|
]
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
104
|
"entries": [
|
|
105
|
-
"src/webpack.ts"
|
|
105
|
+
"src/adapters/webpack.ts"
|
|
106
106
|
]
|
|
107
107
|
},
|
|
108
108
|
{
|
|
109
109
|
"entries": [
|
|
110
|
-
"src/esbuild.ts"
|
|
110
|
+
"src/adapters/esbuild.ts"
|
|
111
111
|
]
|
|
112
112
|
},
|
|
113
113
|
{
|
|
114
114
|
"entries": [
|
|
115
|
-
"src/rspack.ts"
|
|
115
|
+
"src/adapters/rspack.ts"
|
|
116
116
|
]
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
119
|
"entries": [
|
|
120
|
-
"src/farm.ts"
|
|
120
|
+
"src/adapters/farm.ts"
|
|
121
121
|
]
|
|
122
122
|
}
|
|
123
123
|
],
|