rsnext/packages/next/lib
Shu Ding f055b167a5
Add TypeScript plugin (#41569)
This PR implements the TypeScript plugin (only applied to the app directory), and it will be automatically added to tsconfig.json when running the CLI. Due to how TS plugins work (a package name is required to specify), hence we can't use a subpath import like `next/typescript` for the plugin. To avoid installing a separate dependency, here I propose to reuse the `next` package: if the default export is called with the TypeScript option, we can say it's being used as a plugin. There is also environment variables we can check here, however it's specifically for VS Code (`VSCODE_CLI=1`) where this plugin should be working with other editors too.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-19 20:59:39 +00:00
..
eslint Refactor app dir related flags (#41166) 2022-10-04 22:16:44 +00:00
helpers Add handling for auto installing TypeScript deps and HMRing tsconfig (#39838) 2022-08-23 13:16:47 -05:00
typescript Add TypeScript plugin (#41569) 2022-10-19 20:59:39 +00:00
web Implement web server as the request handler for edge SSR (#33635) 2022-01-26 06:22:11 +00:00
chalk.ts Add process env NEXT_RUNTIME (#36383) 2022-04-26 17:54:28 +00:00
coalesced-function.ts Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
commands.ts fix(next): dev server starting when importing a file using get-projec… (#38274) 2022-08-07 17:31:30 +00:00
compile-error.ts Adds ESLint with default rule-set (#23702) 2021-04-30 11:09:07 +00:00
constants.ts Remove edge shared deps (#41413) 2022-10-14 06:08:48 -07:00
detect-typo.ts Add CLI command typo detection (#34836) 2022-02-26 07:05:26 -08:00
download-wasm-swc.ts feat(next/swc): enable wasm first binding load for the platforms (#38883) 2022-08-23 14:59:13 -05:00
fatal-error.ts Adds ESLint with default rule-set (#23702) 2021-04-30 11:09:07 +00:00
file-exists.ts upgrade to typescript 4.4.3 (#29112) 2021-09-16 18:06:57 +02:00
find-config.ts Support postcss.config.cjs (#38486) 2022-07-18 14:34:29 -05:00
find-pages-dir.ts fix(41456): check src/app folder too in getHasAppDir (#41458) 2022-10-17 15:32:44 -07:00
flat-readdir.ts fix(#37106): middleware can not be loaded from src folder (#37428) 2022-06-08 14:10:05 +00:00
get-package-version.ts Small code improvements (#37227) 2022-05-26 23:19:47 +00:00
get-project-dir.ts fix(next): dev server starting when importing a file using get-projec… (#38274) 2022-08-07 17:31:30 +00:00
has-necessary-dependencies.ts Add handling for auto installing TypeScript deps and HMRing tsconfig (#39838) 2022-08-23 13:16:47 -05:00
import-next-warning.ts Add warning when importing "next" directly (#35884) 2022-04-05 10:57:45 -05:00
install-dependencies.ts Detect pnpm correctly when installing missing dependencies (#37813) 2022-06-19 12:33:23 +00:00
interop-default.ts Add new target for middleware (#30299) 2021-10-26 18:50:56 +02:00
is-error.ts fix: fixes #33314 move is-plain-object for es5 compilation (#33690) 2022-01-27 17:59:42 +00:00
is-serializable-props.ts Enable @typescript-eslint/no-use-before-define variables,enums,typedefs for core files (#39511) 2022-08-11 16:32:52 -05:00
load-custom-routes.ts Apply experimental configs for middleware (#41142) 2022-10-04 10:08:17 -07:00
non-nullable.ts temporary: re-flag font optimization (#20372) 2020-12-21 19:26:00 +00:00
oxford-comma-list.ts refactor(typescript): extract preflight functions (#13510) 2020-05-28 23:39:46 +00:00
patch-incorrect-lockfile.ts Enable @typescript-eslint/no-use-before-define for functions (#39602) 2022-08-15 10:29:51 -04:00
pick.ts [middleware] Support any method when fetching a Request instance (#37540) 2022-06-08 11:00:49 +00:00
pretty-bytes.ts Move syntax formatting to prettier (#7454) 2019-05-29 13:57:26 +02:00
recursive-copy.ts Add initial standalone build handling (#31003) 2021-11-09 11:03:20 -06:00
recursive-delete.ts Fix various Trusted Types violations without use of policy (#34726) 2022-05-05 00:11:36 +00:00
recursive-readdir.ts Remove extraneous fs.stat calls (#27779) 2021-08-09 15:28:00 +00:00
redirect-status.ts Extract redirect utils into a separate file (#39433) 2022-08-09 14:34:25 -05:00
resolve-from.ts Add handling for auto installing TypeScript deps and HMRing tsconfig (#39838) 2022-08-23 13:16:47 -05:00
try-to-parse-path.ts Enable @typescript-eslint/no-use-before-define for functions (#39602) 2022-08-15 10:29:51 -04:00
verify-partytown-setup.ts Detect pnpm correctly when installing missing dependencies (#37813) 2022-06-19 12:33:23 +00:00
verifyAndLint.ts Refactor app dir related flags (#41166) 2022-10-04 22:16:44 +00:00
verifyTypeScriptSetup.ts Add TypeScript plugin (#41569) 2022-10-19 20:59:39 +00:00
with-promise-cache.ts Extract and refactor getPageStaticInfo (#37062) 2022-05-20 14:24:00 +02:00
worker.ts Ensure workers are not left open (#34503) 2022-02-18 09:12:56 +00:00