Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#9457: move knip to repository root #9505

Merged
merged 8 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,16 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: applications/browser-extension/package.json
node-version-file: package.json
cache: npm
- run: npm ci
# Running over all workspaces. To run for single workspace, pass workspace arg, e.g., --workspace=applications/browser-extension
# Detect dead code with enforced rules
- run: npm run dead-code --workspace=applications/browser-extension
- run: npm run dead-code
# Detect dead code that is only used by tests
- run: npm run dead-code:prod --workspace=applications/browser-extension
- run: npm run dead-code:prod
# Also run the remaining "warn" rules
- run: npm run dead-code:base --workspace=applications/browser-extension -- --no-exit-code
- run: npm run dead-code:base -- --no-exit-code

# https://pre-commit.com/#usage-in-continuous-integration
prettier:
Expand Down Expand Up @@ -225,7 +226,9 @@ jobs:
ARTIFACT_ZIP_PASSWORD: ${{ secrets.ARTIFACT_ZIP_PASSWORD }}
run: 7z -y x -p"$ARTIFACT_ZIP_PASSWORD" -o./applications/browser-extension/blob-reports "./applications/browser-extension/7z-blob-reports/*.7z"
- name: Merge blob reports
run: PLAYWRIGHT_JSON_OUTPUT_NAME=./applications/browser-extension/playwright-report/results.json npx playwright merge-reports --reporter=html,json ./applications/browser-extension/blob-reports
# Provide `--yes` for knip. Even though playwright will be available via @playwright/test, knip doesn't
# associate it with the playwright command
run: PLAYWRIGHT_JSON_OUTPUT_NAME=./applications/browser-extension/playwright-report/results.json npx --yes playwright merge-reports --reporter=html,json ./applications/browser-extension/blob-reports
- name: Password protect merged Playwright report
if: always()
shell: bash
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/upload-mixpanel-lexicon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: package.json
node-version-file: applications/browser-extension/package.json
cache: npm
- name: Install dependencies
run: npm ci
- name: Compile TypeScript
# Explicitly specify the TypeScript environment because tsconfig.json is ignored when input files are specified
run: npx tsc applications/browser-extension/scripts/uploadMixpanelLexicon.ts --esModuleInterop --lib esnext
# Provide `--yes` for knip. Even though tsc will be available via typescript, knip doesn't associate it with
# the tsc command
run: npx --yes tsc applications/browser-extension/scripts/uploadMixpanelLexicon.ts --esModuleInterop --lib esnext
- name: Upload Lexicon
if: github.ref_name == 'main'
run: node applications/browser-extension/scripts/uploadMixpanelLexicon.js
Expand Down
4 changes: 2 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
"filename": ".github/workflows/ci.yml",
"hashed_secret": "3e26d6750975d678acb8fa35a0f69237881576b0",
"is_verified": false,
"line_number": 198
"line_number": 199
}
],
".github/workflows/e2e-test-pre-release-browsers.yml": [
Expand Down Expand Up @@ -273,5 +273,5 @@
}
]
},
"generated_at": "2024-10-22T20:32:58Z"
"generated_at": "2024-11-12T15:43:11Z"
}
143 changes: 0 additions & 143 deletions applications/browser-extension/knip.mjs

This file was deleted.

8 changes: 1 addition & 7 deletions applications/browser-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@
"build:typecheck": "tsc --noEmit",
"generate:headers": "npm run test -- src/development/headers.test.ts --no-silent",
"storybook": "storybook dev -p 6006 -s public",
"build-storybook": "storybook build",
"dead-code": "npm run dead-code:base -- --include files,duplicates,dependencies,classMembers,binaries,enumMembers,nsTypes,exports,nsExports",
"dead-code:base_BROKEN_DUE_TO_NOT_BEING_RUN_IN_ROOT": "knip --config knip.mjs --tags=-knip",
"dead-code:base": "echo 'skipping knip until fixed in next changeset. See: https://knip.dev/guides/handling-issues#missing-binaries'",
"dead-code:prod": "npm run dead-code -- --production"
"build-storybook": "storybook build"
},
"author": "Todd Schiller",
"license": "AGPL-3.0",
Expand Down Expand Up @@ -270,7 +266,6 @@
"jest-webextension-mock": "^3.9.0",
"jsdom": "^25.0.1",
"jsdom-testing-mocks": "^1.13.1",
"knip": "^5.36.2",
"mini-css-extract-plugin": "^2.6.1",
"mockdate": "^3.0.5",
"msw": "^1.3.5",
Expand All @@ -279,7 +274,6 @@
"node-polyfill-webpack-plugin": "^4.0.0",
"otpauth": "^9.3.4",
"path-browserify": "^1.0.1",
"prettier": "3.1.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See discussion: #9503

"react-beautiful-dnd-next": "^11.0.5",
"react-refresh-typescript": "^2.0.9",
"react-select-event": "^5.3.0",
Expand Down
2 changes: 2 additions & 0 deletions applications/browser-extension/src/store/editorMigrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,8 @@ export function migrateEditorStateV11(
*
* If any keys were dropped from EditorStateSynced, they'll be dropped via the next redux-persist write/flush cycle:
* https://github.com/rt2zz/redux-persist/blob/d8b01a085e3679db43503a3858e8d4759d6f22fa/src/createPersistoid.ts#L37
*
* @internal
*/
export function resetEditorStateSynced<T extends PersistedState>(
state: T,
Expand Down
4 changes: 3 additions & 1 deletion applications/browser-extension/webpack.sharedConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ const path = require("node:path");
const JSON5 = require("json5");
const { merge } = require("webpack-merge");

const tsconfig = JSON5.parse(fs.readFileSync("./tsconfig.json", "utf8"));
const tsconfig = JSON5.parse(
fs.readFileSync(path.resolve(__dirname, "./tsconfig.json"), "utf8"),
);

const isProd = process.argv.includes("production");
const isHMR = Boolean(process.env.HMR);
Expand Down
Loading
Loading