-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
fengtianze
committed
Mar 9, 2021
1 parent
ce1ec32
commit 6e75972
Showing
19 changed files
with
1,904 additions
and
2,119 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* https://github.com/TypeStrong/ts-loader/issues/653 | ||
*/ | ||
const escapeStringForRegExp = string => | ||
string.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&'); | ||
|
||
module.exports = class IgnoreNotFoundExportPlugin { | ||
constructor(exportsToIgnore) { | ||
this.exportsToIgnore = exportsToIgnore || []; | ||
} | ||
|
||
getMessageRegExp() { | ||
if (this.exportsToIgnore.length > 0) { | ||
const exportsPattern = | ||
'(' + this.exportsToIgnore.map(escapeStringForRegExp).join('|') + ')'; | ||
|
||
return new RegExp( | ||
`export '${exportsPattern}'( \\(reexported as '.*'\\))? was not found in`, | ||
); | ||
} else { | ||
return /export '.*'( \(reexported as '.*'\))? was not found in/; | ||
} | ||
} | ||
|
||
apply(compiler) { | ||
const messageRegExp = this.getMessageRegExp(); | ||
|
||
const doneHook = stats => { | ||
stats.compilation.warnings = stats.compilation.warnings.filter(warn => { | ||
if ( | ||
warn.constructor.name === 'ModuleDependencyWarning' && | ||
messageRegExp.test(warn.message) | ||
) { | ||
return false; | ||
} | ||
return true; | ||
}); | ||
}; | ||
|
||
if (compiler.hooks) { | ||
compiler.hooks.done.tap('IgnoreNotFoundExportPlugin', doneHook); | ||
} else { | ||
compiler.plugin('done', doneHook); | ||
} | ||
} | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require('!style-loader!css-loader!sass-loader!./global.scss'); | ||
|
||
const { addons } = require('@storybook/addons'); | ||
|
||
const channel = addons.getChannel(); | ||
|
||
channel.addListener('DARK_MODE', isDark => { | ||
document | ||
.querySelector('html') | ||
.setAttribute('aui-color-mode', isDark ? 'dark' : 'light'); | ||
}); |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,11 @@ | ||
{ | ||
"extends": "../tsconfig", | ||
"compilerOptions": { | ||
"baseUrl": "../", | ||
"paths": { | ||
"@alauda/ui": ["./src/public-api"] | ||
} | ||
}, | ||
"include": ["../src/**/*", "../stories/**/*"], | ||
"exclude": ["../src/**/*.spec.ts"] | ||
} |
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.