File tree Expand file tree Collapse file tree
fixtures/plugins/astro-og-canvas Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import 'astro-og-canvas' ;
Original file line number Diff line number Diff line change 1+ {
2+ "dependencies" : {
3+ "astro-og-canvas" : " ^0.10.0" ,
4+ "canvaskit-wasm" : " ^0.40.0"
5+ },
6+ "name" : " @plugins/astro-og-canvas"
7+ }
Original file line number Diff line number Diff line change 1+ import type { IsPluginEnabled , Plugin , Resolve } from '../../types/config.js' ;
2+ import { toDependency } from '../../util/input.js' ;
3+ import { hasDependency } from '../../util/plugin.js' ;
4+
5+ // https://github.com/delucis/astro-og-canvas
6+
7+ const title = 'astro-og-canvas' ;
8+
9+ const enablers = [ 'astro-og-canvas' ] ;
10+
11+ const isEnabled : IsPluginEnabled = ( { dependencies } ) => hasDependency ( dependencies , enablers ) ;
12+
13+ const resolve : Resolve = async ( ) => {
14+ return [ toDependency ( 'canvaskit-wasm' , { optional : true } ) ] ;
15+ } ;
16+
17+ const plugin : Plugin = {
18+ title,
19+ enablers,
20+ isEnabled,
21+ resolve,
22+ } ;
23+
24+ export default plugin ;
Original file line number Diff line number Diff line change 22import { default as angular } from './angular/index.js' ;
33import { default as astro } from './astro/index.js' ;
44import { default as astroDb } from './astro-db/index.js' ;
5+ import { default as astroOgCanvas } from './astro-og-canvas/index.js' ;
56import { default as ava } from './ava/index.js' ;
67import { default as babel } from './babel/index.js' ;
78import { default as biome } from './biome/index.js' ;
@@ -131,6 +132,7 @@ export const Plugins = {
131132 angular,
132133 astro,
133134 'astro-db' : astroDb ,
135+ 'astro-og-canvas' : astroOgCanvas ,
134136 ava,
135137 babel,
136138 biome,
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export const pluginsSchema = z.object({
1616 angular : pluginSchema ,
1717 astro : pluginSchema ,
1818 'astro-db' : pluginSchema ,
19+ 'astro-og-canvas' : pluginSchema ,
1920 ava : pluginSchema ,
2021 babel : pluginSchema ,
2122 biome : pluginSchema ,
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ export type PluginName =
33 | 'angular'
44 | 'astro'
55 | 'astro-db'
6+ | 'astro-og-canvas'
67 | 'ava'
78 | 'babel'
89 | 'biome'
@@ -132,6 +133,7 @@ export const pluginNames = [
132133 'angular' ,
133134 'astro' ,
134135 'astro-db' ,
136+ 'astro-og-canvas' ,
135137 'ava' ,
136138 'babel' ,
137139 'biome' ,
Original file line number Diff line number Diff line change 1+ import assert from 'node:assert/strict' ;
2+ import test from 'node:test' ;
3+ import { main } from '../../src/index.js' ;
4+ import baseCounters from '../helpers/baseCounters.js' ;
5+ import { createOptions } from '../helpers/create-options.js' ;
6+ import { resolve } from '../helpers/resolve.js' ;
7+
8+ const cwd = resolve ( 'fixtures/plugins/astro-og-canvas' ) ;
9+
10+ test ( 'Find dependencies with the astro-og-canvas plugin' , async ( ) => {
11+ const options = await createOptions ( { cwd } ) ;
12+ const { counters } = await main ( options ) ;
13+
14+ assert . deepEqual ( counters , {
15+ ...baseCounters ,
16+ processed : 1 ,
17+ total : 1 ,
18+ } ) ;
19+ } ) ;
You can’t perform that action at this time.
0 commit comments