@cypress-design/vue-icon 0.4.0 → 0.5.0

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/generate-icons.js CHANGED
@@ -1,14 +1,16 @@
1
1
  const path = require('path')
2
2
  const dedent = require('dedent')
3
3
  const { promises: fs } = require('fs')
4
- const camelcase = require('camelcase')
5
4
  const { iconsMetadata, iconSet } = require('@cypress-design/icon-registry')
5
+ const { camelCase, startCase } = require('lodash')
6
+
7
+ const pascalCase = (str) => startCase(camelCase(str)).replace(/ /g, '')
6
8
 
7
9
  const iconsComponents = Object.keys(iconsMetadata).map((name) => {
8
- const pascalCaseName = camelcase(name, { pascalCase: true })
10
+ const pascalCaseName = pascalCase(name)
9
11
  const iconMetadata = iconsMetadata[name]
10
12
  const availableIds = iconMetadata.availableSizes.map(
11
- (size) => `${camelcase(name)}X${size}`
13
+ (size) => `${camelCase(name)}X${size}`
12
14
  )
13
15
 
14
16
  const iconBodies = iconSet.reduce((acc, icon) => {
@@ -44,8 +46,9 @@ const iconsComponents = Object.keys(iconsMetadata).map((name) => {
44
46
 
45
47
  writeFile(`
46
48
  import * as iconsRegistry from '@cypress-design/icon-registry'
47
- import { compileVueIconProperties } from './Icon'
48
- import { h, type SVGAttributes } from 'vue'
49
+ import { compileVueIconProperties } from './compileProperties'
50
+ import type { SVGAttributes } from 'vue'
51
+ import { h } from 'vue'
49
52
 
50
53
  ${iconsComponents.join('\n\n\n')}
51
54
  `)
package/index.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { iconsMetadata } from '@cypress-design/icon-registry'
2
2
  export type { WindiColor } from '@cypress-design/icon-registry'
3
3
  export { default } from './Icon'
4
+ export { compileVueIconProperties } from './compileProperties'
4
5
  export * from './TreeShakableIcons'
5
6
 
6
7
  export type IconId = keyof typeof iconsMetadata
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cypress-design/vue-icon",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "files": [
5
5
  "*"
6
6
  ],
@@ -20,11 +20,12 @@
20
20
  "build:types": "yarn vue-tsc --project ./tsconfig.build.json"
21
21
  },
22
22
  "dependencies": {
23
- "@cypress-design/icon-registry": "^0.4.0"
23
+ "@cypress-design/icon-registry": "^0.5.0"
24
24
  },
25
25
  "devDependencies": {
26
- "camelcase": "^6.3.0",
26
+ "@types/lodash": "^4.14.182",
27
+ "lodash": "^4.17.21",
27
28
  "dedent": "^0.7.0"
28
29
  },
29
30
  "license": "MIT"
30
- }
31
+ }