Fix: reintroduce smoke tests across example projects (#3669)
* 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 9529b1a45c
.
Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: bholmesdev <hey@bholmes.dev>
This commit is contained in:
parent
14ed29c645
commit
93e1020b1e
10 changed files with 29 additions and 27 deletions
6
.changeset/famous-moons-kick.md
Normal file
6
.changeset/famous-moons-kick.md
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
'astro': patch
|
||||||
|
'@astrojs/markdown-remark': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Tooling: reintroduce smoke test across example projects
|
17
.github/workflows/ci.yml
vendored
17
.github/workflows/ci.yml
vendored
|
@ -180,16 +180,21 @@ jobs:
|
||||||
needs: build
|
needs: build
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, windows-latest]
|
os: [ubuntu-latest]
|
||||||
node_version: [14]
|
node_version: [14]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout docs
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
submodules: 'recursive'
|
repository: withastro/docs
|
||||||
|
|
||||||
- name: Update submodules
|
- name: Checkout astro.build
|
||||||
run: git submodule update --remote
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
repository: withastro/astro.build
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup PNPM
|
- name: Setup PNPM
|
||||||
uses: pnpm/action-setup@v2.2.1
|
uses: pnpm/action-setup@v2.2.1
|
||||||
|
@ -201,7 +206,7 @@ jobs:
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --no-frozen-lockfile
|
run: pnpm install
|
||||||
|
|
||||||
- name: Build Packages
|
- name: Build Packages
|
||||||
run: pnpm run build
|
run: pnpm run build
|
||||||
|
|
8
.gitmodules
vendored
8
.gitmodules
vendored
|
@ -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
|
|
|
@ -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)}.
|
Published on: {new Intl.DateTimeFormat('en', {dateStyle: 'long'}).format(published)}.
|
||||||
|
|
||||||
<Counter client:idle>## This is a counter!</Counter>
|
<Counter>## This is a counter!</Counter>
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
"test": "turbo run test --output-logs=new-only --concurrency=1",
|
"test": "turbo run test --output-logs=new-only --concurrency=1",
|
||||||
"test:match": "cd packages/astro && pnpm run test:match",
|
"test:match": "cd packages/astro && pnpm run test:match",
|
||||||
"test:templates": "turbo run test --filter=create-astro --concurrency=1",
|
"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: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": "cd packages/astro && pnpm playwright install && pnpm run test:e2e",
|
||||||
"test:e2e:match": "cd packages/astro && pnpm playwright install && pnpm run test:e2e:match",
|
"test:e2e:match": "cd packages/astro && pnpm playwright install && pnpm run test:e2e:match",
|
||||||
|
|
|
@ -108,6 +108,7 @@
|
||||||
"estree-walker": "^3.0.1",
|
"estree-walker": "^3.0.1",
|
||||||
"execa": "^6.1.0",
|
"execa": "^6.1.0",
|
||||||
"fast-glob": "^3.2.11",
|
"fast-glob": "^3.2.11",
|
||||||
|
"github-slugger": "^1.4.0",
|
||||||
"gray-matter": "^4.0.3",
|
"gray-matter": "^4.0.3",
|
||||||
"html-entities": "^2.3.3",
|
"html-entities": "^2.3.3",
|
||||||
"html-escaper": "^3.0.3",
|
"html-escaper": "^3.0.3",
|
||||||
|
|
|
@ -161,12 +161,17 @@ export default function markdown({ config }: AstroPluginOptions): Plugin {
|
||||||
const { layout = '', components = '', setup = '', ...content } = frontmatter;
|
const { layout = '', components = '', setup = '', ...content } = frontmatter;
|
||||||
content.astro = metadata;
|
content.astro = metadata;
|
||||||
const prelude = `---
|
const prelude = `---
|
||||||
import { slug as $$slug } from '@astrojs/markdown-remark/ssr-utils';
|
import Slugger from 'github-slugger';
|
||||||
${layout ? `import Layout from '${layout}';` : ''}
|
${layout ? `import Layout from '${layout}';` : ''}
|
||||||
${components ? `import * from '${components}';` : ''}
|
${components ? `import * from '${components}';` : ''}
|
||||||
${hasInjectedScript ? `import '${PAGE_SSR_SCRIPT_ID}';` : ''}
|
${hasInjectedScript ? `import '${PAGE_SSR_SCRIPT_ID}';` : ''}
|
||||||
${setup}
|
${setup}
|
||||||
|
|
||||||
|
const slugger = new Slugger();
|
||||||
|
function $$slug(value) {
|
||||||
|
return slugger.slug(value);
|
||||||
|
}
|
||||||
|
|
||||||
const $$content = ${JSON.stringify(content)}
|
const $$content = ${JSON.stringify(content)}
|
||||||
---`;
|
---`;
|
||||||
const imports = `${layout ? `import Layout from '${layout}';` : ''}
|
const imports = `${layout ? `import Layout from '${layout}';` : ''}
|
||||||
|
|
|
@ -13,8 +13,7 @@
|
||||||
"homepage": "https://astro.build",
|
"homepage": "https://astro.build",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./dist/index.js",
|
".": "./dist/index.js"
|
||||||
"./ssr-utils": "./dist/ssr-utils.js"
|
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepublish": "pnpm build",
|
"prepublish": "pnpm build",
|
||||||
|
|
|
@ -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);
|
|
||||||
}
|
|
|
@ -515,6 +515,7 @@ importers:
|
||||||
estree-walker: ^3.0.1
|
estree-walker: ^3.0.1
|
||||||
execa: ^6.1.0
|
execa: ^6.1.0
|
||||||
fast-glob: ^3.2.11
|
fast-glob: ^3.2.11
|
||||||
|
github-slugger: ^1.4.0
|
||||||
gray-matter: ^4.0.3
|
gray-matter: ^4.0.3
|
||||||
html-entities: ^2.3.3
|
html-entities: ^2.3.3
|
||||||
html-escaper: ^3.0.3
|
html-escaper: ^3.0.3
|
||||||
|
@ -575,6 +576,7 @@ importers:
|
||||||
estree-walker: 3.0.1
|
estree-walker: 3.0.1
|
||||||
execa: 6.1.0
|
execa: 6.1.0
|
||||||
fast-glob: 3.2.11
|
fast-glob: 3.2.11
|
||||||
|
github-slugger: 1.4.0
|
||||||
gray-matter: 4.0.3
|
gray-matter: 4.0.3
|
||||||
html-entities: 2.3.3
|
html-entities: 2.3.3
|
||||||
html-escaper: 3.0.3
|
html-escaper: 3.0.3
|
||||||
|
|
Loading…
Reference in a new issue