Skip to content

Commit

Permalink
feat: add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
LonelySnowman committed Oct 11, 2024
1 parent a2fbcd2 commit 7e9bae4
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 26 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: test

on: [push, pull_request]

jobs:
jest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install pnpm
run: npm i -g pnpm@9
- name: Install dependencies
run: pnpm install
- name: Run unit test
run: pnpm run test:unit
- name: Run build
run: pnpm run build:lib
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "1.0.0",
"description": "SnowDesign 组件库",
"scripts": {
"start:react": "storybook dev -p 6006 -c .storybook/react",
"start:vue3": "storybook dev -p 6006 -c .storybook/vue3",
"start:react": "storybook dev -p 6000 -c .storybook/react",
"start:vue3": "storybook dev -p 6001 -c .storybook/vue3",
"start:docs": "pnpm run -C docs start",
"test:unit": "jest --silent",
"test:coverage": "jest --coverage",
Expand Down
6 changes: 6 additions & 0 deletions packages/components/_locale/context.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from 'react';
import type { Locale } from '@snow-design/locale/index';

const LocaleContext = React.createContext<Locale | undefined>(undefined);

export default LocaleContext;
6 changes: 0 additions & 6 deletions packages/components/_locale/context.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion packages/components/_locale/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import LocaleContext from './context';
import { Locale } from "@snow-design/locale/index";
export { default as useLocale } from './useLocale';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import LocaleContext from './context';
import type { Locale, LocaleComponentName } from '@snow-design/locale/index';
import defaultLocaleData from '@snow-design/locale/en_US';
Expand Down
9 changes: 7 additions & 2 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
"build": "snow-tools run build",
"clean": "rimraf lib dist node_modules"
},
"keywords": ["snow-design", "react"],
"keywords": [
"snow-design",
"react"
],
"author": "LonelySnowman",
"license": "ISC",
"dependencies": {
Expand All @@ -23,7 +26,9 @@
},
"devDependencies": {
"@snow-design/theme-default": "workspace:*",
"@snow-design/tools": "workspace:*"
"@snow-design/tools": "workspace:*",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.0"
},
"peerDependencies": {
"react": "18"
Expand Down
26 changes: 12 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7e9bae4

Please sign in to comment.