From 38da77203605dbe788fd123c62ea842305ab9ce1 Mon Sep 17 00:00:00 2001 From: Tate Thurston Date: Fri, 11 Nov 2022 11:01:35 -0800 Subject: [PATCH] v1 (#94) --- CHANGELOG.md | 6 ++++++ package.json | 2 +- public.package.json | 6 ++---- src/cli.ts | 5 ----- src/core.ts | 21 --------------------- 5 files changed, 9 insertions(+), 31 deletions(-) delete mode 100644 src/cli.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c4aa98..d297d04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/package.json b/package.json index 959217e..882b925 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/public.package.json b/public.package.json index 02daa2e..8853e2d 100644 --- a/public.package.json +++ b/public.package.json @@ -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 ", @@ -17,9 +17,6 @@ "require": "./config.cjs" } }, - "bin": { - "nextjs-routes": "cli.js" - }, "sideEffects": false, "types": "index.d.ts", "dependencies": { @@ -33,6 +30,7 @@ "next", "nextjs", "route", + "routing", "type safe", "typescript" ] diff --git a/src/cli.ts b/src/cli.ts deleted file mode 100644 index befa263..0000000 --- a/src/cli.ts +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env node - -import { cli } from "./core.js"; - -cli(); diff --git a/src/core.ts b/src/core.ts index 665f420..9d6a756 100644 --- a/src/core.ts +++ b/src/core.ts @@ -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({}); - } -}