create-rslib 0.19.3 → 0.19.4
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/dist/index.js +114 -295
- package/package.json +4 -5
- package/{template-[react]-[]-js → template-react-js}/package.json +2 -2
- package/{template-[react]-[]-ts → template-react-ts}/package.json +3 -3
- package/{template-[react]-[rstest]-ts → template-react-ts}/src/Button.tsx +18 -1
- package/template-rspress/AGENTS.md +10 -0
- package/template-rspress/react-ts/docs/Button.mdx +31 -0
- package/template-rspress/react-ts/docs/_meta.json +1 -0
- package/template-rspress/react-ts/docs/index.mdx +4 -0
- package/template-rspress/react-ts/package.json +15 -0
- package/template-rspress/react-ts/rspress.config.ts +27 -0
- package/{template-[react]-[rstest,storybook]-ts → template-rspress/react-ts}/tsconfig.json +5 -2
- package/template-rstest/AGENTS.md +10 -0
- package/template-rstest/node-js/package.json +10 -0
- package/template-rstest/node-ts/package.json +10 -0
- package/template-rstest/react-js/package.json +13 -0
- package/template-rstest/react-ts/package.json +13 -0
- package/template-rstest/vue-js/package.json +14 -0
- package/template-rstest/vue-ts/package.json +14 -0
- package/template-storybook/AGENTS.md +6 -0
- package/template-storybook/react-js/package.json +15 -0
- package/template-storybook/react-ts/package.json +15 -0
- package/template-storybook/vue-js/package.json +15 -0
- package/template-storybook/vue-ts/package.json +15 -0
- package/template-vitest/node-js/package.json +8 -0
- package/template-vitest/node-ts/package.json +8 -0
- package/template-vitest/react-js/package.json +11 -0
- package/template-vitest/react-ts/package.json +11 -0
- package/template-vitest/vue-js/package.json +12 -0
- package/template-vitest/vue-ts/package.json +12 -0
- package/{template-[vue]-[vitest]-js/vitest.config.js → template-vitest/vue-ts/vitest.config.ts} +1 -1
- package/{template-[vue]-[]-js → template-vue-js}/package.json +1 -1
- package/{template-[vue]-[]-ts → template-vue-ts}/package.json +2 -2
- package/template-[node-dual]-[rstest]-js/AGENTS.md +0 -5
- package/template-[node-dual]-[rstest]-js/package.json +0 -25
- package/template-[node-dual]-[rstest]-js/rslib.config.mjs +0 -14
- package/template-[node-dual]-[rstest]-ts/AGENTS.md +0 -5
- package/template-[node-dual]-[rstest]-ts/package.json +0 -29
- package/template-[node-dual]-[rstest]-ts/rslib.config.ts +0 -15
- package/template-[node-dual]-[vitest]-js/package.json +0 -24
- package/template-[node-dual]-[vitest]-js/rslib.config.mjs +0 -14
- package/template-[node-dual]-[vitest]-js/src/index.js +0 -1
- package/template-[node-dual]-[vitest]-ts/AGENTS.md +0 -5
- package/template-[node-dual]-[vitest]-ts/package.json +0 -28
- package/template-[node-dual]-[vitest]-ts/rslib.config.ts +0 -15
- package/template-[node-dual]-[vitest]-ts/src/index.ts +0 -1
- package/template-[node-dual]-[vitest]-ts/tsconfig.json +0 -15
- package/template-[node-esm]-[]-js/src/index.js +0 -1
- package/template-[node-esm]-[]-ts/src/index.ts +0 -1
- package/template-[node-esm]-[]-ts/tsconfig.json +0 -15
- package/template-[node-esm]-[rstest]-js/AGENTS.md +0 -5
- package/template-[node-esm]-[rstest]-js/package.json +0 -23
- package/template-[node-esm]-[rstest]-js/rslib.config.mjs +0 -10
- package/template-[node-esm]-[rstest]-js/rstest.config.js +0 -6
- package/template-[node-esm]-[rstest]-js/src/index.js +0 -1
- package/template-[node-esm]-[rstest]-js/tests/index.test.js +0 -7
- package/template-[node-esm]-[rstest]-ts/AGENTS.md +0 -5
- package/template-[node-esm]-[rstest]-ts/package.json +0 -27
- package/template-[node-esm]-[rstest]-ts/rslib.config.ts +0 -11
- package/template-[node-esm]-[rstest]-ts/rstest.config.ts +0 -6
- package/template-[node-esm]-[rstest]-ts/src/index.ts +0 -1
- package/template-[node-esm]-[rstest]-ts/tests/index.test.ts +0 -7
- package/template-[node-esm]-[rstest]-ts/tsconfig.json +0 -15
- package/template-[node-esm]-[vitest]-js/AGENTS.md +0 -5
- package/template-[node-esm]-[vitest]-js/package.json +0 -22
- package/template-[node-esm]-[vitest]-js/rslib.config.mjs +0 -10
- package/template-[node-esm]-[vitest]-js/src/index.js +0 -1
- package/template-[node-esm]-[vitest]-js/tests/index.test.js +0 -7
- package/template-[node-esm]-[vitest]-js/vitest.config.js +0 -8
- package/template-[node-esm]-[vitest]-ts/AGENTS.md +0 -5
- package/template-[node-esm]-[vitest]-ts/package.json +0 -26
- package/template-[node-esm]-[vitest]-ts/rslib.config.ts +0 -11
- package/template-[node-esm]-[vitest]-ts/src/index.ts +0 -1
- package/template-[node-esm]-[vitest]-ts/tests/index.test.ts +0 -7
- package/template-[node-esm]-[vitest]-ts/tsconfig.json +0 -15
- package/template-[node-esm]-[vitest]-ts/vitest.config.ts +0 -6
- package/template-[react]-[]-ts/src/Button.tsx +0 -29
- package/template-[react]-[rstest,storybook]-js/AGENTS.md +0 -9
- package/template-[react]-[rstest,storybook]-js/package.json +0 -41
- package/template-[react]-[rstest,storybook]-js/rslib.config.mjs +0 -20
- package/template-[react]-[rstest,storybook]-js/src/Button.jsx +0 -21
- package/template-[react]-[rstest,storybook]-js/src/button.css +0 -34
- package/template-[react]-[rstest,storybook]-js/src/index.jsx +0 -1
- package/template-[react]-[rstest,storybook]-ts/AGENTS.md +0 -9
- package/template-[react]-[rstest,storybook]-ts/package.json +0 -45
- package/template-[react]-[rstest,storybook]-ts/rslib.config.ts +0 -21
- package/template-[react]-[rstest,storybook]-ts/src/Button.tsx +0 -29
- package/template-[react]-[rstest,storybook]-ts/src/button.css +0 -34
- package/template-[react]-[rstest,storybook]-ts/src/index.tsx +0 -1
- package/template-[react]-[rstest]-js/AGENTS.md +0 -5
- package/template-[react]-[rstest]-js/package.json +0 -32
- package/template-[react]-[rstest]-js/rslib.config.mjs +0 -20
- package/template-[react]-[rstest]-js/src/Button.jsx +0 -21
- package/template-[react]-[rstest]-js/src/button.css +0 -34
- package/template-[react]-[rstest]-js/src/index.jsx +0 -1
- package/template-[react]-[rstest]-js/tests/index.test.jsx +0 -11
- package/template-[react]-[rstest]-ts/AGENTS.md +0 -5
- package/template-[react]-[rstest]-ts/package.json +0 -36
- package/template-[react]-[rstest]-ts/rslib.config.ts +0 -21
- package/template-[react]-[rstest]-ts/src/button.css +0 -34
- package/template-[react]-[rstest]-ts/src/index.tsx +0 -1
- package/template-[react]-[rstest]-ts/tests/index.test.tsx +0 -11
- package/template-[react]-[rstest]-ts/tsconfig.json +0 -14
- package/template-[react]-[storybook,vitest]-js/.storybook/main.js +0 -39
- package/template-[react]-[storybook,vitest]-js/AGENTS.md +0 -9
- package/template-[react]-[storybook,vitest]-js/package.json +0 -40
- package/template-[react]-[storybook,vitest]-js/rslib.config.mjs +0 -20
- package/template-[react]-[storybook,vitest]-js/src/Button.jsx +0 -21
- package/template-[react]-[storybook,vitest]-js/src/button.css +0 -34
- package/template-[react]-[storybook,vitest]-js/src/index.jsx +0 -1
- package/template-[react]-[storybook,vitest]-js/stories/Button.stories.jsx +0 -50
- package/template-[react]-[storybook,vitest]-ts/.storybook/main.ts +0 -41
- package/template-[react]-[storybook,vitest]-ts/.storybook/preview.ts +0 -14
- package/template-[react]-[storybook,vitest]-ts/AGENTS.md +0 -9
- package/template-[react]-[storybook,vitest]-ts/package.json +0 -44
- package/template-[react]-[storybook,vitest]-ts/rslib.config.ts +0 -21
- package/template-[react]-[storybook,vitest]-ts/src/Button.tsx +0 -29
- package/template-[react]-[storybook,vitest]-ts/src/button.css +0 -34
- package/template-[react]-[storybook,vitest]-ts/src/index.tsx +0 -1
- package/template-[react]-[storybook,vitest]-ts/stories/Button.stories.ts +0 -52
- package/template-[react]-[storybook,vitest]-ts/tests/tsconfig.json +0 -4
- package/template-[react]-[storybook,vitest]-ts/tsconfig.json +0 -14
- package/template-[react]-[storybook]-js/.storybook/main.js +0 -39
- package/template-[react]-[storybook]-js/.storybook/preview.js +0 -12
- package/template-[react]-[storybook]-js/AGENTS.md +0 -5
- package/template-[react]-[storybook]-js/package.json +0 -35
- package/template-[react]-[storybook]-js/rslib.config.mjs +0 -20
- package/template-[react]-[storybook]-js/src/Button.jsx +0 -21
- package/template-[react]-[storybook]-js/src/button.css +0 -34
- package/template-[react]-[storybook]-js/src/index.jsx +0 -1
- package/template-[react]-[storybook]-js/stories/Button.stories.jsx +0 -50
- package/template-[react]-[storybook]-ts/.storybook/main.ts +0 -41
- package/template-[react]-[storybook]-ts/.storybook/preview.ts +0 -14
- package/template-[react]-[storybook]-ts/AGENTS.md +0 -5
- package/template-[react]-[storybook]-ts/package.json +0 -39
- package/template-[react]-[storybook]-ts/rslib.config.ts +0 -21
- package/template-[react]-[storybook]-ts/src/Button.tsx +0 -29
- package/template-[react]-[storybook]-ts/src/button.css +0 -34
- package/template-[react]-[storybook]-ts/src/index.tsx +0 -1
- package/template-[react]-[storybook]-ts/stories/Button.stories.ts +0 -52
- package/template-[react]-[storybook]-ts/tsconfig.json +0 -14
- package/template-[react]-[vitest]-js/AGENTS.md +0 -5
- package/template-[react]-[vitest]-js/package.json +0 -31
- package/template-[react]-[vitest]-js/rslib.config.mjs +0 -20
- package/template-[react]-[vitest]-js/src/Button.jsx +0 -21
- package/template-[react]-[vitest]-js/src/button.css +0 -34
- package/template-[react]-[vitest]-js/src/index.jsx +0 -1
- package/template-[react]-[vitest]-js/tests/index.test.jsx +0 -11
- package/template-[react]-[vitest]-js/vitest.config.js +0 -11
- package/template-[react]-[vitest]-ts/AGENTS.md +0 -5
- package/template-[react]-[vitest]-ts/package.json +0 -35
- package/template-[react]-[vitest]-ts/rslib.config.ts +0 -21
- package/template-[react]-[vitest]-ts/src/Button.tsx +0 -29
- package/template-[react]-[vitest]-ts/src/button.css +0 -34
- package/template-[react]-[vitest]-ts/src/index.tsx +0 -1
- package/template-[react]-[vitest]-ts/tests/index.test.tsx +0 -11
- package/template-[react]-[vitest]-ts/tests/tsconfig.json +0 -4
- package/template-[react]-[vitest]-ts/tsconfig.json +0 -14
- package/template-[react]-[vitest]-ts/vitest.config.ts +0 -9
- package/template-[vue]-[rstest,storybook]-js/.storybook/preview.js +0 -12
- package/template-[vue]-[rstest,storybook]-js/AGENTS.md +0 -9
- package/template-[vue]-[rstest,storybook]-js/package.json +0 -43
- package/template-[vue]-[rstest,storybook]-js/rslib.config.ts +0 -15
- package/template-[vue]-[rstest,storybook]-js/rstest.config.js +0 -7
- package/template-[vue]-[rstest,storybook]-js/rstest.setup.js +0 -4
- package/template-[vue]-[rstest,storybook]-js/src/Button.vue +0 -43
- package/template-[vue]-[rstest,storybook]-js/src/index.js +0 -1
- package/template-[vue]-[rstest,storybook]-js/src/style.css +0 -34
- package/template-[vue]-[rstest,storybook]-ts/AGENTS.md +0 -9
- package/template-[vue]-[rstest,storybook]-ts/package.json +0 -45
- package/template-[vue]-[rstest,storybook]-ts/rslib.config.ts +0 -15
- package/template-[vue]-[rstest,storybook]-ts/rstest.config.ts +0 -7
- package/template-[vue]-[rstest,storybook]-ts/rstest.setup.ts +0 -4
- package/template-[vue]-[rstest,storybook]-ts/src/Button.vue +0 -35
- package/template-[vue]-[rstest,storybook]-ts/src/index.ts +0 -1
- package/template-[vue]-[rstest,storybook]-ts/src/style.css +0 -34
- package/template-[vue]-[rstest,storybook]-ts/tests/test.d.ts +0 -1
- package/template-[vue]-[rstest,storybook]-ts/tests/tsconfig.json +0 -4
- package/template-[vue]-[rstest,storybook]-ts/tsconfig.json +0 -24
- package/template-[vue]-[rstest]-js/AGENTS.md +0 -5
- package/template-[vue]-[rstest]-js/package.json +0 -34
- package/template-[vue]-[rstest]-js/rslib.config.ts +0 -15
- package/template-[vue]-[rstest]-js/rstest.config.js +0 -7
- package/template-[vue]-[rstest]-js/rstest.setup.js +0 -4
- package/template-[vue]-[rstest]-js/src/Button.vue +0 -43
- package/template-[vue]-[rstest]-js/src/index.js +0 -1
- package/template-[vue]-[rstest]-js/src/style.css +0 -34
- package/template-[vue]-[rstest]-js/tests/index.test.js +0 -16
- package/template-[vue]-[rstest]-ts/AGENTS.md +0 -5
- package/template-[vue]-[rstest]-ts/package.json +0 -36
- package/template-[vue]-[rstest]-ts/rslib.config.ts +0 -15
- package/template-[vue]-[rstest]-ts/rstest.config.ts +0 -7
- package/template-[vue]-[rstest]-ts/rstest.setup.ts +0 -4
- package/template-[vue]-[rstest]-ts/src/Button.vue +0 -35
- package/template-[vue]-[rstest]-ts/src/index.ts +0 -1
- package/template-[vue]-[rstest]-ts/src/style.css +0 -34
- package/template-[vue]-[rstest]-ts/tests/index.test.ts +0 -16
- package/template-[vue]-[rstest]-ts/tests/test.d.ts +0 -1
- package/template-[vue]-[rstest]-ts/tests/tsconfig.json +0 -4
- package/template-[vue]-[rstest]-ts/tsconfig.json +0 -24
- package/template-[vue]-[storybook,vitest]-js/.storybook/main.js +0 -38
- package/template-[vue]-[storybook,vitest]-js/.storybook/preview.js +0 -12
- package/template-[vue]-[storybook,vitest]-js/AGENTS.md +0 -9
- package/template-[vue]-[storybook,vitest]-js/package.json +0 -42
- package/template-[vue]-[storybook,vitest]-js/rslib.config.ts +0 -15
- package/template-[vue]-[storybook,vitest]-js/src/Button.vue +0 -43
- package/template-[vue]-[storybook,vitest]-js/src/index.js +0 -1
- package/template-[vue]-[storybook,vitest]-js/src/style.css +0 -34
- package/template-[vue]-[storybook,vitest]-js/stories/Button.stories.js +0 -50
- package/template-[vue]-[storybook,vitest]-js/vitest.setup.js +0 -1
- package/template-[vue]-[storybook,vitest]-ts/.storybook/main.ts +0 -40
- package/template-[vue]-[storybook,vitest]-ts/.storybook/preview.ts +0 -12
- package/template-[vue]-[storybook,vitest]-ts/AGENTS.md +0 -9
- package/template-[vue]-[storybook,vitest]-ts/package.json +0 -44
- package/template-[vue]-[storybook,vitest]-ts/rslib.config.ts +0 -15
- package/template-[vue]-[storybook,vitest]-ts/src/Button.vue +0 -35
- package/template-[vue]-[storybook,vitest]-ts/src/index.ts +0 -1
- package/template-[vue]-[storybook,vitest]-ts/src/style.css +0 -34
- package/template-[vue]-[storybook,vitest]-ts/stories/Button.stories.js +0 -50
- package/template-[vue]-[storybook,vitest]-ts/tsconfig.json +0 -24
- package/template-[vue]-[storybook,vitest]-ts/vitest.config.js +0 -13
- package/template-[vue]-[storybook,vitest]-ts/vitest.setup.js +0 -1
- package/template-[vue]-[storybook]-js/.storybook/main.js +0 -38
- package/template-[vue]-[storybook]-js/.storybook/preview.js +0 -12
- package/template-[vue]-[storybook]-js/AGENTS.md +0 -5
- package/template-[vue]-[storybook]-js/package.json +0 -36
- package/template-[vue]-[storybook]-js/rslib.config.ts +0 -15
- package/template-[vue]-[storybook]-js/src/Button.vue +0 -43
- package/template-[vue]-[storybook]-js/src/index.js +0 -1
- package/template-[vue]-[storybook]-js/src/style.css +0 -34
- package/template-[vue]-[storybook]-js/stories/Button.stories.js +0 -50
- package/template-[vue]-[storybook]-ts/.storybook/main.ts +0 -40
- package/template-[vue]-[storybook]-ts/.storybook/preview.ts +0 -12
- package/template-[vue]-[storybook]-ts/AGENTS.md +0 -5
- package/template-[vue]-[storybook]-ts/package.json +0 -38
- package/template-[vue]-[storybook]-ts/rslib.config.ts +0 -15
- package/template-[vue]-[storybook]-ts/src/Button.vue +0 -35
- package/template-[vue]-[storybook]-ts/src/index.ts +0 -1
- package/template-[vue]-[storybook]-ts/src/style.css +0 -34
- package/template-[vue]-[storybook]-ts/stories/Button.stories.js +0 -50
- package/template-[vue]-[storybook]-ts/tsconfig.json +0 -24
- package/template-[vue]-[vitest]-js/AGENTS.md +0 -5
- package/template-[vue]-[vitest]-js/package.json +0 -33
- package/template-[vue]-[vitest]-js/rslib.config.ts +0 -15
- package/template-[vue]-[vitest]-js/src/Button.vue +0 -43
- package/template-[vue]-[vitest]-js/src/index.js +0 -1
- package/template-[vue]-[vitest]-js/src/style.css +0 -34
- package/template-[vue]-[vitest]-js/tests/index.test.js +0 -16
- package/template-[vue]-[vitest]-js/vitest.setup.js +0 -1
- package/template-[vue]-[vitest]-ts/AGENTS.md +0 -5
- package/template-[vue]-[vitest]-ts/package.json +0 -35
- package/template-[vue]-[vitest]-ts/rslib.config.ts +0 -15
- package/template-[vue]-[vitest]-ts/src/Button.vue +0 -35
- package/template-[vue]-[vitest]-ts/src/index.ts +0 -1
- package/template-[vue]-[vitest]-ts/src/style.css +0 -34
- package/template-[vue]-[vitest]-ts/tests/index.test.ts +0 -16
- package/template-[vue]-[vitest]-ts/tsconfig.json +0 -24
- package/template-[vue]-[vitest]-ts/vitest.config.js +0 -13
- package/template-[vue]-[vitest]-ts/vitest.setup.js +0 -1
- /package/{template-[node-dual]-[]-js → template-node-dual-js}/package.json +0 -0
- /package/{template-[node-dual]-[]-js → template-node-dual-js}/rslib.config.mjs +0 -0
- /package/{template-[node-dual]-[]-js → template-node-dual-js}/src/index.js +0 -0
- /package/{template-[node-dual]-[]-ts → template-node-dual-ts}/package.json +0 -0
- /package/{template-[node-dual]-[]-ts → template-node-dual-ts}/rslib.config.ts +0 -0
- /package/{template-[node-dual]-[]-ts → template-node-dual-ts}/src/index.ts +0 -0
- /package/{template-[node-dual]-[]-ts → template-node-dual-ts}/tsconfig.json +0 -0
- /package/{template-[node-esm]-[]-js → template-node-esm-js}/package.json +0 -0
- /package/{template-[node-esm]-[]-js → template-node-esm-js}/rslib.config.mjs +0 -0
- /package/{template-[node-dual]-[rstest]-js → template-node-esm-js}/src/index.js +0 -0
- /package/{template-[node-esm]-[]-ts → template-node-esm-ts}/package.json +0 -0
- /package/{template-[node-esm]-[]-ts → template-node-esm-ts}/rslib.config.ts +0 -0
- /package/{template-[node-dual]-[rstest]-ts → template-node-esm-ts}/src/index.ts +0 -0
- /package/{template-[node-dual]-[rstest]-ts → template-node-esm-ts}/tsconfig.json +0 -0
- /package/{template-[react]-[]-js → template-react-js}/rslib.config.mjs +0 -0
- /package/{template-[react]-[]-js → template-react-js}/src/Button.jsx +0 -0
- /package/{template-[react]-[]-js → template-react-js}/src/button.css +0 -0
- /package/{template-[react]-[]-js → template-react-js}/src/index.jsx +0 -0
- /package/{template-[react]-[]-ts → template-react-ts}/rslib.config.ts +0 -0
- /package/{template-[react]-[]-ts → template-react-ts}/src/button.css +0 -0
- /package/{template-[react]-[]-ts → template-react-ts}/src/index.tsx +0 -0
- /package/{template-[react]-[]-ts → template-react-ts}/tsconfig.json +0 -0
- /package/{template-[node-dual]-[rstest]-js → template-rstest/node-js}/rstest.config.js +0 -0
- /package/{template-[node-dual]-[rstest]-js → template-rstest/node-js}/tests/index.test.js +0 -0
- /package/{template-[node-dual]-[rstest]-ts → template-rstest/node-ts}/rstest.config.ts +0 -0
- /package/{template-[node-dual]-[rstest]-ts → template-rstest/node-ts}/tests/index.test.ts +0 -0
- /package/{template-[react]-[rstest,storybook]-js → template-rstest/react-js}/rstest.config.js +0 -0
- /package/{template-[react]-[rstest,storybook]-js → template-rstest/react-js}/rstest.setup.js +0 -0
- /package/{template-[react]-[rstest,storybook]-js → template-rstest/react-js}/tests/index.test.jsx +0 -0
- /package/{template-[react]-[rstest,storybook]-ts → template-rstest/react-ts}/rstest.config.ts +0 -0
- /package/{template-[react]-[rstest,storybook]-ts → template-rstest/react-ts}/rstest.setup.ts +0 -0
- /package/{template-[react]-[rstest,storybook]-ts → template-rstest/react-ts}/tests/index.test.tsx +0 -0
- /package/{template-[react]-[rstest,storybook]-ts → template-rstest/react-ts}/tests/test.d.ts +0 -0
- /package/{template-[react]-[rstest,storybook]-ts → template-rstest/react-ts}/tests/tsconfig.json +0 -0
- /package/{template-[react]-[rstest]-js → template-rstest/vue-js}/rstest.config.js +0 -0
- /package/{template-[react]-[rstest]-js → template-rstest/vue-js}/rstest.setup.js +0 -0
- /package/{template-[vue]-[rstest,storybook]-js → template-rstest/vue-js}/tests/index.test.js +0 -0
- /package/{template-[react]-[rstest]-ts → template-rstest/vue-ts}/rstest.config.ts +0 -0
- /package/{template-[react]-[rstest]-ts → template-rstest/vue-ts}/rstest.setup.ts +0 -0
- /package/{template-[vue]-[rstest,storybook]-ts → template-rstest/vue-ts}/tests/index.test.ts +0 -0
- /package/{template-[react]-[rstest]-ts → template-rstest/vue-ts}/tests/test.d.ts +0 -0
- /package/{template-[react]-[rstest]-ts → template-rstest/vue-ts}/tests/tsconfig.json +0 -0
- /package/{template-[react]-[rstest,storybook]-js → template-storybook/react-js}/.storybook/main.js +0 -0
- /package/{template-[react]-[rstest,storybook]-js → template-storybook/react-js}/.storybook/preview.js +0 -0
- /package/{template-[react]-[rstest,storybook]-js → template-storybook/react-js}/stories/Button.stories.jsx +0 -0
- /package/{template-[react]-[rstest,storybook]-ts → template-storybook/react-ts}/.storybook/main.ts +0 -0
- /package/{template-[react]-[rstest,storybook]-ts → template-storybook/react-ts}/.storybook/preview.ts +0 -0
- /package/{template-[react]-[rstest,storybook]-ts → template-storybook/react-ts}/stories/Button.stories.ts +0 -0
- /package/{template-[vue]-[rstest,storybook]-js → template-storybook/vue-js}/.storybook/main.js +0 -0
- /package/{template-[react]-[storybook,vitest]-js → template-storybook/vue-js}/.storybook/preview.js +0 -0
- /package/{template-[vue]-[rstest,storybook]-js → template-storybook/vue-js}/stories/Button.stories.js +0 -0
- /package/{template-[vue]-[rstest,storybook]-ts → template-storybook/vue-ts}/.storybook/main.ts +0 -0
- /package/{template-[vue]-[rstest,storybook]-ts → template-storybook/vue-ts}/.storybook/preview.ts +0 -0
- /package/{template-[vue]-[rstest,storybook]-ts → template-storybook/vue-ts}/stories/Button.stories.js +0 -0
- /package/{template-[node-dual]-[vitest]-js → template-vitest}/AGENTS.md +0 -0
- /package/{template-[node-dual]-[vitest]-js → template-vitest/node-js}/tests/index.test.js +0 -0
- /package/{template-[node-dual]-[vitest]-js → template-vitest/node-js}/vitest.config.js +0 -0
- /package/{template-[node-dual]-[vitest]-ts → template-vitest/node-ts}/tests/index.test.ts +0 -0
- /package/{template-[node-dual]-[vitest]-ts → template-vitest/node-ts}/tests/tsconfig.json +0 -0
- /package/{template-[node-dual]-[vitest]-ts → template-vitest/node-ts}/vitest.config.ts +0 -0
- /package/{template-[react]-[storybook,vitest]-js → template-vitest/react-js}/tests/index.test.jsx +0 -0
- /package/{template-[react]-[storybook,vitest]-js → template-vitest/react-js}/vitest.config.js +0 -0
- /package/{template-[react]-[storybook,vitest]-js → template-vitest/react-js}/vitest.setup.js +0 -0
- /package/{template-[react]-[storybook,vitest]-ts → template-vitest/react-ts}/tests/index.test.tsx +0 -0
- /package/{template-[node-esm]-[vitest]-ts → template-vitest/react-ts}/tests/tsconfig.json +0 -0
- /package/{template-[react]-[storybook,vitest]-ts → template-vitest/react-ts}/vitest.config.ts +0 -0
- /package/{template-[react]-[storybook,vitest]-ts → template-vitest/react-ts}/vitest.setup.ts +0 -0
- /package/{template-[vue]-[storybook,vitest]-js → template-vitest/vue-js}/tests/index.test.js +0 -0
- /package/{template-[vue]-[storybook,vitest]-js → template-vitest/vue-js}/vitest.config.js +0 -0
- /package/{template-[react]-[vitest]-js → template-vitest/vue-js}/vitest.setup.js +0 -0
- /package/{template-[vue]-[storybook,vitest]-ts → template-vitest/vue-ts}/tests/index.test.ts +0 -0
- /package/{template-[react]-[vitest]-ts → template-vitest/vue-ts}/vitest.setup.ts +0 -0
- /package/{template-[vue]-[]-js → template-vue-js}/rslib.config.ts +0 -0
- /package/{template-[vue]-[]-js → template-vue-js}/src/Button.vue +0 -0
- /package/{template-[vue]-[]-js → template-vue-js}/src/index.js +0 -0
- /package/{template-[vue]-[]-js → template-vue-js}/src/style.css +0 -0
- /package/{template-[vue]-[]-ts → template-vue-ts}/rslib.config.ts +0 -0
- /package/{template-[vue]-[]-ts → template-vue-ts}/src/Button.vue +0 -0
- /package/{template-[vue]-[]-ts → template-vue-ts}/src/index.ts +0 -0
- /package/{template-[vue]-[]-ts → template-vue-ts}/src/style.css +0 -0
- /package/{template-[vue]-[]-ts → template-vue-ts}/tsconfig.json +0 -0
package/dist/index.js
CHANGED
|
@@ -1,265 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import node_fs from "node:fs";
|
|
2
3
|
import node_path from "node:path";
|
|
3
4
|
import { fileURLToPath } from "node:url";
|
|
4
|
-
import {
|
|
5
|
-
import "node:fs";
|
|
6
|
-
const helpers_filename = fileURLToPath(import.meta.url);
|
|
7
|
-
const helpers_dirname = node_path.dirname(helpers_filename);
|
|
8
|
-
node_path.resolve(helpers_dirname, '../fragments');
|
|
9
|
-
const composeTemplateName = ({ template, tools, lang })=>`[${template}]-[${(tools ? tools.sort() : []).join(',')}]-${lang}`;
|
|
5
|
+
import { checkCancel, copyFolder, create, select as external_create_rstack_select } from "create-rstack";
|
|
10
6
|
const TEMPLATES = [
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
{
|
|
20
|
-
template: 'node-dual',
|
|
21
|
-
lang: 'js',
|
|
22
|
-
tools: {
|
|
23
|
-
vitest: 'vitest-node-js'
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
template: 'node-dual',
|
|
28
|
-
lang: 'ts',
|
|
29
|
-
tools: {
|
|
30
|
-
vitest: 'vitest-node-ts'
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
template: 'node-dual',
|
|
35
|
-
lang: 'js',
|
|
36
|
-
tools: {
|
|
37
|
-
rstest: 'rstest-node-js'
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
template: 'node-dual',
|
|
42
|
-
lang: 'ts',
|
|
43
|
-
tools: {
|
|
44
|
-
rstest: 'rstest-node-ts'
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
template: 'node-esm',
|
|
49
|
-
lang: 'js'
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
template: 'node-esm',
|
|
53
|
-
lang: 'ts'
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
template: 'node-esm',
|
|
57
|
-
lang: 'js',
|
|
58
|
-
tools: {
|
|
59
|
-
vitest: 'vitest-node-js'
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
template: 'node-esm',
|
|
64
|
-
lang: 'ts',
|
|
65
|
-
tools: {
|
|
66
|
-
vitest: 'vitest-node-ts'
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
template: 'node-esm',
|
|
71
|
-
lang: 'js',
|
|
72
|
-
tools: {
|
|
73
|
-
rstest: 'rstest-node-js'
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
template: 'node-esm',
|
|
78
|
-
lang: 'ts',
|
|
79
|
-
tools: {
|
|
80
|
-
rstest: 'rstest-node-ts'
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
template: 'react',
|
|
85
|
-
lang: 'js'
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
template: 'react',
|
|
89
|
-
lang: 'js',
|
|
90
|
-
tools: {
|
|
91
|
-
storybook: 'storybook-react-js'
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
template: 'react',
|
|
96
|
-
lang: 'js',
|
|
97
|
-
tools: {
|
|
98
|
-
vitest: 'vitest-react-js'
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
template: 'react',
|
|
103
|
-
lang: 'js',
|
|
104
|
-
tools: {
|
|
105
|
-
rstest: 'rstest-react-js'
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
template: 'react',
|
|
110
|
-
lang: 'js',
|
|
111
|
-
tools: {
|
|
112
|
-
storybook: 'storybook-react-js',
|
|
113
|
-
vitest: 'vitest-react-js'
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
template: 'react',
|
|
118
|
-
lang: 'js',
|
|
119
|
-
tools: {
|
|
120
|
-
storybook: 'storybook-react-js',
|
|
121
|
-
rstest: 'rstest-react-js'
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
template: 'react',
|
|
126
|
-
lang: 'ts'
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
template: 'react',
|
|
130
|
-
lang: 'ts',
|
|
131
|
-
tools: {
|
|
132
|
-
storybook: 'storybook-react-ts'
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
template: 'react',
|
|
137
|
-
lang: 'ts',
|
|
138
|
-
tools: {
|
|
139
|
-
vitest: 'vitest-react-ts'
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
template: 'react',
|
|
144
|
-
lang: 'ts',
|
|
145
|
-
tools: {
|
|
146
|
-
rstest: 'rstest-react-ts'
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
template: 'react',
|
|
151
|
-
lang: 'ts',
|
|
152
|
-
tools: {
|
|
153
|
-
storybook: 'storybook-react-ts',
|
|
154
|
-
vitest: 'vitest-react-ts'
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
template: 'react',
|
|
159
|
-
lang: 'ts',
|
|
160
|
-
tools: {
|
|
161
|
-
storybook: 'storybook-react-ts',
|
|
162
|
-
rstest: 'rstest-react-ts'
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
template: 'vue',
|
|
167
|
-
lang: 'js'
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
template: 'vue',
|
|
171
|
-
lang: 'js',
|
|
172
|
-
tools: {
|
|
173
|
-
storybook: 'storybook-vue-js'
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
template: 'vue',
|
|
178
|
-
lang: 'js',
|
|
179
|
-
tools: {
|
|
180
|
-
vitest: 'vitest-vue-js'
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
template: 'vue',
|
|
185
|
-
lang: 'js',
|
|
186
|
-
tools: {
|
|
187
|
-
rstest: 'rstest-vue-js'
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
template: 'vue',
|
|
192
|
-
lang: 'js',
|
|
193
|
-
tools: {
|
|
194
|
-
storybook: 'storybook-vue-js',
|
|
195
|
-
vitest: 'vitest-vue-js'
|
|
196
|
-
}
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
template: 'vue',
|
|
200
|
-
lang: 'js',
|
|
201
|
-
tools: {
|
|
202
|
-
storybook: 'storybook-vue-js',
|
|
203
|
-
rstest: 'rstest-vue-js'
|
|
204
|
-
}
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
template: 'vue',
|
|
208
|
-
lang: 'ts'
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
template: 'vue',
|
|
212
|
-
lang: 'ts',
|
|
213
|
-
tools: {
|
|
214
|
-
storybook: 'storybook-vue-ts'
|
|
215
|
-
}
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
template: 'vue',
|
|
219
|
-
lang: 'ts',
|
|
220
|
-
tools: {
|
|
221
|
-
vitest: 'vitest-vue-ts'
|
|
222
|
-
}
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
template: 'vue',
|
|
226
|
-
lang: 'ts',
|
|
227
|
-
tools: {
|
|
228
|
-
rstest: 'rstest-vue-ts'
|
|
229
|
-
}
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
template: 'vue',
|
|
233
|
-
lang: 'ts',
|
|
234
|
-
tools: {
|
|
235
|
-
storybook: 'storybook-vue-ts',
|
|
236
|
-
vitest: 'vitest-vue-ts'
|
|
237
|
-
}
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
template: 'vue',
|
|
241
|
-
lang: 'ts',
|
|
242
|
-
tools: {
|
|
243
|
-
storybook: 'storybook-vue-ts',
|
|
244
|
-
rstest: 'rstest-vue-ts'
|
|
245
|
-
}
|
|
246
|
-
}
|
|
7
|
+
'node-dual-js',
|
|
8
|
+
'node-dual-ts',
|
|
9
|
+
'node-esm-js',
|
|
10
|
+
'node-esm-ts',
|
|
11
|
+
'react-js',
|
|
12
|
+
'react-ts',
|
|
13
|
+
'vue-js',
|
|
14
|
+
'vue-ts'
|
|
247
15
|
];
|
|
248
16
|
const src_dirname = node_path.dirname(fileURLToPath(import.meta.url));
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
17
|
+
function parseTemplateName(template) {
|
|
18
|
+
const pair = template.split('-');
|
|
19
|
+
const lastPart = pair[pair.length - 1];
|
|
20
|
+
if ('ts' === lastPart || 'js' === lastPart) {
|
|
253
21
|
const rest = pair.slice(0, pair.length - 1).join('-');
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
] : argv.tools ?? []).filter((tool)=>!BUILTIN_TOOLS.includes(tool));
|
|
257
|
-
return composeTemplateName({
|
|
258
|
-
template: rest,
|
|
259
|
-
lang: lang,
|
|
260
|
-
tools
|
|
261
|
-
});
|
|
22
|
+
if (!rest) throw new Error(`Invalid template name: "${template}". Template name cannot be just a language suffix.`);
|
|
23
|
+
return `${rest}-${lastPart}`;
|
|
262
24
|
}
|
|
25
|
+
return `${template}-ts`;
|
|
26
|
+
}
|
|
27
|
+
async function getTemplateName({ template }) {
|
|
28
|
+
if ('string' == typeof template) return parseTemplateName(template);
|
|
263
29
|
const templateName = checkCancel(await external_create_rstack_select({
|
|
264
30
|
message: 'Select template',
|
|
265
31
|
options: [
|
|
@@ -294,54 +60,107 @@ async function getTemplateName(argv) {
|
|
|
294
60
|
}
|
|
295
61
|
]
|
|
296
62
|
}));
|
|
297
|
-
|
|
298
|
-
'react',
|
|
299
|
-
'vue'
|
|
300
|
-
].includes(templateName);
|
|
301
|
-
async function selectTools() {
|
|
302
|
-
const tools = checkCancel(await multiselect({
|
|
303
|
-
message: 'Select development tools (Use <space> to select, <enter> to continue)',
|
|
304
|
-
required: false,
|
|
305
|
-
options: [
|
|
306
|
-
supportStorybook && {
|
|
307
|
-
value: 'storybook',
|
|
308
|
-
label: 'Storybook'
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
value: 'rstest',
|
|
312
|
-
label: 'Rstest'
|
|
313
|
-
},
|
|
314
|
-
{
|
|
315
|
-
value: 'vitest',
|
|
316
|
-
label: 'Vitest'
|
|
317
|
-
}
|
|
318
|
-
].filter(Boolean)
|
|
319
|
-
}));
|
|
320
|
-
if (tools.includes('rstest') && tools.includes('vitest')) {
|
|
321
|
-
console.error('You selected both Rstest and Vitest for testing, you should only select one of them.');
|
|
322
|
-
return selectTools();
|
|
323
|
-
}
|
|
324
|
-
return tools;
|
|
325
|
-
}
|
|
326
|
-
const tools = await selectTools();
|
|
327
|
-
return composeTemplateName({
|
|
328
|
-
template: templateName,
|
|
329
|
-
lang: language,
|
|
330
|
-
tools
|
|
331
|
-
});
|
|
63
|
+
return `${templateName}-${language}`;
|
|
332
64
|
}
|
|
333
65
|
function mapESLintTemplate(templateName) {
|
|
334
66
|
const language = templateName.split('-').pop();
|
|
335
67
|
return `vanilla-${language}`;
|
|
336
68
|
}
|
|
69
|
+
function mapTestingToolTemplate(templateName) {
|
|
70
|
+
if (templateName.startsWith('react-')) return templateName;
|
|
71
|
+
if (templateName.startsWith('vue-')) return templateName;
|
|
72
|
+
if (templateName.startsWith('node-dual-')) return templateName.replace('node-dual-', 'node-');
|
|
73
|
+
if (templateName.startsWith('node-esm-')) return templateName.replace('node-esm-', 'node-');
|
|
74
|
+
const language = templateName.split('-').pop();
|
|
75
|
+
return `node-${language}`;
|
|
76
|
+
}
|
|
77
|
+
function getPackageName(distFolder) {
|
|
78
|
+
const pkgPath = node_path.join(distFolder, 'package.json');
|
|
79
|
+
const pkgContent = JSON.parse(node_fs.readFileSync(pkgPath, 'utf-8'));
|
|
80
|
+
return pkgContent.name;
|
|
81
|
+
}
|
|
82
|
+
function replacePackageNamePlaceholder(distFolder, files, packageName) {
|
|
83
|
+
for (const file of files){
|
|
84
|
+
const filePath = node_path.join(distFolder, file);
|
|
85
|
+
if (node_fs.existsSync(filePath)) {
|
|
86
|
+
const content = node_fs.readFileSync(filePath, 'utf-8');
|
|
87
|
+
const replaced = content.replace(/\{\{ packageName \}\}/g, packageName);
|
|
88
|
+
node_fs.writeFileSync(filePath, replaced);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
337
92
|
create({
|
|
338
93
|
root: node_path.resolve(src_dirname, '..'),
|
|
339
94
|
name: 'rslib',
|
|
340
|
-
templates: TEMPLATES
|
|
341
|
-
template,
|
|
342
|
-
lang,
|
|
343
|
-
tools: Object.keys(tools || {})
|
|
344
|
-
})),
|
|
95
|
+
templates: TEMPLATES,
|
|
345
96
|
getTemplateName: getTemplateName,
|
|
346
|
-
mapESLintTemplate: mapESLintTemplate
|
|
97
|
+
mapESLintTemplate: mapESLintTemplate,
|
|
98
|
+
extraTools: [
|
|
99
|
+
{
|
|
100
|
+
value: 'rspress',
|
|
101
|
+
label: 'Rspress - documentation',
|
|
102
|
+
when: (templateName)=>templateName.startsWith('react-ts'),
|
|
103
|
+
action: ({ templateName, distFolder, addAgentsMdSearchDirs })=>{
|
|
104
|
+
const toolFolder = node_path.join(src_dirname, '..', 'template-rspress');
|
|
105
|
+
const subFolder = node_path.join(toolFolder, templateName);
|
|
106
|
+
copyFolder({
|
|
107
|
+
from: subFolder,
|
|
108
|
+
to: distFolder,
|
|
109
|
+
isMergePackageJson: true
|
|
110
|
+
});
|
|
111
|
+
const packageName = getPackageName(distFolder);
|
|
112
|
+
replacePackageNamePlaceholder(distFolder, [
|
|
113
|
+
'docs/Button.mdx',
|
|
114
|
+
'tsconfig.json'
|
|
115
|
+
], packageName);
|
|
116
|
+
addAgentsMdSearchDirs(toolFolder);
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
value: 'storybook',
|
|
121
|
+
label: 'Storybook - component development',
|
|
122
|
+
when: (templateName)=>templateName.startsWith('react') || templateName.startsWith('vue'),
|
|
123
|
+
action: ({ templateName, distFolder, addAgentsMdSearchDirs })=>{
|
|
124
|
+
const toolFolder = node_path.join(src_dirname, '..', 'template-storybook');
|
|
125
|
+
const subFolder = node_path.join(toolFolder, templateName);
|
|
126
|
+
copyFolder({
|
|
127
|
+
from: subFolder,
|
|
128
|
+
to: distFolder,
|
|
129
|
+
isMergePackageJson: true
|
|
130
|
+
});
|
|
131
|
+
addAgentsMdSearchDirs(toolFolder);
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
value: 'rstest',
|
|
136
|
+
label: 'Rstest - testing',
|
|
137
|
+
action: ({ templateName, distFolder, addAgentsMdSearchDirs })=>{
|
|
138
|
+
const rstestTemplate = mapTestingToolTemplate(templateName);
|
|
139
|
+
const toolFolder = node_path.join(src_dirname, '..', 'template-rstest');
|
|
140
|
+
const subFolder = node_path.join(toolFolder, rstestTemplate);
|
|
141
|
+
copyFolder({
|
|
142
|
+
from: subFolder,
|
|
143
|
+
to: distFolder,
|
|
144
|
+
isMergePackageJson: true
|
|
145
|
+
});
|
|
146
|
+
addAgentsMdSearchDirs(toolFolder);
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
value: 'vitest',
|
|
151
|
+
label: 'Vitest - testing',
|
|
152
|
+
action: ({ templateName, distFolder, addAgentsMdSearchDirs })=>{
|
|
153
|
+
const vitestTemplate = mapTestingToolTemplate(templateName);
|
|
154
|
+
const toolFolder = node_path.join(src_dirname, '..', 'template-vitest');
|
|
155
|
+
const subFolder = node_path.join(toolFolder, vitestTemplate);
|
|
156
|
+
copyFolder({
|
|
157
|
+
from: subFolder,
|
|
158
|
+
to: distFolder,
|
|
159
|
+
isMergePackageJson: true
|
|
160
|
+
});
|
|
161
|
+
addAgentsMdSearchDirs(toolFolder);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
]
|
|
347
165
|
});
|
|
166
|
+
export { TEMPLATES, parseTemplateName };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-rslib",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.4",
|
|
4
4
|
"description": "Create a new Rslib project",
|
|
5
5
|
"homepage": "https://rslib.rs",
|
|
6
6
|
"repository": {
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"create-rstack": "1.7.
|
|
25
|
+
"create-rstack": "1.7.21"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/fs-extra": "^11.0.4",
|
|
29
29
|
"@types/node": "^24.10.9",
|
|
30
30
|
"fs-extra": "^11.3.3",
|
|
31
|
-
"rsbuild-plugin-publint": "^0.3.
|
|
32
|
-
"rslib": "npm:@rslib/core@0.19.
|
|
31
|
+
"rsbuild-plugin-publint": "^0.3.4",
|
|
32
|
+
"rslib": "npm:@rslib/core@0.19.3",
|
|
33
33
|
"tsx": "^4.21.0",
|
|
34
34
|
"typescript": "^5.9.3",
|
|
35
35
|
"@rslib/tsconfig": "0.0.1"
|
|
@@ -44,7 +44,6 @@
|
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "rslib build",
|
|
46
46
|
"dev": "rslib build --watch",
|
|
47
|
-
"generate-templates": "pnpm tsx ./src/genTemplates.ts",
|
|
48
47
|
"start": "node ./dist/index.js",
|
|
49
48
|
"test": "rstest",
|
|
50
49
|
"type-check": "tsc --noEmit"
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"dev": "rslib build --watch"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@rsbuild/plugin-react": "^1.4.
|
|
18
|
+
"@rsbuild/plugin-react": "^1.4.4",
|
|
19
19
|
"@rslib/core": "workspace:*",
|
|
20
|
-
"react": "^19.2.
|
|
20
|
+
"react": "^19.2.4"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": ">=16.9.0",
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"dev": "rslib build --watch"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@rsbuild/plugin-react": "^1.4.
|
|
20
|
+
"@rsbuild/plugin-react": "^1.4.4",
|
|
21
21
|
"@rslib/core": "workspace:*",
|
|
22
|
-
"@types/react": "^19.2.
|
|
23
|
-
"react": "^19.2.
|
|
22
|
+
"@types/react": "^19.2.10",
|
|
23
|
+
"react": "^19.2.4",
|
|
24
24
|
"typescript": "^5.9.3"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
import './button.css';
|
|
2
2
|
|
|
3
|
-
interface ButtonProps {
|
|
3
|
+
export interface ButtonProps {
|
|
4
|
+
/**
|
|
5
|
+
* Whether the button is primary
|
|
6
|
+
* @default false
|
|
7
|
+
*/
|
|
4
8
|
primary?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Background color of the button
|
|
11
|
+
*/
|
|
5
12
|
backgroundColor?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Size of Button
|
|
15
|
+
* @default 'medium'
|
|
16
|
+
*/
|
|
6
17
|
size?: 'small' | 'medium' | 'large';
|
|
18
|
+
/**
|
|
19
|
+
* Label of the button
|
|
20
|
+
*/
|
|
7
21
|
label: string;
|
|
22
|
+
/**
|
|
23
|
+
* Optional click handler
|
|
24
|
+
*/
|
|
8
25
|
onClick?: () => void;
|
|
9
26
|
}
|
|
10
27
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
## Docs
|
|
2
|
+
|
|
3
|
+
- Rspress: https://rspress.rs/llms.txt
|
|
4
|
+
|
|
5
|
+
## Tools
|
|
6
|
+
|
|
7
|
+
### Rspress
|
|
8
|
+
|
|
9
|
+
- Run `{{ packageManager }} run doc` to start the Rspress documentation dev server, which will also start Rslib in watch mode
|
|
10
|
+
- Run `{{ packageManager }} run doc:build` to build the documentation
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Button
|
|
2
|
+
|
|
3
|
+
## Size
|
|
4
|
+
|
|
5
|
+
Buttons can be small, medium and large in size.
|
|
6
|
+
|
|
7
|
+
```jsx preview
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { Button } from '{{ packageName }}';
|
|
10
|
+
|
|
11
|
+
export default () => {
|
|
12
|
+
return <Button size="medium" label="Click me"></Button>;
|
|
13
|
+
};
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Background color
|
|
17
|
+
|
|
18
|
+
The background color of the button can be set by yourself.
|
|
19
|
+
|
|
20
|
+
```jsx preview
|
|
21
|
+
import React from 'react';
|
|
22
|
+
import { Button } from '{{ packageName }}';
|
|
23
|
+
|
|
24
|
+
export default () => {
|
|
25
|
+
return <Button backgroundColor="red" label="Red"></Button>;
|
|
26
|
+
};
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## API
|
|
30
|
+
|
|
31
|
+
<API moduleName="Button" en />
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
["index", "Button"]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scripts": {
|
|
3
|
+
"doc": "rspress dev",
|
|
4
|
+
"doc:build": "rspress build",
|
|
5
|
+
"doc:preview": "rspress preview"
|
|
6
|
+
},
|
|
7
|
+
"devDependencies": {
|
|
8
|
+
"@rspress/core": "^2.0.0",
|
|
9
|
+
"@rspress/plugin-api-docgen": "^2.0.0",
|
|
10
|
+
"@rspress/plugin-preview": "^2.0.0",
|
|
11
|
+
"@types/node": "^24.10.9",
|
|
12
|
+
"react-dom": "^19.2.4",
|
|
13
|
+
"rsbuild-plugin-workspace-dev": "^0.1.3"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as path from 'node:path';
|
|
2
|
+
import { defineConfig } from '@rspress/core';
|
|
3
|
+
import { pluginApiDocgen } from '@rspress/plugin-api-docgen';
|
|
4
|
+
import { pluginPreview } from '@rspress/plugin-preview';
|
|
5
|
+
import { pluginWorkspaceDev } from 'rsbuild-plugin-workspace-dev';
|
|
6
|
+
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
root: path.join(__dirname, 'docs'),
|
|
9
|
+
title: 'Rslib Module Doc',
|
|
10
|
+
lang: 'en',
|
|
11
|
+
builderConfig: {
|
|
12
|
+
plugins: [
|
|
13
|
+
pluginWorkspaceDev({
|
|
14
|
+
startCurrent: true,
|
|
15
|
+
}),
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
plugins: [
|
|
19
|
+
pluginApiDocgen({
|
|
20
|
+
entries: {
|
|
21
|
+
Button: './src/Button.tsx',
|
|
22
|
+
},
|
|
23
|
+
apiParseTool: 'react-docgen-typescript',
|
|
24
|
+
}),
|
|
25
|
+
pluginPreview(),
|
|
26
|
+
],
|
|
27
|
+
});
|
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
"isolatedModules": true,
|
|
9
9
|
"resolveJsonModule": true,
|
|
10
10
|
"moduleResolution": "bundler",
|
|
11
|
-
"useDefineForClassFields": true
|
|
11
|
+
"useDefineForClassFields": true,
|
|
12
|
+
"paths": {
|
|
13
|
+
"{{ packageName }}": ["."]
|
|
14
|
+
}
|
|
12
15
|
},
|
|
13
|
-
"include": ["src"]
|
|
16
|
+
"include": ["src", "docs", "rspress.config.ts"]
|
|
14
17
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scripts": {
|
|
3
|
+
"test": "rstest",
|
|
4
|
+
"test:watch": "rstest --watch"
|
|
5
|
+
},
|
|
6
|
+
"devDependencies": {
|
|
7
|
+
"@rstest/adapter-rslib": "^0.2.0",
|
|
8
|
+
"@rstest/core": "^0.8.1",
|
|
9
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
10
|
+
"@testing-library/react": "^16.3.2",
|
|
11
|
+
"happy-dom": "^20.4.0"
|
|
12
|
+
}
|
|
13
|
+
}
|