diff --git a/.changeset/famous-moons-kick.md b/.changeset/famous-moons-kick.md new file mode 100644 index 000000000..410d1f83e --- /dev/null +++ b/.changeset/famous-moons-kick.md @@ -0,0 +1,6 @@ +--- +'astro': patch +'@astrojs/markdown-remark': patch +--- + +Tooling: reintroduce smoke test across example projects diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f37251843..e6d59eb0f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -180,16 +180,21 @@ jobs: needs: build strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest] node_version: [14] steps: - - name: Checkout + - name: Checkout docs uses: actions/checkout@v3 with: - submodules: 'recursive' + repository: withastro/docs - - name: Update submodules - run: git submodule update --remote + - name: Checkout astro.build + uses: actions/checkout@v3 + with: + repository: withastro/astro.build + + - name: Checkout + uses: actions/checkout@v3 - name: Setup PNPM uses: pnpm/action-setup@v2.2.1 @@ -201,7 +206,7 @@ jobs: cache: 'pnpm' - name: Install dependencies - run: pnpm install --no-frozen-lockfile + run: pnpm install - name: Build Packages run: pnpm run build diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 28a12af2d..000000000 --- a/.gitmodules +++ /dev/null @@ -1,8 +0,0 @@ -[submodule "smoke/docs"] - path = smoke/docs - url = git@github.com:withastro/docs.git - branch = main -[submodule "smoke/astro.build"] - path = smoke/astro.build - url = git@github.com:withastro/astro.build.git - branch = main diff --git a/examples/with-mdx/src/pages/index.mdx b/examples/with-mdx/src/pages/index.mdx index 36cde1e95..b82572b48 100644 --- a/examples/with-mdx/src/pages/index.mdx +++ b/examples/with-mdx/src/pages/index.mdx @@ -14,4 +14,4 @@ Written by: {new Intl.ListFormat('en').format(authors.map(d => d.name))}. Published on: {new Intl.DateTimeFormat('en', {dateStyle: 'long'}).format(published)}. -## This is a counter! +## This is a counter! diff --git a/package.json b/package.json index 71e246956..e55c59a1c 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "test": "turbo run test --output-logs=new-only --concurrency=1", "test:match": "cd packages/astro && pnpm run test:match", "test:templates": "turbo run test --filter=create-astro --concurrency=1", - "test:smoke": "node scripts/smoke/index.js", + "test:smoke": "turbo run build --filter=\"@example/*\" --output-logs=new-only", "test:vite-ci": "turbo run test --output-logs=new-only --no-deps --scope=astro --concurrency=1", "test:e2e": "cd packages/astro && pnpm playwright install && pnpm run test:e2e", "test:e2e:match": "cd packages/astro && pnpm playwright install && pnpm run test:e2e:match", diff --git a/packages/astro/package.json b/packages/astro/package.json index 4d8fc426f..a19f50092 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -108,6 +108,7 @@ "estree-walker": "^3.0.1", "execa": "^6.1.0", "fast-glob": "^3.2.11", + "github-slugger": "^1.4.0", "gray-matter": "^4.0.3", "html-entities": "^2.3.3", "html-escaper": "^3.0.3", diff --git a/packages/astro/src/vite-plugin-markdown/index.ts b/packages/astro/src/vite-plugin-markdown/index.ts index c2078d937..ffaa8afc7 100644 --- a/packages/astro/src/vite-plugin-markdown/index.ts +++ b/packages/astro/src/vite-plugin-markdown/index.ts @@ -161,12 +161,17 @@ export default function markdown({ config }: AstroPluginOptions): Plugin { const { layout = '', components = '', setup = '', ...content } = frontmatter; content.astro = metadata; const prelude = `--- -import { slug as $$slug } from '@astrojs/markdown-remark/ssr-utils'; +import Slugger from 'github-slugger'; ${layout ? `import Layout from '${layout}';` : ''} ${components ? `import * from '${components}';` : ''} ${hasInjectedScript ? `import '${PAGE_SSR_SCRIPT_ID}';` : ''} ${setup} +const slugger = new Slugger(); +function $$slug(value) { + return slugger.slug(value); +} + const $$content = ${JSON.stringify(content)} ---`; const imports = `${layout ? `import Layout from '${layout}';` : ''} diff --git a/packages/markdown/remark/package.json b/packages/markdown/remark/package.json index 2ba4f64ad..1c943c9b7 100644 --- a/packages/markdown/remark/package.json +++ b/packages/markdown/remark/package.json @@ -13,8 +13,7 @@ "homepage": "https://astro.build", "main": "./dist/index.js", "exports": { - ".": "./dist/index.js", - "./ssr-utils": "./dist/ssr-utils.js" + ".": "./dist/index.js" }, "scripts": { "prepublish": "pnpm build", diff --git a/packages/markdown/remark/src/ssr-utils.ts b/packages/markdown/remark/src/ssr-utils.ts deleted file mode 100644 index 1491e24a5..000000000 --- a/packages/markdown/remark/src/ssr-utils.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** Utilities used in deployment-ready SSR bundles */ -import Slugger from 'github-slugger'; - -const slugger = new Slugger(); -/** @see {@link "/packages/astro/vite-plugin-markdown"} */ -export function slug(value: string): string { - return slugger.slug(value); -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2a61a77b8..8645f31bc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -515,6 +515,7 @@ importers: estree-walker: ^3.0.1 execa: ^6.1.0 fast-glob: ^3.2.11 + github-slugger: ^1.4.0 gray-matter: ^4.0.3 html-entities: ^2.3.3 html-escaper: ^3.0.3 @@ -575,6 +576,7 @@ importers: estree-walker: 3.0.1 execa: 6.1.0 fast-glob: 3.2.11 + github-slugger: 1.4.0 gray-matter: 4.0.3 html-entities: 2.3.3 html-escaper: 3.0.3