mirror of
https://github.com/withastro/astro.git
synced 2024-12-30 22:03:56 -05:00
[ci] format
This commit is contained in:
parent
1153331cbb
commit
60136f9c56
3 changed files with 29 additions and 29 deletions
|
@ -46,4 +46,4 @@
|
|||
"publishConfig": {
|
||||
"provenance": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,32 +4,32 @@ import { resolve } from 'node:path';
|
|||
|
||||
interface Options {
|
||||
/**
|
||||
* You can extend Alpine by setting this option to a root-relative import specifier (for example, `entrypoint: "/src/entrypoint"`).
|
||||
*
|
||||
* The default export of this file should be a function that accepts an Alpine instance prior to starting, allowing the use of custom directives, plugins and other customizations for advanced use cases.
|
||||
*
|
||||
* ```js
|
||||
* // astro.config.mjs
|
||||
* import { defineConfig } from 'astro/config';
|
||||
* import alpine from '@astrojs/alpinejs';
|
||||
*
|
||||
* export default defineConfig({
|
||||
* // ...
|
||||
* integrations: [alpine({ entrypoint: '/src/entrypoint' })],
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* ```js
|
||||
* // src/entrypoint.ts
|
||||
* import type { Alpine } from 'alpinejs'
|
||||
*
|
||||
* export default (Alpine: Alpine) => {
|
||||
* Alpine.directive('foo', el => {
|
||||
* el.textContent = 'bar';
|
||||
* })
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
* You can extend Alpine by setting this option to a root-relative import specifier (for example, `entrypoint: "/src/entrypoint"`).
|
||||
*
|
||||
* The default export of this file should be a function that accepts an Alpine instance prior to starting, allowing the use of custom directives, plugins and other customizations for advanced use cases.
|
||||
*
|
||||
* ```js
|
||||
* // astro.config.mjs
|
||||
* import { defineConfig } from 'astro/config';
|
||||
* import alpine from '@astrojs/alpinejs';
|
||||
*
|
||||
* export default defineConfig({
|
||||
* // ...
|
||||
* integrations: [alpine({ entrypoint: '/src/entrypoint' })],
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* ```js
|
||||
* // src/entrypoint.ts
|
||||
* import type { Alpine } from 'alpinejs'
|
||||
*
|
||||
* export default (Alpine: Alpine) => {
|
||||
* Alpine.directive('foo', el => {
|
||||
* el.textContent = 'bar';
|
||||
* })
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
entrypoint?: string;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ test.describe('Basics', () => {
|
|||
test('Alpine is working', async ({ page, astro }) => {
|
||||
await page.goto(astro.resolveUrl('/'));
|
||||
|
||||
const el = page.locator("#foo")
|
||||
expect(await el.textContent()).toBe('bar')
|
||||
const el = page.locator('#foo');
|
||||
expect(await el.textContent()).toBe('bar');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue