Skip to content

Commit a849092

Browse files
init monorepo and refactor navigation to extensions (opendatahub-io#4138)
* init monorepo and refactor navigation to extensions * rename pathMatch to path and update doc * add const for ADMIN_USER flag and remove commented code * remove commented code from webpack.common.js
1 parent 6c753c6 commit a849092

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1497
-835
lines changed

frontend/.eslintrc

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,6 @@
210210
"pattern": "@mf/**",
211211
"group": "external",
212212
"position": "after"
213-
},
214-
{
215-
"pattern": "~/**",
216-
"group": "internal",
217-
"position": "before"
218213
}
219214
],
220215
"pathGroupsExcludedImportTypes": ["builtin"],
@@ -249,7 +244,11 @@
249244
"error",
250245
{
251246
"devDependencies": true,
252-
"optionalDependencies": true
247+
"optionalDependencies": true,
248+
"packageDir": [
249+
".",
250+
"./packages"
251+
]
253252
}
254253
],
255254
"no-relative-import-paths/no-relative-import-paths": [
@@ -416,19 +415,19 @@
416415
}
417416
]
418417
}
419-
// },
420-
// {
421-
// "files": ["src/plugins/extensions.ts"],
422-
// "rules": {
423-
// "@typescript-eslint/consistent-type-imports": "error",
424-
// "no-restricted-syntax": [
425-
// "error",
426-
// {
427-
// "selector":"ImportDeclaration[importKind!='type']",
428-
// "message": "Must use 'import type' when importing. Use dynamic imports for code references (eg. `() => import('~/Test')`)."
429-
// }
430-
// ]
431-
// }
418+
},
419+
{
420+
"files": ["src/plugins/extensions/**"],
421+
"rules": {
422+
"@typescript-eslint/consistent-type-imports": "error",
423+
"no-restricted-syntax": [
424+
"error",
425+
{
426+
"selector":"ImportDeclaration[importKind!='type']",
427+
"message": "Must use 'import type' when importing. Use dynamic imports for code references (eg. `() => import('~/Test')`)."
428+
}
429+
]
430+
}
432431
}
433432
]
434433
}

frontend/config/dotenv.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ const setupDotenvFilesForEnv = ({ env }) => {
140140
const IMAGES_DIRNAME = process.env.ODH_IMAGES_DIRNAME || 'images';
141141
const PUBLIC_PATH = process.env.ODH_PUBLIC_PATH || '/';
142142
const SRC_DIR = path.resolve(RELATIVE_DIRNAME, process.env.ODH_SRC_DIR || TS_BASE_URL || 'src');
143-
const COMMON_DIR = path.resolve(RELATIVE_DIRNAME, process.env.ODH_COMMON_DIR || '../common');
143+
const COMMON_DIR = path.resolve(RELATIVE_DIRNAME, process.env.ODH_COMMON_DIR || 'packages');
144144
const DIST_DIR = path.resolve(RELATIVE_DIRNAME, process.env.ODH_DIST_DIR || TS_OUT_DIR || 'public');
145145
const HOST = process.env.ODH_HOST || 'localhost';
146146
const PORT = process.env.ODH_PORT || '3000';

frontend/config/webpack.common.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ module.exports = (env) => {
177177
filename: '[name].bundle.js',
178178
path: DIST_DIR,
179179
publicPath: PUBLIC_PATH,
180+
chunkFilename: '[name]-[chunkhash].js',
180181
},
181182
plugins: [
182183
...setupWebpackDotenvFilesForEnv({
@@ -237,7 +238,7 @@ module.exports = (env) => {
237238
alias: {
238239
'~': path.resolve(SRC_DIR),
239240
},
240-
symlinks: false,
241+
symlinks: true,
241242
cacheWithContext: false,
242243
},
243244
};

frontend/jest.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// https://jestjs.io/docs/en/configuration.html
33

44
module.exports = {
5-
roots: ['<rootDir>/src/'],
5+
roots: ['<rootDir>'],
66
testMatch: [
77
'**/src/__tests__/unit/**/?(*.)+(spec|test).ts?(x)',
88
'**/__tests__/?(*.)+(spec|test).ts?(x)',
@@ -12,7 +12,7 @@ module.exports = {
1212
clearMocks: true,
1313

1414
// An array of directory names to be searched recursively up from the requiring module's location
15-
moduleDirectories: ['node_modules', '<rootDir>/src'],
15+
moduleDirectories: ['node_modules', '<rootDir>/src', '<rootDir>/packages'],
1616

1717
// A map from regular expressions to module names that allow to stub out resources with a single module
1818
moduleNameMapper: {
@@ -40,6 +40,7 @@ module.exports = {
4040

4141
collectCoverageFrom: [
4242
'<rootDir>/src/**/*.{ts,tsx}',
43+
'<rootDir>/packages/**/src/**/*.{ts,tsx}',
4344
'!<rootDir>/src/third_party/**',
4445
'!<rootDir>/src/__tests__/**',
4546
'!<rootDir>/src/__mocks__/**',

0 commit comments

Comments
 (0)