Skip to content

Commit 9fb3730

Browse files
authored
fix: require lodash-es problem (#1355)
1 parent 12eca6e commit 9fb3730

File tree

17 files changed

+145
-29
lines changed

17 files changed

+145
-29
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Test (Ubuntu)
2+
3+
# Controls when the action will run.
4+
on:
5+
# Triggers the workflow on pull request events for main and release branches
6+
pull_request:
7+
branches: [main, release_*, release-*]
8+
9+
push:
10+
branches: [main, release_*, release-*]
11+
paths-ignore:
12+
- 'document/**'
13+
- '*.md'
14+
- '*.mdx'
15+
16+
merge_group:
17+
18+
# Allows you to run this workflow manually from the Actions tab
19+
workflow_dispatch:
20+
21+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
22+
jobs:
23+
# ======== ut ========
24+
ut-ubuntu:
25+
runs-on: ubuntu-22.04
26+
strategy:
27+
matrix:
28+
node-version: [18.x]
29+
30+
# Steps represent a sequence of tasks that will be executed as part of the job
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
34+
with:
35+
fetch-depth: 10
36+
37+
- name: Install Pnpm
38+
run: |
39+
npm install -g corepack@latest --force
40+
corepack enable
41+
42+
- name: Check skip CI
43+
run: echo "RESULT=$(node ./scripts/skipCI.js)" >> "$GITHUB_OUTPUT"
44+
id: skip-ci
45+
46+
- name: Log skip CI result
47+
run: echo "${{steps.skip-ci.outputs.RESULT}}"
48+
49+
- name: Setup Node.js ${{ matrix.node-version }}
50+
if: ${{steps.skip-ci.outputs.RESULT != 'true'}}
51+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
52+
with:
53+
node-version: ${{ matrix.node-version }}
54+
cache: 'pnpm'
55+
56+
- name: Install Dependencies
57+
if: ${{steps.skip-ci.outputs.RESULT != 'true'}}
58+
run: pnpm install && cd ./e2e && npx playwright install chromium
59+
60+
- name: Unit Test
61+
if: ${{steps.skip-ci.outputs.RESULT != 'true'}}
62+
run: pnpm run e2e:base e2e/cases/doctor-rspack
63+
# ======== e2e ========
64+
# e2e-ubuntu:
65+
# runs-on: ubuntu-latest
66+
# strategy:
67+
# matrix:
68+
# node-version: [18.x]
69+
70+
# # Steps represent a sequence of tasks that will be executed as part of the job
71+
# steps:
72+
# - name: Checkout
73+
# uses: actions/checkout@v3
74+
# with:
75+
# fetch-depth: 10
76+
77+
# - name: Install Pnpm
78+
# run: corepack enable
79+
80+
# - name: Check skip CI
81+
# run: echo "RESULT=$(node ./scripts/skipCI.js)" >> "$GITHUB_OUTPUT"
82+
# id: skip-ci
83+
84+
# - name: Log skip CI result
85+
# run: echo "${{steps.skip-ci.outputs.RESULT}}"
86+
87+
# - name: Setup Node.js ${{ matrix.node-version }}
88+
# if: ${{steps.skip-ci.outputs.RESULT != 'true'}}
89+
# uses: actions/setup-node@v3
90+
# with:
91+
# node-version: ${{ matrix.node-version }}
92+
# cache: 'pnpm'
93+
94+
# - name: Install Dependencies
95+
# if: ${{steps.skip-ci.outputs.RESULT != 'true'}}
96+
# run: pnpm install && cd ./e2e && npx playwright install
97+
98+
# - name: E2E Test
99+
# if: ${{steps.skip-ci.outputs.RESULT != 'true'}}
100+
# run: pnpm run e2e

packages/core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This is the core package of Rsdoctor, providing core tools and analysis capabili
44

55
## Documentation
66

7-
https://rsdoctor.rs/
7+
https://rsdoctor.rs/.
88

99
## Contributing
1010

packages/core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"enhanced-resolve": "5.12.0",
7878
"filesize": "^10.1.6",
7979
"fs-extra": "^11.1.1",
80-
"lodash-es": "^4.17.21",
80+
"lodash": "^4.17.21",
8181
"semver": "^7.7.3",
8282
"source-map": "^0.7.6"
8383
},
@@ -86,7 +86,7 @@
8686
"@rspack/core": "1.5.8",
8787
"@scripts/test-helper": "workspace:*",
8888
"@types/fs-extra": "^11.0.4",
89-
"@types/lodash-es": "^4.17.12",
89+
"@types/lodash": "^4.17.20",
9090
"@types/node": "^22.8.1",
9191
"@types/node-fetch": "^2.6.13",
9292
"@types/semver": "^7.7.1",

packages/core/rslib.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const externals = [
3939
'@rsdoctor/sdk',
4040
'@rsdoctor/types',
4141
'@rsdoctor/utils',
42-
'lodash-es',
42+
'lodash',
4343
'semver',
4444
'source-map',
4545
...externalsPrebundle,

packages/core/src/build-utils/build/loader/probeLoader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Build } from '@/build-utils';
22
import { getSDK } from '@/inner-plugins';
33
import { Plugin, SDK } from '@rsdoctor/types';
44
import type { LoaderDefinitionFunction } from '@rspack/core';
5-
import { omit } from 'lodash-es';
5+
import omit from 'lodash/omit.js';
66
import path from 'path';
77

88
export const loaderModule: Plugin.LoaderDefinition<

packages/core/src/build-utils/build/module-graph/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isNumber } from 'lodash-es';
1+
import isNumber from 'lodash/isNumber.js';
22
import { parser, Node } from '@rsdoctor/utils/ruleUtils';
33
import { SDK } from '@rsdoctor/types';
44
function getDefaultExportIdentifier(

packages/core/src/build-utils/build/module-graph/webpack/transform.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Node } from '@rsdoctor/utils/ruleUtils';
66
import { Plugin, SDK } from '@rsdoctor/types';
77
import { ModuleGraphTrans, Webpack as WebpackGraph } from '@rsdoctor/graph';
88
import { hasSetEsModuleStatement } from '../parser';
9-
import { isFunction } from 'lodash-es';
9+
import isFunction from 'lodash/isFunction.js';
1010
import { logger } from '@rsdoctor/utils/logger';
1111

1212
export interface TransformContext {

packages/core/src/build-utils/build/utils/loader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import path from 'node:path';
22
import { fileURLToPath } from 'node:url';
33
import fse from 'fs-extra';
4-
import { omit } from 'lodash-es';
4+
import omit from 'lodash/omit.js';
55
import { Loader } from '@rsdoctor/utils/common';
66
import type { Common, Plugin } from '@rsdoctor/types';
77
import { Rule } from '../../../types';

packages/core/src/build-utils/build/utils/parseBundle.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import fs from 'fs';
2-
import { find, mapValues } from 'lodash-es';
2+
import find from 'lodash/find.js';
3+
import mapValues from 'lodash/mapValues.js';
34
import { filesize } from 'filesize';
45

56
import { parser } from '@rsdoctor/utils/ruleUtils';

packages/core/src/inner-plugins/plugins/loader.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { Manifest, Plugin } from '@rsdoctor/types';
22
import type { HookInterceptor } from 'tapable';
33
import { Loader } from '@rsdoctor/utils/common';
4-
import { cloneDeep, isEqual, omit } from 'lodash-es';
4+
import cloneDeep from 'lodash/cloneDeep.js';
5+
import isEqual from 'lodash/isEqual.js';
6+
import omit from 'lodash/omit.js';
57
import { LoaderContext, NormalModule } from 'webpack';
68
import { interceptLoader } from '../utils';
79
import { InternalBasePlugin } from './base';

0 commit comments

Comments
 (0)