From 89f429473cd946c24b4416f661f675188c8c2f91 Mon Sep 17 00:00:00 2001 From: assbay18 Date: Wed, 27 Aug 2025 15:52:51 -0500 Subject: [PATCH] Create npm-grunt.yml1 const renderDecorator: RenderDecoratorFunction = (props) => { if (props.value === 'strong') { return {props.children} } if (props.value === 'em') { return {props.children} } if (props.value === 'underline') { return {props.children} } return <>{props.children} } // Annotations const renderAnnotation: RenderAnnotationFunction = (props) => { if (props.schemaType.name === 'link') { return {props.children} } return <>{props.children} } // Block objects const renderBlock: RenderBlockFunction = (props) => { if (props.schemaType.name === 'image' && isImage(props.value)) { return (
IMG: {props.value.src}
) } return
{props.children}
} // Check the shape of an image and confirm it has a src. function isImage( props: PortableTextBlock, ): props is PortableTextBlock & {src: string} { return 'src' in props } // Styles const renderStyle: RenderStyleFunction = (props) => { if (props.schemaType.value === 'h1') { return

{props.children}

} if (props.schemaType.value === 'h2') { return

{props.children}

} if (props.schemaType.value === 'h3') { return

{props.children}

} if (props.schemaType.value === 'blockquote') { return
{props.children}
} return <>{props.children} } // Inline objects const renderChild: RenderChildFunction = (props) => { if (props.schemaType.name === 'stock-ticker' && isStockTicker(props.value)) { return ( {props.value.symbol} ) } return <>{props.children} } // Check the shape of the object by confirming it has a symbol. function isStockTicker( props: PortableTextChild, ): props is PortableTextChild & {symbol: string} { return 'symbol' in props } --- .github/workflows/npm-grunt.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/npm-grunt.yml diff --git a/.github/workflows/npm-grunt.yml b/.github/workflows/npm-grunt.yml new file mode 100644 index 00000000..5ef7a9ae --- /dev/null +++ b/.github/workflows/npm-grunt.yml @@ -0,0 +1,28 @@ +name: NodeJS with Grunt + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - name: Build + run: | + npm install + grunt