Skip to content

Commit

Permalink
chore: update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
valcosmos committed Apr 15, 2024
1 parent b683f76 commit 103247b
Show file tree
Hide file tree
Showing 81 changed files with 542 additions and 493 deletions.
31 changes: 0 additions & 31 deletions .eslintrc.cjs

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ name: val-design build and deploy
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: ['main']
branches: [main]
pull_request:
branches: ['main']
branches: [main]

# Allows you to run this workflow manually from the Actions tab
# workflow_dispatch:
Expand Down
1 change: 1 addition & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { StorybookConfig } from '@storybook/react-vite'

const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
Expand Down
3 changes: 0 additions & 3 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import type { Preview } from '@storybook/react'
import { library } from '@fortawesome/fontawesome-svg-core'
import { fas } from '@fortawesome/free-solid-svg-icons'
Expand All @@ -7,7 +6,6 @@ import '../src/styles/index.scss'

import '../src/styles/storyfixed.scss'


library.add(fas)

const preview: Preview = {
Expand Down Expand Up @@ -35,5 +33,4 @@ const preview: Preview = {
// ),
// ]


export default preview
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div align="center">
<img width="80px" src="https://raw.githubusercontent.com/valcosmos/val-design/main/logo.png" />
</div>
</div>

<h3 align="center">Welcome to val-design</h3>

<p align="center">val-design is a simple, lightweight <a href="https://reactjs.org/" target="_blank">React</a> UI component library.</p>
Expand All @@ -19,7 +19,7 @@
<img src="https://img.shields.io/badge/npm-v8.11.0-informational?style=for-the-badge&logo=npm&color=CB3837" />

<img src="https://img.shields.io/badge/License-MIT-green.svg?style=for-the-badge" />

</div>

## Description
Expand Down Expand Up @@ -79,13 +79,15 @@ And import button:
```jsx
import { Button } from 'val-design'

const App = () => (
<>
<Button type="primary" size="lg">
val design
</Button>
</>
)
function App() {
return (
<>
<Button type="primary" size="lg">
val design
</Button>
</>
)
}
```

## Project Activity
Expand Down
35 changes: 35 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// module.exports = {
// env: {
// browser: true,
// es2021: true,
// node: true,
// },
// extends: [
// 'eslint:recommended',
// 'plugin:react/recommended',
// 'plugin:@typescript-eslint/recommended',
// 'plugin:storybook/recommended',
// 'plugin:prettier/recommended',
// 'plugin:storybook/recommended',
// ],
// overrides: [],
// parser: '@typescript-eslint/parser',
// parserOptions: {
// ecmaVersion: 'latest',
// sourceType: 'module',
// },
// plugins: ['react', '@typescript-eslint', 'prettier'],
// rules: {
// 'react/react-in-jsx-scope': 0,
// '@typescript-eslint/no-explicit-any': 'off',
// },
// settings: {
// react: {
// version: 'detect',
// },
// },
// }

import antfu from '@antfu/eslint-config'

export default antfu()
79 changes: 40 additions & 39 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{
"name": "val-design",
"type": "module",
"version": "0.0.46",
"private": false,
"license": "MIT",
"description": "React UI component library",
"author": "Cupid Valentine",
"type": "module",
"license": "MIT",
"homepage": "https://valcosmos.github.io/val-design",
"repository": {
"type": "git",
"url": "https://github.com/valcosmos/val-design.git"
},
"keywords": [
"val-design",
"front-end",
Expand All @@ -17,23 +22,18 @@
"TypeScript",
"React Hooks"
],
"homepage": "https://valcosmos.github.io/val-design",
"repository": {
"type": "git",
"url": "https://github.com/valcosmos/val-design.git"
},
"files": [
"dist"
],
"main": "dist/index.es.js",
"module": "dist/index.es.js",
"types": "dist/index.d.ts",
"unpkg": "dist/index.umd.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"dev": "vite",
"preview": "vite preview",
"lint": "eslint --ext js,ts,tsx src",
"lint:fix": "eslint --fix --ext js,ts,tsx src --max-warnings 5",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"format": "prettier --check .",
"format:fix": "prettier --write .",
"build-ts": "tsc -p tsconfig.build.json",
Expand All @@ -51,12 +51,12 @@
"build-storybook": "storybook build"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.5.1",
"@fortawesome/free-solid-svg-icons": "^6.5.1",
"@fortawesome/fontawesome-svg-core": "^6.5.2",
"@fortawesome/free-solid-svg-icons": "^6.5.2",
"@fortawesome/react-fontawesome": "^0.2.0",
"@react-spring/web": "^9.7.3",
"async-validator": "^4.2.5",
"axios": "^1.6.7",
"axios": "^1.6.8",
"classnames": "^2.5.1",
"dayjs": "^1.11.10",
"lodash-es": "^4.17.21",
Expand All @@ -66,62 +66,63 @@
"uuid": "^9.0.1"
},
"devDependencies": {
"@commitlint/cli": "^18.6.0",
"@commitlint/config-conventional": "^18.6.0",
"@antfu/eslint-config": "^2.13.3",
"@commitlint/cli": "^19.2.2",
"@commitlint/config-conventional": "^19.2.2",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.5",
"@rollup/plugin-terser": "^0.4.4",
"@storybook/addon-essentials": "^7.6.13",
"@storybook/addon-interactions": "^7.6.13",
"@storybook/addon-links": "^7.6.13",
"@storybook/blocks": "^7.6.13",
"@storybook/react": "^7.6.13",
"@storybook/react-vite": "^7.6.13",
"@storybook/addon-essentials": "^8.0.8",
"@storybook/addon-interactions": "^8.0.8",
"@storybook/addon-links": "^8.0.8",
"@storybook/blocks": "^8.0.8",
"@storybook/react": "^8.0.8",
"@storybook/react-vite": "^8.0.8",
"@storybook/testing-library": "^0.2.2",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.1",
"@testing-library/react": "^15.0.2",
"@types/fs-extra": "^11.0.4",
"@types/lodash-es": "^4.17.12",
"@types/react-dom": "^18.2.18",
"@types/react-dom": "^18.2.25",
"@types/react-transition-group": "^4.4.10",
"@types/uuid": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@typescript-eslint/eslint-plugin": "^7.6.0",
"@typescript-eslint/parser": "^7.6.0",
"@vitejs/plugin-react": "^4.2.1",
"@vitejs/plugin-react-swc": "^3.6.0",
"@vitest/coverage-c8": "^0.33.0",
"babel-loader": "^9.1.3",
"child_process": "^1.0.2",
"dirname-filename-esm": "^1.1.1",
"eslint": "^8.56.0",
"eslint": "^9.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-n": "^17.2.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-storybook": "^0.6.15",
"eslint-plugin-storybook": "^0.8.0",
"fs-extra": "^11.2.0",
"handlebars": "^4.7.8",
"husky": "^9.0.10",
"husky": "^9.0.11",
"jsdom": "^24.0.0",
"path-exists": "^5.0.0",
"prettier": "^3.2.5",
"prop-types": "^15.8.1",
"rimraf": "^5.0.5",
"rollup": "^4.9.6",
"rollup": "^4.14.3",
"rollup-plugin-exclude-dependencies-from-bundle": "^1.1.23",
"rollup-plugin-sass": "^1.12.21",
"rollup-plugin-typescript2": "^0.36.0",
"sass": "^1.70.0",
"storybook": "^7.6.13",
"sass": "^1.75.0",
"storybook": "^8.0.8",
"ts-node": "^10.9.2",
"typescript": "^5.3.3",
"vite": "^5.0.12",
"vitest": "^1.2.2"
"typescript": "^5.4.5",
"vite": "^5.2.8",
"vitest": "^1.5.0"
}
}
2 changes: 1 addition & 1 deletion rollup.esm.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import baseConfig from './rollup.config'
import excludeDependenciesFromBundle from 'rollup-plugin-exclude-dependencies-from-bundle'
import baseConfig from './rollup.config'

const config = {
...baseConfig,
Expand Down
10 changes: 5 additions & 5 deletions rollup.umd.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
// import json from '@rollup/plugin-json'
// import sass from 'rollup-plugin-sass'
// // import excludeDependenciesFromBundle from 'rollup-plugin-exclude-dependencies-from-bundle'
import baseConfig from './rollup.config'
import replace from '@rollup/plugin-replace'
import terser from '@rollup/plugin-terser'
import terser from '@rollup/plugin-terser'
import baseConfig from './rollup.config'

// const overrides = {
// compilerOptions: {
Expand All @@ -27,16 +27,16 @@ const config = {
exports: 'named',
// 设置排除的包在cdn引入时的全局变量名
globals: {
react: 'React',
'react': 'React',
'react-dom': 'ReactDOM',
axios: 'Axios',
'axios': 'Axios',
},
plugins: [terser()],
},
],
plugins: [
replace({
preventAssignment: true,
'preventAssignment': true,
'process.env.NODE_ENV': JSON.stringify('production'),
}),
...baseConfig.plugins,
Expand Down
10 changes: 6 additions & 4 deletions scripts/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
// const fetch = require('node-fetch')

import path from 'node:path'
import { spawn } from 'node:child_process'
import process from 'node:process'
import glob from 'glob'
import fs from 'fs-extra'
import chalk from 'chalk'
import { spawn } from 'child_process'
import handlebars from 'handlebars'
import { pathExistsSync } from 'path-exists'

Expand All @@ -21,8 +22,9 @@ const __dirname = dirname(import.meta)
* abc-xyz => AbcXyz
* @param {*} str
*/
const varCase = (str: string) =>
str.replace(/-[a-z]/g, m => m[1].toUpperCase()).replace(/^.{1}/, m => m.toUpperCase())
function varCase(str: string) {
return str.replace(/-[a-z]/g, m => m[1].toUpperCase()).replace(/^.{1}/, m => m.toUpperCase())
}
const lowCase = (str: string) => str.replace(/[A-Z]/g, m => `-${m.toLowerCase()}`).replace(/^-/, '')

async function create() {
Expand All @@ -41,7 +43,7 @@ async function create() {

const tplFiles = glob.sync(path.join(__dirname, 'template/*.hbs'))

tplFiles.forEach(async filePath => {
tplFiles.forEach(async (filePath) => {
const content = await fs.readFile(filePath, 'utf-8')
const template = handlebars.compile(content)
const result = template({
Expand Down
10 changes: 8 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@ function App() {
<p>Hello Vite + React!</p>
<p>
<button type="button" onClick={() => setCount(count => count + 1)}>
count is: {count}
count is:
{' '}
{count}
</button>
</p>
<p>
Edit <code>App.tsx</code> and save to test HMR updates.
Edit
{' '}
<code>App.tsx</code>
{' '}
and save to test HMR updates.
</p>
<p>
<a
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/Alert/alert.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Meta, StoryFn } from '@storybook/react'
import type { Meta, StoryFn } from '@storybook/react'
import { action } from '@storybook/addon-actions'

import Alert from './alert'
Expand Down
Loading

0 comments on commit 103247b

Please sign in to comment.