From 1ddc9f64aae6fc081a4475257fff63067c000920 Mon Sep 17 00:00:00 2001 From: liujiayii Date: Thu, 14 Nov 2024 17:37:51 +0800 Subject: [PATCH 1/2] feat: fix test ci --- src/core/context.ts | 2 +- src/core/initVirualPackage.ts | 2 +- test/files.spec.ts | 4 ++-- test/generate.spec.ts | 2 +- test/options.spec.ts | 2 +- test/parser.spec.ts | 4 ++-- test/utils.spec.ts | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/core/context.ts b/src/core/context.ts index d89347b..24501cb 100644 --- a/src/core/context.ts +++ b/src/core/context.ts @@ -135,7 +135,7 @@ export class PageContext { const fullPath = path.join(process.cwd(), 'node_modules', '~unplugin-convention-routes') // console.log('writeFile', fullPath, existsSync(fullPath)) if (!existsSync(fullPath)) { - // console.log('create dir', fullPath) + // console.log('create dir', fullPath) initVirtualPackage() // mkdirSync(fullPath, { recursive: true }) } diff --git a/src/core/initVirualPackage.ts b/src/core/initVirualPackage.ts index b9209a1..8252e53 100644 --- a/src/core/initVirualPackage.ts +++ b/src/core/initVirualPackage.ts @@ -3,7 +3,7 @@ import path from 'node:path' import process from 'node:process' export function initVirtualPackage(): void { - copyFile('node_modules/unplugin-convention-routes/virtual-package', 'node_modules/.unplugin-convention-routes') + copyFile('node_modules/unplugin-convention-routes/virtual-package', 'node_modules/~unplugin-convention-routes') } /** diff --git a/test/files.spec.ts b/test/files.spec.ts index 1ca1f30..2b2a054 100644 --- a/test/files.spec.ts +++ b/test/files.spec.ts @@ -1,6 +1,6 @@ import { join } from 'node:path' -import { getPageDirs, getPageFiles } from '../src/files' -import { resolveOptions } from '../src/options' +import { getPageDirs, getPageFiles } from '../src/core/files' +import { resolveOptions } from '../src/core/options' const options = resolveOptions({}, process.cwd()) const testpages = 'examples/vue/src/pages' diff --git a/test/generate.spec.ts b/test/generate.spec.ts index b3c5e35..adfdaa3 100644 --- a/test/generate.spec.ts +++ b/test/generate.spec.ts @@ -1,6 +1,6 @@ import { slash } from '@antfu/utils' -import { PageContext } from '../src/context' +import { PageContext } from '../src/core/context' const sensitivity = process.platform === 'win32' ? 'base' : 'variant' diff --git a/test/options.spec.ts b/test/options.spec.ts index d0f62cc..1e66f8c 100644 --- a/test/options.spec.ts +++ b/test/options.spec.ts @@ -1,4 +1,4 @@ -import { resolveOptions } from '../src/options' +import { resolveOptions } from '../src/core/options' describe('options resolve', () => { it('vue', () => { diff --git a/test/parser.spec.ts b/test/parser.spec.ts index be046fd..dc8c075 100644 --- a/test/parser.spec.ts +++ b/test/parser.spec.ts @@ -1,6 +1,6 @@ import { resolve } from 'node:path' -import { getRouteBlock } from '../src/customBlock' -import { resolveOptions } from '../src/options' +import { getRouteBlock } from '../src/core/customBlock' +import { resolveOptions } from '../src/core/options' const options = resolveOptions({}) diff --git a/test/utils.spec.ts b/test/utils.spec.ts index 99487f6..588afc7 100644 --- a/test/utils.spec.ts +++ b/test/utils.spec.ts @@ -1,4 +1,4 @@ -import { buildReactRemixRoutePath, buildReactRoutePath, countSlash, extsToGlob, isCatchAllRoute, isDynamicRoute } from '../src/utils' +import { buildReactRemixRoutePath, buildReactRoutePath, countSlash, extsToGlob, isCatchAllRoute, isDynamicRoute } from '../src/core/utils' describe('utils', () => { it('extensions to glob', () => { From 6a7f676724d76be8f8a64babccd199bd61eb7155 Mon Sep 17 00:00:00 2001 From: liujiayii Date: Thu, 14 Nov 2024 17:38:26 +0800 Subject: [PATCH 2/2] release: 0.0.1-alpha.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2c346ec..dc2146b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "unplugin-convention-routes", "type": "module", - "version": "0.0.1-alpha.1", + "version": "0.0.1-alpha.2", "packageManager": "pnpm@9.12.3", "description": "File system base router plugin for unplugin", "author": "liujiayii@foxmail.com",