Skip to content

Commit

Permalink
refactor: follow kebab-case file naming convention
Browse files Browse the repository at this point in the history
  • Loading branch information
hemengke1997 committed Jun 1, 2024
1 parent e39572a commit d22f177
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 22 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"@minko-fe/prettier-config": "^2.2.2",
"@minko-fe/tsconfig": "latest",
"eslint": "^8.57.0",
"npm-run-all2": "^6.2.0",
"nyc": "^15.1.0",
"prettier-plugin-astro": "^0.13.0",
"prettier-plugin-tailwindcss": "^0.5.14",
Expand Down
5 changes: 4 additions & 1 deletion packages/istanbul-widget/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@
"build": "tsup",
"vite": "vite",
"report": "NODE_ENV=production REPORT=true vite build --mode production",
"lint": "eslint . --fix",
"lint": "run-p type-check eslint",
"type-check": "tsc --noEmit",
"eslint": "eslint . --fix",
"preview": "vite preview"
},
"peerDependencies": {
Expand Down Expand Up @@ -106,6 +108,7 @@
"tailwindcss-rem-to-px": "^0.1.0",
"tsup-plugin-bundleless": "^0.3.2",
"tsup-plugin-css-legacy": "^0.0.1",
"typescript": "^5.4.5",
"vite": "^5.2.11"
}
}
2 changes: 1 addition & 1 deletion packages/istanbul-widget/src/core/components/Draggable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { type DragOptions, useDraggable } from '@neodrag/react'
import { type PropsWithChildren, memo, useEffect, useRef, useState } from 'react'
import { cn } from '@/components/utils'
import { ISTANBUL_WIDGET_ID } from '@/utils/const'
import Context from '../Context'
import Context from '../context'
import { type Position } from '../options.interface'

type DraggableProps = PropsWithChildren<{
Expand Down
12 changes: 6 additions & 6 deletions packages/istanbul-widget/src/core/core.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { isArray, isFunction, isObject, merge, set } from '@minko-fe/lodash-pro'
import { type ConsolaInstance, LogLevels, createConsola } from 'consola/browser'
import { ButtonGroupPlugin } from '@/plugins/button-group/ButtonGroupPlugin'
import { ReportPlugin } from '@/plugins/report/ReportPlugin'
import { SettingPlugin } from '@/plugins/setting/SettingPlugin'
import { ButtonGroupPlugin } from '@/plugins/button-group/button-group-plugin'
import { ReportPlugin } from '@/plugins/report/report-plugin'
import { SettingPlugin } from '@/plugins/setting/setting-plugin'
import { ISTANBUL_WIDGET_ID } from '@/utils/const'
import { $ } from '@/utils/query'
import Context from './Context'
import Context from './context'
import { type IstanbulWidgetOptions, type PluginName, type PluginType } from './options.interface'
import { IstanbulWidgetPlugin } from './plugin/IstanbulWidgetPlugin'
import { IstanbulWidgetReactPlugin } from './plugin/IstanbulWidgetReactPlugin'
import { IstanbulWidgetPlugin } from './plugin/istanbul-widget-plugin'
import { IstanbulWidgetReactPlugin } from './plugin/istanbul-widget-react-plugin'
import { type CompInstance, render } from './render'
import '@/styles/global.css'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { Popover, PopoverArrow, PopoverClose, PopoverContent, PopoverTrigger } f
import { Toaster } from '@/components/ui/toaster'
import { ISTANBUL_WIDGET_ID } from '@/utils/const'
import { $ } from '@/utils/query'
import Context from './Context'
import Draggable from './components/Draggable'
import Draggable from './components/draggable'
import Context from './context'
import { type Position } from './options.interface'

function IstanbulWidgetComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { $ } from '@/utils/query'
import { IstanbulWidget } from '../core'
import { reactdomRender, reactdomUnmount } from '../dom/react-render'
import { type PluginType } from '../options.interface'
import { IstanbulWidgetPlugin } from './IstanbulWidgetPlugin'
import { IstanbulWidgetPlugin } from './istanbul-widget-plugin'

export type IstanbulWidgetReactPluginProps = {} & PluginType

Expand Down
4 changes: 2 additions & 2 deletions packages/istanbul-widget/src/core/render.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ISTANBUL_WIDGET_ID } from '@/utils/const'
import Context, { type InitialWidgetProps } from './Context'
import IstanbulWidgetComponent from './IstanbulWidget'
import Context, { type InitialWidgetProps } from './context'
import { reactdomRender, reactdomUnmount } from './dom/react-render'
import IstanbulWidgetComponent from './istanbul-widget'
import { type PluginType } from './options.interface'

export type CompInstance = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IstanbulWidgetReactPlugin } from '@/core/plugin/IstanbulWidgetReactPlugin'
import ButtonGroup, { type ButtonGroupProps } from './ButtonGroup'
import { IstanbulWidgetReactPlugin } from '@/core/plugin/istanbul-widget-react-plugin'
import ButtonGroup, { type ButtonGroupProps } from './button-group'

export class ButtonGroupPlugin extends IstanbulWidgetReactPlugin<ButtonGroupProps> {
constructor(id: string, name: string, renderProps: ButtonGroupProps) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { memo } from 'react'
import { Button } from '@/components/ui/button'
import Context from '@/core/Context'
import Context from '@/core/context'
import { type ButtonGroupOptions } from '@/core/options.interface'

export type ButtonGroupProps = {
Expand Down
2 changes: 1 addition & 1 deletion packages/istanbul-widget/src/plugins/report/Report.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { memo } from 'react'
import { Button } from '@/components/ui/button'
import Context from '../../core/Context'
import Context from '../../core/context'

function Report() {
const { plugin, reportFn } = Context.usePicker(['plugin', 'reportFn'])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IstanbulWidgetReactPlugin } from '@/core/plugin/IstanbulWidgetReactPlugin'
import Report from './Report'
import { IstanbulWidgetReactPlugin } from '@/core/plugin/istanbul-widget-react-plugin'
import Report from './report'

export class ReportPlugin extends IstanbulWidgetReactPlugin {
constructor(id: string, name: string, renderProps = {}) {
Expand Down
2 changes: 1 addition & 1 deletion packages/istanbul-widget/src/plugins/setting/Setting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { Label } from '@/components/ui/label'
import { Switch } from '@/components/ui/switch'
import { useToast } from '@/components/ui/use-toast'
import { ISTANBUL_WIDGET_ID } from '@/utils/const'
import Context from '../../core/Context'
import Context from '../../core/context'

type Config = {
reporter: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IstanbulWidgetReactPlugin } from '@/core/plugin/IstanbulWidgetReactPlugin'
import Setting from './Setting'
import { IstanbulWidgetReactPlugin } from '@/core/plugin/istanbul-widget-react-plugin'
import Setting from './setting'

export class SettingPlugin extends IstanbulWidgetReactPlugin {
constructor(id: string, name: string, renderProps = {}) {
Expand Down
6 changes: 6 additions & 0 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 d22f177

Please sign in to comment.