@teacss/astro 0.3.8 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,10 +16,10 @@ integration directly.
16
16
 
17
17
  ```ts
18
18
  import { defineConfig } from "astro/config";
19
- import { pluginTeacss } from "@teacss/astro";
19
+ import { teacss } from "@teacss/astro";
20
20
 
21
21
  export default defineConfig({
22
- integrations: [pluginTeacss()],
22
+ integrations: [teacss()],
23
23
  });
24
24
  ```
25
25
 
@@ -29,7 +29,7 @@ A string value fully replaces that default import, so it must import
29
29
  Use `injectExtra` to keep the default and add other module statements:
30
30
 
31
31
  ```ts
32
- pluginTeacss({
32
+ teacss({
33
33
  injectExtra: ['import "./src/styles.css";', 'import "./src/fonts.css";'],
34
34
  });
35
35
  ```
package/dist/index.d.ts CHANGED
@@ -19,6 +19,6 @@ interface AstroIntegrationConfig<Theme extends object = object> extends TeacssVi
19
19
  */
20
20
  injectExtra?: string[];
21
21
  }
22
- declare function pluginTeacss<Theme extends object>(options?: AstroIntegrationConfig<Theme>, defaults?: UserConfigDefaults): AstroIntegration;
22
+ declare function teacss<Theme extends object>(options?: AstroIntegrationConfig<Theme>, defaults?: UserConfigDefaults): AstroIntegration;
23
23
  //#endregion
24
- export { AstroIntegrationConfig, pluginTeacss };
24
+ export { AstroIntegrationConfig, teacss };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  import{join as e}from"node:path";import{pluginTeacss as t}from"@teacss/vite";import{normalizePath as n}from"vite";const r=`teacss-astro`;function i(t){let i=t.join(`
2
- `),a,o;return{name:`teacss:astro`,enforce:`pre`,configResolved(e){a=e.root;let t=e.plugins.find(e=>e.name===`teacss:api`)?.api;if(!t)throw Error(`[@teacss/astro] Unable to find TeaCSS Vite plugin API`);o=t.getContext()},async resolveId(t,i){if(t===r)return t;let{RESOLVED_ID_RE:s}=await o.getVMPRegexes();if(s.test(t))return this.resolve(n(e(a,t)),i,{skipSelf:!0})},load(e){if(e===r)return i}}}function a(e={},n={}){let{injectEntry:a=!0,injectExtra:o=[],...s}=e,c=Object.values(s).some(e=>e!==void 0)?s:void 0,l=[];return a&&l.push(typeof a==`string`?a:`import "virtual:teacss.css";`),l.push(...o),{name:`@teacss/astro`,hooks:{"astro:config:setup":({updateConfig:e,injectScript:a})=>{e({vite:{plugins:[...t(c,n),i(l)]}}),l.length&&a(`page-ssr`,`import ${JSON.stringify(r)}`)}}}}export{a as pluginTeacss};
2
+ `),a,o;return{name:`teacss:astro`,enforce:`pre`,configResolved(e){a=e.root;let t=e.plugins.find(e=>e.name===`teacss:api`)?.api;if(!t)throw Error(`[@teacss/astro] Unable to find TeaCSS Vite plugin API`);o=t.getContext()},async resolveId(t,i){if(t===r)return t;let{RESOLVED_ID_RE:s}=await o.getVMPRegexes();if(s.test(t))return this.resolve(n(e(a,t)),i,{skipSelf:!0})},load(e){if(e===r)return i}}}function a(e={},n={}){let{injectEntry:a=!0,injectExtra:o=[],...s}=e,c=Object.values(s).some(e=>e!==void 0)?s:void 0,l=[];return a&&l.push(typeof a==`string`?a:`import "virtual:teacss.css";`),l.push(...o),{name:`@teacss/astro`,hooks:{"astro:config:setup":({updateConfig:e,injectScript:a})=>{e({vite:{plugins:[...t(c,n),i(l)]}}),l.length&&a(`page-ssr`,`import ${JSON.stringify(r)}`)}}}}export{a as teacss};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teacss/astro",
3
- "version": "0.3.8",
3
+ "version": "0.4.1",
4
4
  "description": "Astro integration for TeaCSS — registers the Vite plugin and injects the generated stylesheet.",
5
5
  "homepage": "https://css.teasim.com",
6
6
  "funding": "https://github.com/sponsors/billgo",
@@ -22,8 +22,8 @@
22
22
  "dev": "tsdown --watch"
23
23
  },
24
24
  "dependencies": {
25
- "@teacss/core": "0.3.8",
26
- "@teacss/vite": "0.3.8"
25
+ "@teacss/core": "0.4.1",
26
+ "@teacss/vite": "0.4.1"
27
27
  },
28
28
  "devDependencies": {
29
29
  "astro": "^7.1.3",