Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
9 changes: 0 additions & 9 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ module.exports = {
'@typescript-eslint/no-namespace': 'off',
},
},
{
files: ['**/jest/*', '**/*.stories.mdx'],
rules: {
'import/no-extraneous-dependencies': [
'error',
{ devDependencies: true },
],
},
},
{
// // We need to override them here, because as a result of the `extends` command pulling
// // in additional plugins, the base rules settings of turning this rules off were NOT
Expand Down
10 changes: 2 additions & 8 deletions .github/actions/yarn/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,14 @@ runs:
using: 'composite'
steps:
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
registry-url: 'https://registry.npmjs.org'
- name: Custom Cypress Cache Folder
shell: bash
run: |
mkdir -p $RUNNER_TEMP/cypress
echo "CYPRESS_CACHE_FOLDER=$RUNNER_TEMP/cypress" >> $GITHUB_ENV
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
**/node_modules
${{ env.CYPRESS_CACHE_FOLDER }}
key: v1-yarn-${{ runner.os }}-${{ hashFiles('.nvmrc') }}-${{ hashFiles('**/yarn.lock') }}

- name: Install Dependencies If Not Cached
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
run: |
npx lerna publish --yes --canary --dist-tag=alpha.${GITHUB_SHA:0:6} --preid=alpha.${GITHUB_SHA:0:6}
npx lerna publish --yes --canary --include-merged-tags --dist-tag=alpha.${GITHUB_SHA:0:6} --preid=alpha.${GITHUB_SHA:0:6}

- name: Publish
# Only publish the non-alpha version on main
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: Push

on: push

jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: Codecademy/run-on-yarn@v2
with:
command: ${{ matrix.command }}
- uses: actions/checkout@v4
- uses: ./.github/actions/yarn
- run: yarn ${{ matrix.command }}

strategy:
fail-fast: false
matrix:
command: ['format:verify', 'lint', 'verify']

on: push
command: ['format:verify', 'lint', 'verify', 'syncpack:lint']
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.17.0
v22.14.0
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ node_modules
**/node_modules
**/dist
**/tmp

/.nx/workspace-data
55 changes: 55 additions & 0 deletions .syncpackrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// @ts-check

/**
* Syncpack configuration file
* Controls version management and package.json formatting across the monorepo
* @see https://github.com/JamieMason/syncpack
* @type {import("syncpack").RcFile}
*/
const config = {
/**
* Glob patterns for package.json files to process
* Includes root, apps, libs, and tools directories
*/
source: ['package.json', 'packages/*/package.json'],

/**
* Fields to sort alphabetically in package.json
*/
sortAz: [
'contributors',
'dependencies',
'devDependencies',
'keywords',
'peerDependencies',
'resolutions',
'scripts',
],

/**
* Fields that should appear first in package.json, in this order
*/
sortFirst: ['name', 'description', 'version', 'author'],

/**
* Version management rules for different package groups
*/
versionGroups: [
{
/** Ignore version syncing for peer dependencies */
label: 'ignore peer dependencies',
packages: ['**'],
dependencyTypes: ['peer'],
isIgnored: true,
},
// {
// /** Align all package versions with those defined in @mono/root */
// packages: ['**'],
// dependencies: ['**'],
// dependencyTypes: ['dev', 'prod', 'overrides', 'resolutions'],
// snapTo: ['client-modules'],
// },
],
};

module.exports = config;
4 changes: 2 additions & 2 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true,
"packages": ["packages/*"],
"command": {
"publish": {
Expand All @@ -11,5 +10,6 @@
"version": {
"changelogPreset": "conventionalcommits"
}
}
},
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
36 changes: 19 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "MIT",
"author": "Codecademy Engineers <dev@codecademy.com>",
"engines": {
"node": "^16.17",
"node": "^22.14.0",
"yarn": "^1.22"
},
"scripts": {
Expand All @@ -24,7 +24,8 @@
"clear-modules": "lerna clean -y && rm -rf node_modules",
"build": "turbo run build --concurrency=3",
"build-all": "yarn build",
"prepare": "husky install"
"prepare": "husky install",
"syncpack:lint": "syncpack lint"
},
"lint-staged": {
"**/*.{js,ts,tsx,json}": [
Expand All @@ -45,13 +46,13 @@
"conventional-changelog-cli": "^2.0.34",
"conventional-changelog-conventionalcommits": "^4.3.0",
"gh-pages": "^5.0.0",
"lerna": "3.22.1"
"lerna": "8.2.2"
},
"devDependencies": {
"@babel/cli": "7.13.10",
"@babel/core": "7.19.6",
"@babel/preset-typescript": "^7.13.0",
"@codecademy/webpack-config": "^6.0.0",
"@codecademy/webpack-config": "6.4.2",
"@emotion/babel-plugin": "^11.3.0",
"@emotion/jest": "^11.3.0",
"@emotion/react": "^11.4.0",
Expand All @@ -69,26 +70,25 @@
"@types/react": "^16.9",
"@types/react-dom": "^16.9",
"@types/stylis": "^4.0.0",
"@typescript-eslint/eslint-plugin": "^5.15.0",
"@typescript-eslint/parser": "^5.15.0",
"@typescript-eslint/eslint-plugin": "^8.31.0",
"@typescript-eslint/parser": "^8.31.0",
"babel-jest": "29.6.4",
"babel-plugin-macros": "3.1.0",
"babel-preset-codecademy": "2.3.0",
"babel-preset-codecademy": "7.0.1",
"component-test-setup": "^0.3.1",
"core-js": "3.32.1",
"enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.7",
"enzyme-to-json": "3.6.2",
"eslint": "^8.11.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jest": "^25.2.4",
"eslint": "^8.57.1",
"eslint-plugin-jest": "^28.11.0",
"eslint-plugin-jest-react": "^0.1.0",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-no-only-tests": "^2.6.0",
"eslint-plugin-react": "^7.26.1",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-plugin-unused-imports": "^1.1.5",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-no-only-tests": "^3.3.0",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-unused-imports": "^4.1.4",
"husky": "^8.0.0",
"identity-obj-proxy": "3.0.0",
"jest": "^29.6.4",
Expand All @@ -102,8 +102,10 @@
"react-dom": "16.13.1",
"react-helmet": "6.1.0",
"react-test-renderer": "18.2.0",
"semver": "7.7.1",
"syncpack": "^14.0.0-alpha.10",
"turbo": "^1.1.2",
"typescript": "4.4.2"
"typescript": "5.8.3"
},
"packageManager": "yarn@1.22.10"
}
4 changes: 2 additions & 2 deletions packages/babel-preset-codecademy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"babel-plugin-transform-dynamic-import": "^2.1.0"
},
"devDependencies": {
"@babel/cli": "^7.13.10",
"@babel/core": "^7.19.6"
"@babel/cli": "7.13.10",
"@babel/core": "7.19.6"
}
}
22 changes: 16 additions & 6 deletions packages/eslint-config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ module.exports = {
'plugin:jsx-a11y/strict',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'airbnb',
'plugin:@typescript-eslint/recommended',
'prettier',
...localExtends,
Expand All @@ -40,10 +39,6 @@ module.exports = {
'**/__tests__/*',
],
rules: {
'import/no-extraneous-dependencies': [
'error',
{ devDependencies: true },
],
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
Expand All @@ -67,14 +62,26 @@ module.exports = {
},
},
],
'@typescript-eslint/no-unused-vars': [
'error',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
caughtErrors: 'none',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
},
},
],

plugins: [
'import',
'jest',
'jest-react',
'jsx-a11y',
'no-only-tests',
'react',
Expand Down Expand Up @@ -117,6 +124,7 @@ module.exports = {
'@typescript-eslint/no-magic-numbers': 'off',
'@typescript-eslint/no-type-alias': 'off',
'@typescript-eslint/typedef': 'off',
'@typescript-eslint/no-require-imports': 'off',

'arrow-body-style': 'off',
camelcase: 'off',
Expand Down Expand Up @@ -152,6 +160,8 @@ module.exports = {
'prefer-template': 'off',
'default-props-match-prop-types': 'off',
'react/destructuring-assignment': 'off',
'react/display-name': ['off', { ignoreTranspilerName: false }],
'react/forbid-dom-props': ['off', { forbid: [] }],
'react/jsx-filename-extension': 'off',
'react/jsx-no-bind': 'off',
'react/jsx-one-expression-per-line': 'off',
Expand Down
30 changes: 14 additions & 16 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@codecademy/eslint-config",
"version": "8.0.0",
"version": "8.1.1",
"description": "Shared ESLint config for Codecademy",
"main": "index.js",
"bin": {
Expand All @@ -23,24 +23,22 @@
"eslint": "^8.11.0"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^5.15.0",
"@typescript-eslint/parser": "^5.15.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^8.3.0",
"eslint-mdx": "^1.15.0",
"@typescript-eslint/eslint-plugin": "^8.31.0",
"@typescript-eslint/parser": "^8.31.0",
"eslint-config-prettier": "^10.1.2",
"eslint-mdx": "^3.4.1",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jest": "^25.2.4",
"eslint-plugin-jest-react": "^0.1.0",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-no-only-tests": "^2.6.0",
"eslint-plugin-react": "^7.26.1",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-plugin-unused-imports": "^1.1.5",
"yargs": "^17.1.1"
"eslint-plugin-jest": "^28.11.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-no-only-tests": "^3.3.0",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-unused-imports": "^4.1.4",
"yargs": "^17.7.2"
},
"devDependencies": {
"eslint": "^8.11.0"
"eslint": "^8.57.1"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions packages/webpack-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"webpack-dev-server": "^3.1.9"
},
"devDependencies": {
"@babel/core": "7.12.9",
"babel-preset-codecademy": "^2.3.0",
"@babel/core": "7.19.6",
"babel-preset-codecademy": "7.0.1",
"webpack": "^5.88.2"
},
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions packages/webpack-config/src/loaders/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const scssLoaderDefaults = {
loader: 'sass-loader',
options: {
sourceMap: true,
silenceDeprecations: ['import', 'legacy-js-api'],
},
};

Expand Down
Loading