Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit c3dc374

Browse files
authored
chore: more utils import re-org (#1134)
* chore: hide PagedArticles tmply * chore: downgrade cypress * chore: debug * chore: abs import re-org * chore: bring e2e tests back * chore: debug net err * chore: retest cy 4.2.0 * chore: try NO_PROXY * chore: alright, use latest * chore: try cy official example * chore: try cy official example * chore: try cy official example * chore: try cy official example * chore: debug actions * chore: debug actions * chore: debug actions * chore: debug actions * chore: debug actions aaa
1 parent f329486 commit c3dc374

File tree

85 files changed

+538
-537
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+538
-537
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,24 @@ jobs:
8787
- name: (Frontend) Build Project
8888
working-directory: ./frontend_server
8989
run: npm run build.ci
90-
- name: (Frontend) Check Bundle Size
90+
- name: check /etc/hosts
9191
working-directory: ./frontend_server
92-
run: BUNDLEWATCH_GITHUB_TOKEN=${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }} npm run size.check
93-
- name: (Frontend) Run e2e Tests
92+
run: echo "#>>>>#"; cat /etc/hosts; pwd; echo "#>>>>#"
93+
# - name: (Frontend) Check Bundle Size
94+
# working-directory: ./frontend_server
95+
# run: BUNDLEWATCH_GITHUB_TOKEN=${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }} npm run size.check
96+
# - name: (Frontend) Run e2e Tests
97+
# working-directory: ./frontend_server
98+
# run: npm run test:ci
99+
cypress-run:
100+
name: run cypress
101+
runs-on: ubuntu-latest
102+
steps:
103+
- name: Cypress run
94104
working-directory: ./frontend_server
95-
run: npm run test:ci
105+
uses: cypress-io/github-action@v2
106+
with:
107+
browser: chrome
108+
# build: npm run build
109+
start: npm run ci
110+
wait-on: http://localhost:3000

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dev": "cross-env NODE_ENV=dev node server.js",
77
"prod": "cross-env NODE_ENV=production run-p server",
88
"local": "cross-env NODE_ENV=local node server",
9-
"ci": "cross-env NODE_ENV=ci node server --inspect",
9+
"ci": "cross-env NODE_ENV=ci node server",
1010
"server": "npm run clean && node server.js",
1111
"build": "next build",
1212
"build:clean": "run-s dist clean",
@@ -149,7 +149,7 @@
149149
"bundlewatch": "^0.2.7",
150150
"commitizen": "3.1.2",
151151
"coveralls": "3.0.14",
152-
"cypress": "4.2.0",
152+
"cypress": "^8.1.0",
153153
"cz-conventional-changelog": "^3.0.0",
154154
"enzyme": "3.11.0",
155155
"enzyme-adapter-react-16": "1.15.2",

src/components/FormItem/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import React from 'react'
88
import T from 'prop-types'
99
import { isEmpty } from 'ramda'
1010

11-
import { buildLog, hasValue } from '@/utils'
11+
import { buildLog } from '@/utils/logger'
12+
import { hasValue } from '@/utils/validator'
1213
import { SIZE } from '@/constant'
1314
import Maybe from '@/components/Maybe'
1415

src/components/Modal/Belt.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22

3-
import { useScript } from '@/hooks'
3+
import useScript from '@/hooks/useScript'
44

55
import { Wrapper, Holder } from './styles/belt'
66

src/components/Modal/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import usePortal from 'react-useportal'
1010
import { ICON_CMD } from '@/config'
1111
import { toggleGlobalBlur } from '@/utils/dom'
1212
import { buildLog } from '@/utils/logger'
13-
import { useShortcut } from '@/hooks'
13+
import useShortcut from '@/hooks/useShortcut'
1414

1515
import ViewportTracker from '@/components/ViewportTracker'
1616
import Belt from './Belt'

src/components/NaviCatalog/index.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@ import { FC, useState, useCallback, useEffect, memo } from 'react'
88
import { find, findIndex, propEq, last } from 'ramda'
99

1010
import { URL_QUERY } from '@/constant'
11-
import {
12-
buildLog,
13-
nilOrEmpty,
14-
getQueryFromUrl,
15-
markRoute,
16-
findDeepMatch,
17-
} from '@/utils'
11+
12+
import { findDeepMatch } from '@/utils/helper'
13+
import { buildLog } from '@/utils/logger'
14+
import { nilOrEmpty } from '@/utils/validator'
15+
import { getQueryFromUrl, markRoute } from '@/utils/route'
1816

1917
import type { TMenuItem, TMenuMode } from './spec'
2018
import { ROOT_MENU, CHILD_MENU } from './constant'

src/components/PostItem/ListView.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import TimeAgo from 'timeago-react'
33

44
import type { TPost } from '@/spec'
55
import { ICON_CMD } from '@/config'
6-
import { cutRest, parseDomain } from '@/utils'
6+
import { cutRest } from '@/utils/helper'
7+
import { parseDomain } from '@/utils/route'
78

89
import InlineTags from '@/components/InlineTags'
910

src/components/Switcher/Tabs/TabIcon.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React, { FC, useCallback } from 'react'
1+
import { FC, useCallback } from 'react'
2+
import dynamic from 'next/dynamic'
23

34
import type { TTabItem } from '@/spec'
4-
import LocalIcon from './LocalIcon'
55
import { Wrapper, Icon } from '../styles/tabs/tab_icon'
66

77
type TProps = {
@@ -12,6 +12,10 @@ type TProps = {
1212
active: boolean
1313
}
1414

15+
export const LocalIcon = dynamic(() => import('./LocalIcon'), {
16+
ssr: false,
17+
})
18+
1519
const TabIcon: FC<TProps> = ({ item, clickableRef, active }) => {
1620
const { localIcon, icon } = item
1721

src/components/Switcher/Tabs/TabItem.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
import { FC, useEffect, useCallback, useRef, memo } from 'react'
88

99
import type { TSIZE_SM, TTabItem } from '@/spec'
10-
import { buildLog, isString, Trans } from '@/utils'
10+
import { Trans } from '@/utils/i18n'
11+
import { isString } from '@/utils/validator'
12+
import { buildLog } from '@/utils/logger'
1113

1214
import TabIcon from './TabIcon'
1315
import {

src/components/ThemeSelector/styles/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import styled from 'styled-components'
22

33
import type { TActive, TThemeName } from '@/spec'
4-
import { theme, themeCoverMap, themeCoverIndexMap, css } from '@/utils'
4+
import { theme, themeCoverMap, themeCoverIndexMap } from '@/utils/themes'
5+
import css from '@/utils/css'
56

67
type TDot = TActive & { name: TThemeName }
78
export const Dot = styled.div<TDot>`

0 commit comments

Comments
 (0)