Skip to content

Commit

Permalink
Fix: reintroduce smoke tests across example projects (withastro#3669)
Browse files Browse the repository at this point in the history
* chore: update smoke tests

* chore: bump smoke tests to node@16

* chore: remove gitmodules

* chore(ci): prefer node@14

* wip: remove path from smoke clone step

* feat: run build:examples from test:smoke

* fix: remove no-frozen-lockfile

* fix: checkout monorepo last for pnpm setup

* wip: replace @astrojs/markdown/remark import from md

* fix: remove type defs from generated file

* fix: function order

* chore: remove ssr-utils export

* wip: remove windows from smoke test

* fix: instantiate slugger in snippet

* fix: exclude with-mdx from smoke (for now)

* fix: add quotes on filter flag for safety

* chore: changeset

* wip: try reintroducing windows smoke

* sad chore: remove client: directive from with-mdx

* Revert "wip: try reintroducing windows smoke"

This reverts commit 9529b1a.

Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: bholmesdev <hey@bholmes.dev>
  • Loading branch information
3 people authored Jul 12, 2022
1 parent c07544b commit e74ebcd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 6 additions & 1 deletion src/vite-plugin-markdown/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}';` : ''}
Expand Down

0 comments on commit e74ebcd

Please sign in to comment.