Skip to content

Commit

Permalink
migrating to a pnpm workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
jcayzac committed Aug 17, 2024
1 parent 7bde210 commit 334dbef
Show file tree
Hide file tree
Showing 9 changed files with 2,518 additions and 7 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
50 changes: 50 additions & 0 deletions packages/astro-classlist/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "@jcayzac/astro-classlist",
"type": "module",
"version": "0.1.4",
"description": "Helper for Astro components to coerce `class:list` into an array of strings.",
"author": "Julien Cayzac",
"license": "MIT",
"funding": "https://github.com/sponsors/jcayzac",
"homepage": "https://github.com/jcayzac/copepod-modules/tree/main/astro-classlist#readme",
"repository": {
"type": "git",
"url": "github:jcayzac/copepod-modules",
"directory": "packages/astro-classlist"
},
"bugs": "https://github.com/jcayzac/copepod-modules/issues",
"keywords": [
"astro",
"astro-component",
"astro-components",
"astro-utils"
],
"sideEffects": false,
"publishConfig": {
"access": "public",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs"
}
},
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts"
},
"main": "./src/index.ts",
"files": [
"dist"
],
"scripts": {
"build": "unbuild --minify --sourcemap",
"prepublishOnly": "npm run build",
"lint": "eslint .",
"check": "tsc --noEmit"
},
"peerDependencies": {
"astro": "^4.14.2"
},
"devDependencies": {
"astro": "^4.14.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { AstroBuiltinAttributes } from 'astro'
/**
* The type of the `class:list` attribute.
*/
export type ClassList = AstroBuiltinAttributes['class:list']
export type ClassList = string[]

/**
* A utility object for working with the `class:list` attribute.
Expand All @@ -14,7 +14,7 @@ export interface ClassListStaticFunctions {
* This is useful when you want to accept a `class:list` prop and pass it
* to a component, while adding your own classes too.
*/
toArray: (classList: ClassList) => string[]
toArray: (classList: AstroBuiltinAttributes['class:list']) => ClassList
}

/**
Expand All @@ -27,7 +27,7 @@ export const ClassList: ClassListStaticFunctions = {
* This is useful when you want to accept a `class:list` prop and pass it
* to a component, while adding your own classes too.
*/
toArray(classList: ClassList): string[] {
toArray(classList: AstroBuiltinAttributes['class:list']): ClassList {
if (typeof classList === 'string') {
return [classList]
}
Expand Down
File renamed without changes.
Loading

0 comments on commit 334dbef

Please sign in to comment.