From 0555099619be81aa1844ed5e887fcf850a048247 Mon Sep 17 00:00:00 2001 From: JuanM04 Date: Tue, 29 Mar 2022 23:04:53 -0300 Subject: [PATCH] Removed changes no longer necessary --- packages/astro/package.json | 5 +---- packages/astro/src/@types/astro.ts | 2 -- packages/astro/src/core/config.ts | 2 +- .../astro/src/core/routing/manifest/create.ts | 6 ------ packages/astro/src/integrations/index.ts | 3 --- packages/integrations/vercel/src/index.ts | 8 ++++++++ pnpm-lock.yaml | 17 +---------------- 7 files changed, 11 insertions(+), 32 deletions(-) diff --git a/packages/astro/package.json b/packages/astro/package.json index d475244bb..70d26a3d2 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -103,7 +103,6 @@ "htmlparser2": "^7.2.0", "kleur": "^4.1.4", "magic-string": "^0.25.9", - "micromatch": "^4.0.5", "micromorph": "^0.1.2", "mime": "^3.0.0", "ora": "^6.1.0", @@ -146,7 +145,6 @@ "@types/diff": "^5.0.2", "@types/estree": "^0.0.51", "@types/html-escaper": "^3.0.0", - "@types/micromatch": "^4.0.2", "@types/mime": "^2.0.3", "@types/mocha": "^9.1.0", "@types/parse5": "^6.0.3", @@ -159,8 +157,7 @@ "chai": "^4.3.6", "cheerio": "^1.0.0-rc.10", "mocha": "^9.2.2", - "sass": "^1.49.9", - "type-fest": "^2.12.1" + "sass": "^1.49.9" }, "engines": { "node": "^14.15.0 || >=16.0.0", diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts index 489a5ee38..f3108d390 100644 --- a/packages/astro/src/@types/astro.ts +++ b/packages/astro/src/@types/astro.ts @@ -502,7 +502,6 @@ export interface AstroConfig extends z.output { adapter: AstroAdapter | undefined; renderers: AstroRenderer[]; scripts: { stage: InjectedScriptStage; content: string }[]; - ignoredPages: string[]; }; } @@ -672,7 +671,6 @@ export interface AstroIntegration { updateConfig: (newConfig: Record) => void; addRenderer: (renderer: AstroRenderer) => void; injectScript: (stage: InjectedScriptStage, content: string) => void; - ignorePages: (glob: string) => void; // TODO: Add support for `injectElement()` for full HTML element injection, not just scripts. // This may require some refactoring of `scripts`, `styles`, and `links` into something // more generalized. Consider the SSR use-case as well. diff --git a/packages/astro/src/core/config.ts b/packages/astro/src/core/config.ts index 8e4547d0a..394c1c42d 100644 --- a/packages/astro/src/core/config.ts +++ b/packages/astro/src/core/config.ts @@ -206,7 +206,7 @@ export async function validateConfig(userConfig: any, root: string): Promise int.name.startsWith('@astrojs/'))) { diff --git a/packages/astro/src/core/routing/manifest/create.ts b/packages/astro/src/core/routing/manifest/create.ts index 8e0bdb736..1e0a6f3bc 100644 --- a/packages/astro/src/core/routing/manifest/create.ts +++ b/packages/astro/src/core/routing/manifest/create.ts @@ -4,7 +4,6 @@ import type { LogOptions } from '../../logger'; import fs from 'fs'; import path from 'path'; import { compile } from 'path-to-regexp'; -import micromatch from 'micromatch'; import slash from 'slash'; import { fileURLToPath } from 'url'; import { warn } from '../../logger.js'; @@ -179,16 +178,11 @@ export function createRouteManifest({ config, cwd }: { config: AstroConfig; cwd? fs.readdirSync(dir).forEach((basename) => { const resolved = path.join(dir, basename); const file = slash(path.relative(cwd || fileURLToPath(config.projectRoot), resolved)); - const pagePath = slash(path.relative(fileURLToPath(config.pages), resolved)); const isDir = fs.statSync(resolved).isDirectory(); const ext = path.extname(basename); const name = ext ? basename.slice(0, -ext.length) : basename; - if ((config._ctx?.ignoredPages || []).length > 0 && micromatch.isMatch(pagePath, config._ctx.ignoredPages)) { - return; - } - if (name[0] === '_') { return; } diff --git a/packages/astro/src/integrations/index.ts b/packages/astro/src/integrations/index.ts index 85d117986..e1dc53a36 100644 --- a/packages/astro/src/integrations/index.ts +++ b/packages/astro/src/integrations/index.ts @@ -24,9 +24,6 @@ export async function runHookConfigSetup({ config: _config, command }: { config: updateConfig: (newConfig) => { updatedConfig = mergeConfig(updatedConfig, newConfig) as AstroConfig; }, - ignorePages: (glob: string) => { - updatedConfig._ctx.ignoredPages.push(glob); - }, }); } } diff --git a/packages/integrations/vercel/src/index.ts b/packages/integrations/vercel/src/index.ts index 648f624b0..0df7b9485 100644 --- a/packages/integrations/vercel/src/index.ts +++ b/packages/integrations/vercel/src/index.ts @@ -41,6 +41,14 @@ export default function vercel(): AstroIntegration { version: 3, basePath: '/', pages404: false, + // redirects: [ + // { + // source: '/nice/', + // destination: '/stuff', + // statusCode: 308, + // regex: '^/nice.*$', + // }, + // ], rewrites: routes.map((route) => ({ source: route.pathname, destination: '/__astro_entry', diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index efa7ac934..68eaf52c9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -464,7 +464,6 @@ importers: '@types/diff': ^5.0.2 '@types/estree': ^0.0.51 '@types/html-escaper': ^3.0.0 - '@types/micromatch': ^4.0.2 '@types/mime': ^2.0.3 '@types/mocha': ^9.1.0 '@types/parse5': ^6.0.3 @@ -495,7 +494,6 @@ importers: htmlparser2: ^7.2.0 kleur: ^4.1.4 magic-string: ^0.25.9 - micromatch: ^4.0.5 micromorph: ^0.1.2 mime: ^3.0.0 mocha: ^9.2.2 @@ -524,7 +522,6 @@ importers: strip-ansi: ^7.0.1 supports-esm: ^1.0.0 tsconfig-resolver: ^3.0.1 - type-fest: ^2.12.1 vite: ^2.8.6 yargs-parser: ^21.0.1 zod: ^3.14.3 @@ -559,7 +556,6 @@ importers: htmlparser2: 7.2.0 kleur: 4.1.4 magic-string: 0.25.9 - micromatch: 4.0.5 micromorph: 0.1.2 mime: 3.0.0 ora: 6.1.0 @@ -601,7 +597,6 @@ importers: '@types/diff': 5.0.2 '@types/estree': 0.0.51 '@types/html-escaper': 3.0.0 - '@types/micromatch': 4.0.2 '@types/mime': 2.0.3 '@types/mocha': 9.1.0 '@types/parse5': 6.0.3 @@ -615,7 +610,6 @@ importers: cheerio: 1.0.0-rc.10 mocha: 9.2.2 sass: 1.49.9 - type-fest: 2.12.1 packages/astro-prism: specifiers: @@ -3844,10 +3838,6 @@ packages: '@babel/types': 7.17.0 dev: true - /@types/braces/3.0.1: - resolution: {integrity: sha512-+euflG6ygo4bn0JHtn4pYqcXwRtLvElQ7/nnjDu7iYG56H0+OhCd7d6Ug0IE3WcFpZozBKW2+80FUbv5QGk5AQ==} - dev: true - /@types/chai/4.3.0: resolution: {integrity: sha512-/ceqdqeRraGolFTcfoXNiqjyQhZzbINDngeoAq9GoHa8PPK1yNzTaxWjA6BFWp5Ua9JpXEMSS4s5i9tS0hOJtw==} dev: true @@ -3936,12 +3926,6 @@ packages: resolution: {integrity: sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==} dev: false - /@types/micromatch/4.0.2: - resolution: {integrity: sha512-oqXqVb0ci19GtH0vOA/U2TmHTcRY9kuZl4mqUxe0QmJAlIW13kzhuK5pi1i9+ngav8FjpSb9FVS/GE00GLX1VA==} - dependencies: - '@types/braces': 3.0.1 - dev: true - /@types/mime/1.3.2: resolution: {integrity: sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==} dev: true @@ -10203,6 +10187,7 @@ packages: /type-fest/2.12.1: resolution: {integrity: sha512-AiknQSEqKVGDDjtZqeKrUoTlcj7FKhupmnVUgz6KoOKtvMwRGE6hUNJ/nVear+h7fnUPO1q/htSkYKb1pyntkQ==} engines: {node: '>=12.20'} + dev: false /typescript/4.6.3: resolution: {integrity: sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==}