From bce6f7d95b91cf360bd69104cebd702e7b422244 Mon Sep 17 00:00:00 2001 From: Victor Garcia Date: Mon, 15 Jan 2024 15:28:43 +0100 Subject: [PATCH] try to fix ci tests --- pnpm-lock.yaml | 7 ++++--- src/core/config/moduleOptions.ts | 5 +++++ test/fixtures/sample-project/package.json | 4 +++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 264f179..bc558be 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -170,6 +170,10 @@ importers: version: 3.9.0(@types/node@20.10.6)(eslint@8.56.0)(rollup@3.29.4)(typescript@5.3.3)(vite@5.0.10)(vue-tsc@1.8.27) test/fixtures/sample-project: + dependencies: + nuxt-typed-router: + specifier: workspace:* + version: link:../../.. devDependencies: '@nuxtjs/i18n': specifier: 8.0.0 @@ -177,9 +181,6 @@ importers: nuxt: specifier: 3.9.0 version: 3.9.0(@types/node@20.10.6)(eslint@8.56.0)(rollup@3.29.4)(typescript@5.3.3)(vite@5.0.10)(vue-tsc@1.8.27) - nuxt-typed-router: - specifier: workspace:* - version: link:../../.. vue: specifier: 3.4.5 version: 3.4.5(typescript@5.3.3) diff --git a/src/core/config/moduleOptions.ts b/src/core/config/moduleOptions.ts index 979aab0..71dacc4 100644 --- a/src/core/config/moduleOptions.ts +++ b/src/core/config/moduleOptions.ts @@ -36,7 +36,9 @@ class ModuleOptionsStore { if (options.rootDir != null) this.rootDir = options.rootDir; if (options.srcDir != null) this.srcDir = options.srcDir; if (options.buildDir != null) this.buildDir = options.buildDir; + this.pagesDir = path.join(this.srcDir, 'pages'); + if (options.i18n != null) this.i18n = options.i18n; if (options.i18nOptions != null) { this.i18nOptions = defu(options.i18nOptions, { @@ -72,11 +74,14 @@ class ModuleOptionsStore { this.ignoreRoutes.push('[...slug].vue'); } + // Ignore route related const catchAllRegex = /\[...*].*/; const relativeRoot = path.relative(process.cwd(), this.pagesDir); + const dynamicGlobs = this.ignoreRoutes .filter((f) => isDynamicPattern(f) && !catchAllRegex.test(f)) .map((file) => path.join(relativeRoot, file)); + const normalGlobs = this.ignoreRoutes.filter( (f) => !(isDynamicPattern(f) && !catchAllRegex.test(f)) ); diff --git a/test/fixtures/sample-project/package.json b/test/fixtures/sample-project/package.json index 11d9bbe..8db65b6 100644 --- a/test/fixtures/sample-project/package.json +++ b/test/fixtures/sample-project/package.json @@ -10,10 +10,12 @@ "preview": "nuxt preview", "typecheck": "nuxi typecheck" }, + "dependencies": { + "nuxt-typed-router": "workspace:*" + }, "devDependencies": { "@nuxtjs/i18n": "8.0.0", "nuxt": "3.9.0", - "nuxt-typed-router": "workspace:*", "vue": "3.4.5", "vue-tsc": "1.8.27" }