From 2a5615558742c7f8513083c7d44a619a38d33953 Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Wed, 2 Apr 2025 12:43:11 -0700 Subject: [PATCH] add circular deps to PRs (#6116) * add to ci Signed-off-by: Jess Frazelle * updates Signed-off-by: Jess Frazelle * fixes Signed-off-by: Jess Frazelle * fixes Signed-off-by: Jess Frazelle * updates Signed-off-by: Jess Frazelle --------- Signed-off-by: Jess Frazelle --- .github/workflows/static-analysis.yml | 30 +++++++++++++++++++++++++++ known-circular.txt | 1 + package.json | 1 + 3 files changed, 32 insertions(+) create mode 100644 known-circular.txt diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 7e18ad37d..e2e90230e 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -136,6 +136,36 @@ jobs: - run: yarn lint + yarn-circular-dependencies: + runs-on: ubuntu-latest + needs: yarn-build-wasm + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'yarn' + - run: yarn install + + - name: Download all artifacts + uses: actions/download-artifact@v4 + + - name: Copy prepared wasm + run: | + ls -R prepared-wasm + cp prepared-wasm/kcl_wasm_lib_bg.wasm public + mkdir rust/kcl-wasm-lib/pkg + cp prepared-wasm/kcl_wasm_lib* rust/kcl-wasm-lib/pkg + + - name: Copy prepared ts-rs bindings + run: | + ls -R prepared-ts-rs-bindings + mkdir rust/kcl-lib/bindings + cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/ + + - run: yarn diff-circular-deps + python-codespell: runs-on: ubuntu-22.04 steps: diff --git a/known-circular.txt b/known-circular.txt new file mode 100644 index 000000000..d8fd5c2df --- /dev/null +++ b/known-circular.txt @@ -0,0 +1 @@ +$ dpdm --no-warning --no-tree -T --skip-dynamic-imports=circular src/index.tsx• Circular Dependencies 01) src/lang/std/sketch.ts -> src/lang/modifyAst.ts -> src/lang/modifyAst/addEdgeTreatment.ts 02) src/lang/std/sketch.ts -> src/lang/modifyAst.ts 03) src/lang/std/sketch.ts -> src/lang/modifyAst.ts -> src/lang/std/sketchcombos.ts 04) src/clientSideScene/CameraControls.ts -> src/clientSideScene/sceneInfra.ts 05) src/lib/singletons.ts -> src/editor/manager.ts -> src/lib/selections.ts 06) src/lib/singletons.ts -> src/editor/manager.ts 07) src/lib/singletons.ts -> src/lang/KclSingleton.ts 08) src/lib/singletons.ts -> src/lang/codeManager.ts 09) src/lib/singletons.ts -> src/clientSideScene/sceneEntities.ts -> src/clientSideScene/segments.ts -> src/components/Toolbar/angleLengthInfo.ts 10) src/lib/singletons.ts -> src/clientSideScene/sceneEntities.ts -> src/clientSideScene/segments.ts -> src/machines/commandBarMachine.ts -> src/lib/commandBarConfigs/authCommandConfig.ts -> src/machines/appMachine.ts -> src/machines/settingsMachine.ts -> src/lib/commandBarConfigs/settingsCommandConfig.ts -> src/lib/createMachineCommand.ts -> src/routes/Settings.tsx -> src/components/Settings/AllSettingsFields.tsx -> src/components/LspProvider.tsx -> src/editor/plugins/lsp/copilot/index.ts 11) src/lib/singletons.ts -> src/clientSideScene/sceneEntities.ts -> src/clientSideScene/segments.ts -> src/machines/commandBarMachine.ts -> src/lib/commandBarConfigs/authCommandConfig.ts -> src/machines/appMachine.ts -> src/machines/settingsMachine.ts -> src/lib/commandBarConfigs/settingsCommandConfig.ts -> src/lib/createMachineCommand.ts -> src/routes/Settings.tsx -> src/components/Settings/AllSettingsFields.tsx -> src/components/LspProvider.tsx -> src/editor/plugins/lsp/kcl/language.ts -> src/editor/plugins/lsp/kcl/index.ts 12) src/lib/singletons.ts -> src/clientSideScene/sceneEntities.ts -> src/clientSideScene/segments.ts -> src/machines/commandBarMachine.ts -> src/lib/commandBarConfigs/authCommandConfig.ts -> src/machines/appMachine.ts -> src/machines/settingsMachine.ts -> src/lib/commandBarConfigs/settingsCommandConfig.ts -> src/lib/createMachineCommand.ts -> src/routes/Settings.tsx -> src/components/Settings/AllSettingsFields.tsx -> src/components/LspProvider.tsx 13) src/machines/appMachine.ts -> src/machines/settingsMachine.ts -> src/lib/commandBarConfigs/settingsCommandConfig.ts -> src/lib/createMachineCommand.ts -> src/routes/Settings.tsx -> src/components/Settings/AllSettingsFields.tsx -> src/components/LspProvider.tsx 14) src/machines/appMachine.ts -> src/machines/settingsMachine.ts -> src/lib/commandBarConfigs/settingsCommandConfig.ts -> src/lib/createMachineCommand.ts -> src/routes/Settings.tsx -> src/components/Settings/AllSettingsFields.tsx -> src/components/Settings/SettingsFieldInput.tsx 15) src/machines/appMachine.ts -> src/machines/settingsMachine.ts -> src/lib/commandBarConfigs/settingsCommandConfig.ts -> src/lib/createMachineCommand.ts -> src/routes/Settings.tsx -> src/components/Settings/AllSettingsFields.tsx 16) src/routes/Settings.tsx -> src/components/Settings/AllSettingsFields.tsx 17) src/machines/appMachine.ts -> src/machines/settingsMachine.ts -> src/lib/commandBarConfigs/settingsCommandConfig.ts -> src/lib/createMachineCommand.ts -> src/routes/Settings.tsx -> src/components/Settings/SettingsSearchBar.tsx 18) src/machines/appMachine.ts -> src/machines/settingsMachine.ts -> src/lib/commandBarConfigs/settingsCommandConfig.ts -> src/lib/createMachineCommand.ts -> src/routes/Settings.tsx -> src/components/Settings/SettingsSectionsList.tsx 19) src/lib/singletons.ts -> src/clientSideScene/sceneEntities.ts -> src/clientSideScene/segments.ts -> src/machines/commandBarMachine.ts -> src/lib/commandBarConfigs/authCommandConfig.ts -> src/machines/appMachine.ts -> src/machines/settingsMachine.ts 20) src/machines/commandBarMachine.ts -> src/lib/commandBarConfigs/authCommandConfig.ts -> src/machines/appMachine.ts -> src/machines/settingsMachine.ts 21) src/hooks/useModelingContext.ts -> src/components/ModelingMachineProvider.tsx -> src/components/Toolbar/Intersect.tsx -> src/components/SetHorVertDistanceModal.tsx -> src/lib/useCalculateKclExpression.ts 22) src/components/ToastTextToCad.tsx -> src/lib/textToCad.ts 23) src/hooks/useModelingContext.ts -> src/components/ModelingMachineProvider.tsx -> src/machines/modelingMachine.ts -> src/clientSideScene/ClientSideSceneComp.tsx 24) src/routes/Onboarding/index.tsx -> src/routes/Onboarding/Camera.tsx -> src/routes/Onboarding/utils.tsx \ No newline at end of file diff --git a/package.json b/package.json index 12769b7fc..5e0ff242c 100644 --- a/package.json +++ b/package.json @@ -103,6 +103,7 @@ "lint-fix": "eslint --fix --ext .ts --ext .tsx src e2e packages/codemirror-lsp-client/src rust/kcl-language-server/client/src", "lint": "eslint --max-warnings 0 --ext .ts --ext .tsx src e2e packages/codemirror-lsp-client/src rust/kcl-language-server/client/src", "circular-deps": "dpdm --no-warning --no-tree -T --skip-dynamic-imports=circular src/index.tsx", + "diff-circular-deps": "yarn circular-deps | sed '$d' | grep -v '^yarn run' | tr -d '\n' > /tmp/circular-deps.txt && diff -w /tmp/circular-deps.txt ./known-circular.txt", "files:set-version": "echo \"$(jq --arg v \"$VERSION\" '.version=$v' package.json --indent 2)\" > package.json", "files:set-notes": "./scripts/set-files-notes.sh", "files:flip-to-nightly": "./scripts/flip-files-to-nightly.sh",