Skip to content

Commit

Permalink
Bump raw-loader from 1.0.0 to 3.1.0 (#63)
Browse files Browse the repository at this point in the history
Bumps [raw-loader](https://github.com/webpack-contrib/raw-loader) from 1.0.0 to 3.1.0.
- [Release notes](https://github.com/webpack-contrib/raw-loader/releases)
- [Changelog](https://github.com/webpack-contrib/raw-loader/blob/master/CHANGELOG.md)
- [Commits](webpack-contrib/raw-loader@v1.0.0...v3.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
  • Loading branch information
dependabot-preview[bot] authored and eps1lon committed Jul 22, 2019
1 parent 88e61f3 commit d7b1b9e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"next": "^9.0.2",
"notistack": "^0.8.6",
"postcss": "^7.0.0",
"raw-loader": "^1.0.0",
"raw-loader": "^3.1.0",
"react-autosuggest": "^9.4.3",
"react-docgen": "^5.0.0-beta.1",
"react-dom": "^16.8.5",
Expand Down
8 changes: 4 additions & 4 deletions docs/src/modules/components/MarkdownDocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,25 +127,25 @@ function MarkdownDocs(props) {
const match = filename.match(/-([a-z]{2})\.md$/);

if (match && LANGUAGES_IN_PROGRESS.indexOf(match[1]) !== -1) {
markdowns[match[1]] = req(filename);
markdowns[match[1]] = req(filename).default;
} else {
markdowns.en = req(filename);
markdowns.en = req(filename).default;
}
} else if (filename.indexOf('.tsx') !== -1) {
const demoName = `${reqPrefix}/${filename.replace(/\.\//g, '').replace(/\.tsx/g, '.js')}`;

demos[demoName] = {
...demos[demoName],
tsx: req(filename).default,
rawTS: reqSource(filename),
rawTS: reqSource(filename).default,
};
} else {
const demoName = `${reqPrefix}/${filename.replace(/\.\//g, '')}`;

demos[demoName] = {
...demos[demoName],
js: req(filename).default,
raw: reqSource(filename),
raw: reqSource(filename).default,
};
}
});
Expand Down
13 changes: 11 additions & 2 deletions docs/src/modules/utils/mapTranslations.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
export default function mapTranslations(req, ext) {
const translations = {};
function load(filename) {
// .md is required by raw-loader which uses ES6 modules
// .json is required with default require semantics which use commonJS
const esModuleRequire = ext === 'md';
if (esModuleRequire) {
return req(filename).default;
}
return req(filename);
}
req.keys().forEach(filename => {
const match = filename.match(new RegExp(`-([a-z]{2}).${ext}$`));

if (match) {
translations[match[1]] = req(filename);
translations[match[1]] = load(filename);
} else {
translations.en = req(filename);
translations.en = load(filename);
}
});
return translations;
Expand Down
18 changes: 13 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11296,13 +11296,13 @@ raw-body@2.4.0:
iconv-lite "0.4.24"
unpipe "1.0.0"

raw-loader@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-1.0.0.tgz#3f9889e73dadbda9a424bce79809b4133ad46405"
integrity sha512-Uqy5AqELpytJTRxYT4fhltcKPj0TyaEpzJDcGz7DFJi+pQOOi3GjR/DOdxTkTsF+NzhnldIoG6TORaBlInUuqA==
raw-loader@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-3.1.0.tgz#5e9d399a5a222cc0de18f42c3bc5e49677532b3f"
integrity sha512-lzUVMuJ06HF4rYveaz9Tv0WRlUMxJ0Y1hgSkkgg+50iEdaI0TthyEDe08KIHb0XsF6rn8WYTqPCaGTZg3sX+qA==
dependencies:
loader-utils "^1.1.0"
schema-utils "^1.0.0"
schema-utils "^2.0.1"

rc@^1.0.1, rc@^1.1.6, rc@^1.2.7:
version "1.2.8"
Expand Down Expand Up @@ -12388,6 +12388,14 @@ schema-utils@^1.0.0:
ajv-errors "^1.0.0"
ajv-keywords "^3.1.0"

schema-utils@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.0.1.tgz#1eec2e059556af841b7f3a83b61af13d7a3f9196"
integrity sha512-HJFKJ4JixDpRur06QHwi8uu2kZbng318ahWEKgBjc0ZklcE4FDvmm2wghb448q0IRaABxIESt8vqPFvwgMB80A==
dependencies:
ajv "^6.1.0"
ajv-keywords "^3.1.0"

section-iterator@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/section-iterator/-/section-iterator-2.0.0.tgz#bf444d7afeeb94ad43c39ad2fb26151627ccba2a"
Expand Down

0 comments on commit d7b1b9e

Please sign in to comment.