@golar-rstack/rsbuild 0.1.0
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/LICENSE +21 -0
- package/README.md +60 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +18 -0
- package/package.json +60 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Oskar Lebuda
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# @golar-rstack/rsbuild
|
|
2
|
+
|
|
3
|
+
Run [golar](https://golar.dev) type checking and type-aware linting alongside
|
|
4
|
+
your Rsbuild build, in a separate process.
|
|
5
|
+
|
|
6
|
+
Because golar is built on `typescript-go` and understands embedded languages,
|
|
7
|
+
type errors inside `.vue`, `.svelte`, `.astro` and `.gts` files are reported at
|
|
8
|
+
their real position in the source file.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pnpm add -D @golar-rstack/rsbuild golar
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
Create `golar.config.ts` in your project root. golar discovers it relative to
|
|
19
|
+
its working directory:
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { defineConfig } from 'golar/unstable'
|
|
23
|
+
import '@golar/vue'
|
|
24
|
+
|
|
25
|
+
export default defineConfig({})
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
// rsbuild.config.ts
|
|
30
|
+
import { pluginGolar } from '@golar-rstack/rsbuild'
|
|
31
|
+
import { defineConfig } from '@rsbuild/core'
|
|
32
|
+
import { pluginVue } from '@rsbuild/plugin-vue'
|
|
33
|
+
|
|
34
|
+
export default defineConfig({
|
|
35
|
+
plugins: [pluginVue(), pluginGolar()],
|
|
36
|
+
})
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
In `dev` the check runs asynchronously so it never delays HMR; results land in
|
|
40
|
+
the terminal and the browser error overlay. In `build` the compilation waits for
|
|
41
|
+
golar, so type errors fail the build.
|
|
42
|
+
|
|
43
|
+
## Options
|
|
44
|
+
|
|
45
|
+
See the [repository README](https://github.com/OskarLebuda/golar-rstack-plugin#options)
|
|
46
|
+
for the full list. Two worth knowing up front:
|
|
47
|
+
|
|
48
|
+
- `lintSeverity` defaults to `'warning'`, because golar exits 0 when only lint
|
|
49
|
+
rules fire.
|
|
50
|
+
- `cwd` defaults to Rsbuild's `rootPath` and is what selects the golar config,
|
|
51
|
+
since golar has no `--config` flag.
|
|
52
|
+
|
|
53
|
+
## Requirements
|
|
54
|
+
|
|
55
|
+
- Node.js >= 22.12
|
|
56
|
+
- `golar` installed in the project
|
|
57
|
+
|
|
58
|
+
## License
|
|
59
|
+
|
|
60
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { GolarMode } from '@golar-rstack/rspack';
|
|
2
|
+
import { GolarOptions } from '@golar-rstack/rspack';
|
|
3
|
+
import type { GolarRspackPluginOptions as GolarPluginOptions } from '@golar-rstack/rspack';
|
|
4
|
+
import { Issue } from '@golar-rstack/rspack';
|
|
5
|
+
import { IssueFilter } from '@golar-rstack/rspack';
|
|
6
|
+
import { IssueOrigin } from '@golar-rstack/rspack';
|
|
7
|
+
import { IssueSeverity } from '@golar-rstack/rspack';
|
|
8
|
+
import type { RsbuildPlugin } from '@rsbuild/core';
|
|
9
|
+
|
|
10
|
+
export { GolarMode }
|
|
11
|
+
|
|
12
|
+
export { GolarOptions }
|
|
13
|
+
|
|
14
|
+
export { GolarPluginOptions }
|
|
15
|
+
|
|
16
|
+
export { Issue }
|
|
17
|
+
|
|
18
|
+
export { IssueFilter }
|
|
19
|
+
|
|
20
|
+
export { IssueOrigin }
|
|
21
|
+
|
|
22
|
+
export { IssueSeverity }
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Runs [golar](https://golar.dev) type checking and linting alongside the
|
|
26
|
+
* Rsbuild compilation, in a separate process.
|
|
27
|
+
*
|
|
28
|
+
* While developing, the check runs asynchronously so it never delays HMR, and
|
|
29
|
+
* results land in the terminal and the browser error overlay. During a build
|
|
30
|
+
* the compilation waits for golar, so type errors fail the build.
|
|
31
|
+
*
|
|
32
|
+
* @param options Plugin options. `cwd` defaults to Rsbuild's `rootPath`, which
|
|
33
|
+
* is where `golar.config.*` normally lives. See the package README for the
|
|
34
|
+
* remaining defaults.
|
|
35
|
+
* @returns The Rsbuild plugin to add to your config.
|
|
36
|
+
*/
|
|
37
|
+
declare function pluginGolar(options?: GolarPluginOptions): RsbuildPlugin;
|
|
38
|
+
export default pluginGolar;
|
|
39
|
+
export { pluginGolar }
|
|
40
|
+
|
|
41
|
+
export { }
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { GolarRspackPlugin } from "@golar-rstack/rspack";
|
|
2
|
+
function pluginGolar(options = {}) {
|
|
3
|
+
return {
|
|
4
|
+
name: 'golar-rstack:rsbuild',
|
|
5
|
+
setup (api) {
|
|
6
|
+
api.modifyRspackConfig((config)=>{
|
|
7
|
+
config.plugins ??= [];
|
|
8
|
+
config.plugins.push(new GolarRspackPlugin({
|
|
9
|
+
...options,
|
|
10
|
+
cwd: options.cwd ?? api.context.rootPath
|
|
11
|
+
}));
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
const src = pluginGolar;
|
|
17
|
+
export default src;
|
|
18
|
+
export { pluginGolar };
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@golar-rstack/rsbuild",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"description": "Run golar type checking and linting in a separate process as an Rsbuild plugin",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Oskar Lebuda",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"golar",
|
|
10
|
+
"rsbuild",
|
|
11
|
+
"rsbuild-plugin",
|
|
12
|
+
"typecheck",
|
|
13
|
+
"typescript",
|
|
14
|
+
"vue",
|
|
15
|
+
"svelte",
|
|
16
|
+
"astro",
|
|
17
|
+
"rstack"
|
|
18
|
+
],
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"default": "./dist/index.js"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"module": "./dist/index.js",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"files": [
|
|
28
|
+
"dist"
|
|
29
|
+
],
|
|
30
|
+
"sideEffects": false,
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@golar-rstack/rspack": "0.1.0"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"@rsbuild/core": "^1.0.0 || ^2.0.0",
|
|
36
|
+
"golar": ">=0.1.0"
|
|
37
|
+
},
|
|
38
|
+
"peerDependenciesMeta": {
|
|
39
|
+
"golar": {
|
|
40
|
+
"optional": true
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@rsbuild/core": "^2.1.7",
|
|
45
|
+
"@rslib/core": "^0.23.2",
|
|
46
|
+
"@types/node": "^24.13.3",
|
|
47
|
+
"typescript": "^6.0.3"
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
},
|
|
52
|
+
"engines": {
|
|
53
|
+
"node": ">=22.12"
|
|
54
|
+
},
|
|
55
|
+
"scripts": {
|
|
56
|
+
"build": "rslib build",
|
|
57
|
+
"dev": "rslib build --watch",
|
|
58
|
+
"check:publish": "publint && attw --pack ."
|
|
59
|
+
}
|
|
60
|
+
}
|