forked from shadowwalker/next-pwa
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(core): use .swcrc instead of Next's webpack.config.resolve f…
…or path aliases
- Loading branch information
Showing
23 changed files
with
1,062 additions
and
630 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,5 @@ | ||
--- | ||
"@ducanh2912/next-pwa": patch | ||
--- | ||
|
||
refactor(core): use .swcrc instead of Next's webpack.config.resolve for path aliases |
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,3 @@ | ||
{ | ||
"typescript.tsdk": "node_modules\\typescript\\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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// @ts-check | ||
import fg from "fast-glob"; | ||
import ncu from "npm-check-updates"; | ||
|
||
/** | ||
* @type {import("npm-check-updates").default} | ||
*/ | ||
// @ts-expect-error Wrong type provided by npm-check-updates. | ||
const run = ncu.run; | ||
|
||
/** | ||
* Update and then log updated dependencies. | ||
* | ||
* @param {import("npm-check-updates").RunOptions} runOptions | ||
*/ | ||
const updateAndLog = async (runOptions) => { | ||
const upgraded = await run(runOptions); | ||
console.log( | ||
`Upgraded dependencies for ${runOptions.packageFile ?? "./package.json"}:`, | ||
upgraded | ||
); | ||
}; | ||
|
||
await Promise.all([ | ||
( | ||
await fg("./**/package.json", { | ||
ignore: ["examples/**", "**/node_modules/**"], | ||
}) | ||
).map( | ||
async (packageFile) => | ||
await updateAndLog({ | ||
packageFile, | ||
upgrade: true, | ||
target: (dependencyName) => { | ||
if (dependencyName === "typescript") { | ||
return "@next"; | ||
} | ||
if (/^react(-dom)?$/.test(dependencyName)) { | ||
return "@latest"; | ||
} | ||
return "latest"; | ||
}, | ||
}) | ||
), | ||
await updateAndLog({ | ||
packageFile: "examples/*/package.json", | ||
upgrade: true, | ||
}), | ||
]); |
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.