Skip to content

Commit 80c581e

Browse files
fix: make things work
* Updates jest and eslint config to adhere to local package aliases. * Formally adopts NPM workspaces. * Deletes node_modules in the `clean` Makefile targets
1 parent 851a12f commit 80c581e

16 files changed

Lines changed: 15055 additions & 86641 deletions

common/extendESLintConfig.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const path = require('path');
2+
3+
const extendESLintConfig = (config) => {
4+
const importNoUnresolved = config.rules['import/no-unresolved'];
5+
if (importNoUnresolved ) {
6+
const originalIgnore = importNoUnresolved[1].ignore;
7+
if (!originalIgnore.includes('@edx/frontend-enterprise-*')) {
8+
importNoUnresolved[1].ignore = [...originalIgnore, '@edx/frontend-enterprise-*'];
9+
}
10+
}
11+
config.settings = {
12+
...config.settings,
13+
'import/resolver': {
14+
alias: [
15+
['@edx/frontend-enterprise-utils', '../utils/src'],
16+
],
17+
},
18+
};
19+
};
20+
21+
module.exports = extendESLintConfig;

common/extendJestConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const extendJestConfig = (config) => {
33
config.modulePathIgnorePatterns = config.modulePathIgnorePatterns ? [...config.modulePathIgnorePatterns, ...modulePathsToIgnore] : modulePathsToIgnore;
44
config.moduleNameMapper = {
55
...config.moduleNameMapper,
6-
"@edx/frontend-enterprise-(.*)": "<rootDir>/../$1/src",
6+
'@edx/frontend-enterprise-(.*)': '<rootDir>/../$1/src',
77
};
88
};
99

package-lock.json

Lines changed: 13073 additions & 7632 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
],
1313
"scripts": {
1414
"setup": "npm install && npm run bootstrap",
15-
"bootstrap": "lerna exec -- npm install",
16-
"dev": "lerna run dev --parallel",
17-
"clean": "rm -rf ./node_modules && lerna run clean && lerna clean --yes",
18-
"build": "lerna run build --parallel",
19-
"test": "lerna run test --parallel",
20-
"lint": "lerna run lint --parallel",
21-
"lint:fix": "lerna run lint:fix --include-dependencies --include-dependents --since origin/master --parallel",
22-
"changed": "lerna changed"
15+
"bootstrap": "npx lerna exec -- npm install",
16+
"dev": "npx lerna run dev --parallel",
17+
"clean": "rm -rf ./node_modules && npx lerna run clean",
18+
"build": "npx lerna run build --parallel",
19+
"test": "npx lerna run test --parallel",
20+
"lint": "npx lerna run lint --parallel",
21+
"lint:fix": "npx lerna run lint:fix --include-dependencies --include-dependents --since origin/master --parallel",
22+
"changed": "npx lerna changed"
2323
},
2424
"devDependencies": {
2525
"@commitlint/config-conventional": "13.2.0",
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const { createConfig } = require('@edx/frontend-build');
2+
const extendESLintConfig = require('../../common/extendESLintConfig');
3+
4+
const config = createConfig('eslint');
5+
extendESLintConfig(config);
6+
7+
module.exports = config;

packages/catalog-search/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
build:
22
make clean
3-
./node_modules/.bin/fedx-scripts babel src --out-dir dist --source-maps --ignore **/*.test.jsx,**/*.test.js,**/setupTest.js --copy-files
3+
../../node_modules/.bin/fedx-scripts babel src --out-dir dist --source-maps --ignore **/*.test.jsx,**/*.test.js,**/setupTest.js --copy-files
44
@# --copy-files will bring in everything else that wasn't processed by babel. Remove what we don't want.
55
@find dist -name '*.test.js*' -delete
66
cp ./package.json ./dist/package.json
@@ -9,4 +9,4 @@ build:
99
cp ./CHANGELOG.md ./dist/CHANGELOG.md
1010

1111
clean:
12-
rm -rf ./dist
12+
rm -rf ./dist ./node_modules

0 commit comments

Comments
 (0)