- For faster testing, modify
test-workspace.tsto only run tests on one browser, like-l chrome
- Change all
3.0.0-pre.Xversions in dependency-map.json to the new version so that its picked up in all package.json files
| require('shelljs/make'); | |
| target.lint = function() { | |
| // see: http://shelljs-recipes.tumblr.com/post/94832587846/javascript-validation-with-eslint | |
| // linting used her for example, can really be anything | |
| echo('Validating JavaScript'); | |
| exec('node ./node_modules/eslint/bin/eslint ' + JS_FILES); | |
| } | |
| // To run: node make lint |
test-workspace.ts to only run tests on one browser, like -l chrome3.0.0-pre.X versions in dependency-map.json to the new version so that its picked up in all package.json files
I joined Salma (@whitep4nth3r) on their livestream and helped them use Astro for the first time. Below are my notes on the experience.
https://www.twitch.tv/videos/1054128448
| --- | |
| import {writeFile} from 'node:fs/promises'; | |
| export interface Props { | |
| font: string; | |
| weight?: string[]; | |
| } | |
| const {font, weight} = Astro.props as Props; | |
| let familyValue = font; | |
| if (weight) { |
| export default function createPlugin(options) { | |
| return { | |
| // Hook into different events: | |
| name: 'my-plugin-name', | |
| hooks: { | |
| 'config:setup': ({ config, command, injectScript, injectHtml }) => {}, | |
| 'config:done': ({ config, command, injectScript, injectHtml }) => {}, | |
| 'serve:setup': ({ server }) => {}, | |
| 'serve:start': ({ port }) => {}, | |
| 'serve:done': ({}) => {}, |
| --- | |
| import { Code } from "astro/components"; | |
| --- | |
| <!-- This breaks when deployed to Vercel! --> | |
| <Code lang="ts" code={`// Test`} /> |
| import { createServer } from "node:http"; | |
| import { AsyncLocalStorage } from "node:async_hooks"; | |
| const asyncLocalStorage = new AsyncLocalStorage(); | |
| createServer((req, res) => { | |
| asyncLocalStorage.run({ req, res }, () => { | |
| asyncHandler().catch((err) => { | |
| console.error(err); | |
| if (!res.writableEnded) { |