Skip to content

Commit

Permalink
chore: rename package
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan committed Aug 18, 2024
1 parent 6e3b185 commit 967fa1c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# rsbuild-plugin-example
# @rsbuild/plugin-vue2-jsx

rsbuild-plugin-example is a Rsbuild plugin to do something.
@rsbuild/plugin-vue2-jsx is a Rsbuild plugin to do something.

<p>
<a href="https://npmjs.com/package/rsbuild-plugin-example">
<img src="https://img.shields.io/npm/v/rsbuild-plugin-example?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" />
<a href="https://npmjs.com/package/@rsbuild/plugin-vue2-jsx">
<img src="https://img.shields.io/npm/v/@rsbuild/plugin-vue2-jsx?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" />
</a>
<img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="license" />
</p>
Expand All @@ -14,17 +14,17 @@ rsbuild-plugin-example is a Rsbuild plugin to do something.
Install:

```bash
npm add rsbuild-plugin-example -D
npm add @rsbuild/plugin-vue2-jsx -D
```

Add plugin to your `rsbuild.config.ts`:

```ts
// rsbuild.config.ts
import { pluginExample } from "rsbuild-plugin-example";
import { pluginVue2Jsx } from "@rsbuild/plugin-vue2-jsx";

export default {
plugins: [pluginExample()],
plugins: [pluginVue2Jsx()],
};
```

Expand All @@ -39,7 +39,7 @@ Some description.
- Example:

```js
pluginExample({
pluginVue2Jsx({
foo: "bar",
});
```
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rsbuild-plugin-example",
"name": "@rsbuild/plugin-vue2-jsx",
"version": "0.0.0",
"repository": "https://github.com/rspack-contrib/rsbuild-plugin-template",
"repository": "https://github.com/rspack-contrib/@rsbuild/plugin-vue2-jsx",
"license": "MIT",
"type": "module",
"exports": {
Expand Down
4 changes: 2 additions & 2 deletions playground/rsbuild.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from '@rsbuild/core';
import { pluginExample } from '../src';
import { pluginVue2Jsx } from '../src';

export default defineConfig({
plugins: [pluginExample()],
plugins: [pluginVue2Jsx()],
});
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import type { RsbuildPlugin } from '@rsbuild/core';

export type PluginExampleOptions = {
export type pluginVue2JsxOptions = {
foo?: string;
bar?: boolean;
};

export const pluginExample = (
options: PluginExampleOptions = {},
export const pluginVue2Jsx = (
options: pluginVue2JsxOptions = {},
): RsbuildPlugin => ({
name: 'plugin-example',
name: 'plugin-vue2-jsx',

setup() {
console.log('Hello Rsbuild!', options);
Expand Down
6 changes: 3 additions & 3 deletions test/basic/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { expect, test } from '@playwright/test';
import { createRsbuild } from '@rsbuild/core';
import { pluginExample } from '../../src';
import { pluginVue2Jsx } from '../../src';
import { getRandomPort } from '../helper';

const __dirname = dirname(fileURLToPath(import.meta.url));
Expand All @@ -11,7 +11,7 @@ test('should render page as expected', async ({ page }) => {
const rsbuild = await createRsbuild({
cwd: __dirname,
rsbuildConfig: {
plugins: [pluginExample()],
plugins: [pluginVue2Jsx()],
server: {
port: getRandomPort(),
},
Expand All @@ -30,7 +30,7 @@ test('should build succeed', async ({ page }) => {
const rsbuild = await createRsbuild({
cwd: __dirname,
rsbuildConfig: {
plugins: [pluginExample()],
plugins: [pluginVue2Jsx()],
},
});

Expand Down

0 comments on commit 967fa1c

Please sign in to comment.