Skip to content

Commit

Permalink
fix: getting rid of d.ts linting errors, exporting properly
Browse files Browse the repository at this point in the history
At least I think this exports it properly; seems to work in apps!
  • Loading branch information
davidjoy committed Jul 31, 2024
1 parent aa60bd2 commit dbb1aa4
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 124 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = createConfig('eslint', {
'test-app',
'docs',
'.eslintrc.js',
'frontend-base.d.ts',
],
parserOptions: {
project: path.resolve(__dirname, './tsconfig.json'),
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cat_docs_command = cat ./docs/_API-header.md ./docs/_API-body.md > ./docs/API.md
build:
rm -rf ./dist
tsc
cp index.d.ts dist/index.d.ts
cp frontend-base.d.ts dist/frontend-base.d.ts
mkdir -p ./scss/header/studio-header

cp shell/index.scss dist/shell/index.scss
Expand Down
12 changes: 12 additions & 0 deletions frontend-base.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/// <reference types="./index.d.ts" />

import { OpenedXConfig } from "./dist";

declare module 'env.config' {
export default OpenedXConfig;
}

declare module '*.svg' {
const content: string;
export default content;
}
119 changes: 0 additions & 119 deletions index.d.ts

This file was deleted.

9 changes: 9 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,12 @@ export {
useAppEvent,
useIntl
} from './runtime';

export interface OpenedXConfig {
/**
* The application content for the shell. This is a temporary configuration option while we
* convert micro-frontends to plugins. It must be a React functional component that takes no
* arguments and returns JSX.
*/
app?: () => JSX.Element
}
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"types": "dist/frontend-base.d.ts",
"files": [
"/dist",
"/config",
Expand All @@ -21,7 +21,6 @@
},
"scripts": {
"build": "make build",
"build:watch": "tsc --watch",
"clean": "rm -rf dist",
"docs": "jsdoc -c jsdoc.json",
"docs:watch": "nodemon -w runtime -w docs/template -w README.md -e js,jsx,ts,tsx --exec npm run docs",
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"rootDir": ".",
"outDir": "dist",
"noEmit": false,
"declaration": false,
"declaration": true,
},
"include": [
"bin/**/*",
Expand All @@ -13,7 +13,6 @@
"runtime/**/*",
"shell/**/*",
"index.ts",
"index.d.ts",
"jest.config.js",
"babel.config.js",
],
Expand Down

0 comments on commit dbb1aa4

Please sign in to comment.