-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add metadata for generating react components * New react components * First partial fix * Prettify * Improve typing * Simplify component types * Fix reference to custom element * Package custom elements definitions * Keep event naming * Build dynamically custom-element def * Remove dist file exception * Restore datefield react component * Lint the code --------- Co-authored-by: Frédéric Collonval <[email protected]>
- Loading branch information
1 parent
68d98ff
commit 7b55d5f
Showing
199 changed files
with
5,924 additions
and
1,485 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,5 @@ npm-debug.log* | |
yarn-debug.log* | ||
yarn-error.log* | ||
tests-out/ | ||
|
||
!packages/react-components/lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* global process */ | ||
import { customElementReactWrapperPlugin } from 'custom-element-react-wrappers'; | ||
|
||
/** | ||
* Custom element manifest plugin to remove the | ||
* Jupyter prefix in the element class name to | ||
* get a better naming for the generated react components. | ||
*/ | ||
function renameClassElement() { | ||
return { | ||
name: 'rename-class-element-plugin', | ||
packageLinkPhase({ customElementsManifest, context }) { | ||
customElementsManifest.modules.forEach(module => { | ||
module.declarations.forEach(declaration => { | ||
// Remove the prefix `Jupyter` for simpler naming | ||
if (declaration.tagName && declaration.name.startsWith('Jupyter')) { | ||
declaration.name = declaration.name.slice(7); | ||
} | ||
}); | ||
}); | ||
} | ||
}; | ||
} | ||
|
||
const plugins = [renameClassElement()]; | ||
|
||
if (process.env.BUILD_REACT) { | ||
plugins.push( | ||
customElementReactWrapperPlugin({ | ||
outdir: '../react-components/lib', | ||
modulePath: (className, tagName) => '@jupyter/web-components' | ||
}) | ||
); | ||
} | ||
|
||
export default { | ||
fast: true, | ||
outdir: 'dist', | ||
dependencies: true, | ||
globs: ['src/**/index.ts'], | ||
exclude: ['src/index.ts', 'src/styles', 'src/utilities'], | ||
plugins | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.