Skip to content

Commit

Permalink
deprecate direct invocation via cli (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
tatethurston authored Sep 23, 2022
1 parent 5f0477f commit 6781d0d
Show file tree
Hide file tree
Showing 26 changed files with 828 additions and 550 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ dist
coverage
node_modules
tsconfig.tsbuildinfo
.next
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.0.22

- Deprecate direct invocation of nextjs-routes in favor of automatic regeneration via [withRoutes](https://github.com/tatethurston/nextjs-routes#installation--usage-). See [#63](https://github.com/tatethurston/nextjs-routes/issues/63) for the motivation behind this change or to voice any concerns.

## 0.0.21

- Add `route` runtime for generating type safe pathnames from a `Route` object
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ A code generation tool to make `next/link` and `next/router` routes type safe wi
+ module.exports = withRoutes(nextConfig);
```

This wiring will only run in Next.js' development server (eg `npx next dev`) and `withRoutes` will no-op in production.
File watching will only run in Next.js' development server (eg `npx next dev`).

3. Start your next server:

Expand Down
2 changes: 1 addition & 1 deletion e2e/e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function run(cmd: string) {
describe("e2e", () => {
process.chdir(__dirname);

it.each(["npx nextjs-routes", "yarn tsc --noEmit"])("%s", (cmd) => {
it.each(["npx next build", "yarn tsc --noEmit"])("%s", (cmd) => {
const result = run(cmd);
if (result.status !== 0) {
console.log(result.output);
Expand Down
5 changes: 5 additions & 0 deletions e2e/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
254 changes: 253 additions & 1 deletion e2e/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion e2e/pages/foos/[foo].ts

This file was deleted.

1 change: 1 addition & 0 deletions e2e/pages/foos/[foo].tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default () => <div>Foo</div>;
1 change: 0 additions & 1 deletion e2e/pages/index.ts

This file was deleted.

1 change: 1 addition & 0 deletions e2e/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default () => <div>Index</div>;
2 changes: 1 addition & 1 deletion examples/src-pages/nextjs-routes.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
// Run `npx nextjs-routes` to regenerate this file.
// This file will be automatically regenerated when your Next.js server is running.
/* eslint-disable */

// prettier-ignore
Expand Down
Loading

0 comments on commit 6781d0d

Please sign in to comment.