Skip to content

Commit

Permalink
v1 (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
tatethurston authored Nov 11, 2022
1 parent d09ebd1 commit 38da772
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 31 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.0.0

- This library will now follow [semantic versioning](https://docs.npmjs.com/about-semantic-versioning).

- The previously deprecated direct invocation of nextjs-routes via `npx nextjs-routes` has been removed 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.1.7

- Support [Next 13 app (beta) directory](https://nextjs.org/docs/advanced-features/custom-app)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"examples:setup": "npm run examples:each --command='npm install'",
"lint": "npm run typecheck && prettier --check . && prettier-package-json --list-different '{,public.,example/}package.json' && eslint .",
"lint:fix": "prettier --write '**/*.{ts,cts,mts,tsx,md,json}' && prettier-package-json --write '{,public.,example/}package.json' && eslint --fix .",
"package:build": "npm install && npm run clean && npm run build:module && npm run build:commonjs && npm run package:prune && npm run package:copy:files && chmod +x dist/cli.js",
"package:build": "npm install && npm run clean && npm run build:module && npm run build:commonjs && npm run package:prune && npm run package:copy:files",
"package:copy:files": "cp ./LICENSE ./README.md dist/ && cp ./public.package.json dist/package.json",
"package:prune": "find dist -name *.test.* | xargs rm -f",
"prepare": "husky install",
Expand Down
6 changes: 2 additions & 4 deletions public.package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nextjs-routes",
"version": "0.1.7",
"version": "1.0.0",
"description": "Type safe routing for Next.js",
"license": "MIT",
"author": "Tate <[email protected]>",
Expand All @@ -17,9 +17,6 @@
"require": "./config.cjs"
}
},
"bin": {
"nextjs-routes": "cli.js"
},
"sideEffects": false,
"types": "index.d.ts",
"dependencies": {
Expand All @@ -33,6 +30,7 @@
"next",
"nextjs",
"route",
"routing",
"type safe",
"typescript"
]
Expand Down
5 changes: 0 additions & 5 deletions src/cli.ts

This file was deleted.

21 changes: 0 additions & 21 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,24 +372,3 @@ export function writeNextjsRoutes(options: NextJSRoutesOptions): void {
const generated = generate(routes, opts);
writeFileSync(outputFilepath, generated);
}

export function cli(): void {
console.warn(
`[nextjs-routes]: Direct invocation of nextjs-routes has been deprecated in favor of automatic regeneration via 'withRoutes': https://github.com/tatethurston/nextjs-routes#installation--usage-. See https://github.com/tatethurston/nextjs-routes/issues/63 for the motivation behind this change or to voice any concerns.`
);
const dirs = [
getPagesDirectory(process.cwd()),
getAppDirectory(process.cwd()),
].filter((x) => x != undefined);
if (dirs.length === 0) {
logger.error(`Could not find a Next.js pages directory. Expected to find either 'pages' (1), 'src/pages' (2), or 'app' (3) in your project root.
1. https://nextjs.org/docs/basic-features/pages
2. https://nextjs.org/docs/advanced-features/src-directory
3. https://nextjs.org/blog/next-13#app-directory-beta
`);
process.exit(1);
} else {
writeNextjsRoutes({});
}
}

0 comments on commit 38da772

Please sign in to comment.