-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade typescript to ^4.2.0 and fix lint issues (#1156)
* Upgrade typescript to ^4.2.0 and fix lint issues * Upgrade react-scripts to ^4.0.3 * Add craco and set url: false in css-loader * Fix lint issues * Fix part of unit tests * Fix another part of unit tests * Handle ServiceWorker in a new way * Fix ts errors * Fix new lint errors * revert this lint fix due to compilation errors - it should be fixed after updating @opesntax/types * Move also service-worker.js.map to books folder * Fix one more lint error and test * change AnyRoute signature and add assertNonNullableArray util * small fix for test * Do not use any for animationEvent function * update loadFont helper * Update serviceWorker.ts * remove unused workbox plugins * Revert "remove unused workbox plugins" This reverts commit d85a8fd. * Use craco to move service-worker.js to build/books/ * Remove check for process.env.PUBLIC_URL * Default value for process.env.PUBLIC_URL * remove unused workbox plugins * Check if PUBLIC_URL is undefined instead of falsy * requested changes * remove assertNonNullable * Update @openstax/types * Do not use deprecated matchMedia.add/removeListener methods * add global KeyboardEventConstructor * fix lint and tests * smaller fixes * No need to mock navigation state in Home.spec.tsx * Add @babel/plugin-proposal-optional-chaining to babel-config.js * Update node_modules cache * requested changes Co-authored-by: staxly[bot] <35789409+staxly[bot]@users.noreply.github.com> Co-authored-by: jarosik10 <bartosz.jaros96@gmail.com>
- Loading branch information
1 parent
1d06736
commit b577de6
Showing
43 changed files
with
4,456 additions
and
2,571 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
plugins: [{ | ||
plugin: { | ||
// Based on https://github.com/kevinsperrine/craco-workbox/blob/master/lib/index.js | ||
overrideWebpackConfig: ({ webpackConfig, context: { env, paths } }) => { | ||
if (env === "production") { | ||
try { | ||
const workboxConfig = require(path.join( | ||
paths.appPath, | ||
"workbox.config.js" | ||
)); | ||
|
||
webpackConfig.plugins.forEach(plugin => { | ||
if (plugin.constructor.name === "InjectManifest") { | ||
plugin.config = workboxConfig(plugin.config); | ||
} | ||
}); | ||
} catch (error) { | ||
console.log("[craco.config.js - overrideWebpackConfig]"); | ||
console.log(error.stack); | ||
process.exit(1); | ||
} | ||
} | ||
|
||
return webpackConfig; | ||
} | ||
}, | ||
}], | ||
style: { | ||
css: { | ||
loaderOptions: { | ||
// https://github.com/openstax/unified/issues/1469 | ||
url: false, | ||
}, | ||
}, | ||
}, | ||
}; |
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 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
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
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.