diff --git a/README.md b/README.md index b629f97..0d98824 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ "dev": "run-p dev:*", "dev:next": "next dev", "dev:path": "pathpida --watch", - "build:path": "pathpida" + "build": "pathpida && next build" } } ``` @@ -174,7 +174,7 @@ export default () => { "dev": "run-p dev:*", "dev:next": "next dev", "dev:path": "pathpida --enableStatic --watch", - "build:path": "pathpida --enableStatic" + "build": "pathpida --enableStatic && next build" } } ``` @@ -233,7 +233,7 @@ export default () => { "dev": "run-p dev:*", "dev:nuxt": "nuxt-ts", "dev:path": "pathpida --watch", - "build:path": "pathpida" + "build": "pathpida && nuxt-ts build" } } ``` @@ -357,7 +357,7 @@ export default Vue.extend({ "dev": "run-p dev:*", "dev:nuxt": "nuxt-ts", "dev:path": "pathpida --enableStatic --watch", - "build:path": "pathpida --enableStatic" + "build": "pathpida --enableStatic && nuxt-ts build" } } ``` diff --git a/projects/nextjs-src/src/pages/aaa/api/samples.ts b/projects/nextjs-src/src/pages/aaa/api/samples.ts new file mode 100644 index 0000000..e69de29 diff --git a/projects/nextjs-src/src/pages/api/users.ts b/projects/nextjs-src/src/pages/api/users.ts new file mode 100644 index 0000000..e69de29 diff --git a/projects/nextjs-src/src/utils/$path.ts b/projects/nextjs-src/src/utils/$path.ts index 6d13c3d..ffbbcbf 100644 --- a/projects/nextjs-src/src/utils/$path.ts +++ b/projects/nextjs-src/src/utils/$path.ts @@ -12,7 +12,12 @@ export const pagesPath = { ccc: { $url: (url?: { hash?: string }) => ({ pathname: '/aaa/[...bbb]/ccc' as const, query: { bbb }, hash: url?.hash }) } - }) + }), + api: { + samples: { + $url: (url?: { hash?: string }) => ({ pathname: '/aaa/api/samples' as const, hash: url?.hash }) + } + } }, blog: { _slug: (slug: string[]) => ({ diff --git a/projects/nextjs/lib/$path.ts b/projects/nextjs/lib/$path.ts index 6d13c3d..ffbbcbf 100644 --- a/projects/nextjs/lib/$path.ts +++ b/projects/nextjs/lib/$path.ts @@ -12,7 +12,12 @@ export const pagesPath = { ccc: { $url: (url?: { hash?: string }) => ({ pathname: '/aaa/[...bbb]/ccc' as const, query: { bbb }, hash: url?.hash }) } - }) + }), + api: { + samples: { + $url: (url?: { hash?: string }) => ({ pathname: '/aaa/api/samples' as const, hash: url?.hash }) + } + } }, blog: { _slug: (slug: string[]) => ({ diff --git a/projects/nextjs/pages/aaa/api/samples.ts b/projects/nextjs/pages/aaa/api/samples.ts new file mode 100644 index 0000000..e69de29 diff --git a/projects/nextjs/pages/api/users.ts b/projects/nextjs/pages/api/users.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/createNextTemplate.ts b/src/createNextTemplate.ts index 5fb7fd1..dd21acd 100644 --- a/src/createNextTemplate.ts +++ b/src/createNextTemplate.ts @@ -53,7 +53,7 @@ export default (input: string) => { indent += ' ' fs.readdirSync(targetDir) - .filter(file => !file.startsWith('_')) + .filter(file => !file.startsWith('_') && `${url}/${file}` !== '/api') .sort() .forEach((file, _, arr) => { const newSlugs = [...slugs]