Compare commits
24 Commits
0.450.0
...
new-releas
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
248d1c31eb | ||
|
|
b6a978ec6a | ||
|
|
de454e4d98 | ||
|
|
13c4163843 | ||
|
|
c0d4147fe6 | ||
|
|
0640cd0938 | ||
|
|
7ab9b83991 | ||
|
|
0c08347e5e | ||
|
|
35e9cb4b6f | ||
|
|
2095ba6aa7 | ||
|
|
ddfc5cadc1 | ||
|
|
f3c6929c98 | ||
|
|
9b46e0dcba | ||
|
|
ef449fd5c5 | ||
|
|
2892be8229 | ||
|
|
2b1ad320fe | ||
|
|
61a86a959a | ||
|
|
d92e7796e4 | ||
|
|
bde9e1cb6b | ||
|
|
a5e07c28bd | ||
|
|
2a68b12cbe | ||
|
|
493382b4fd | ||
|
|
6588971ead | ||
|
|
d237803413 |
102
.github/workflows/ci.yml
vendored
@@ -3,71 +3,67 @@ name: Continuous integration icons
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
# - main
|
||||||
paths:
|
- '*'
|
||||||
- icons/**/*.svg
|
# paths:
|
||||||
|
# - icons/**/*.svg
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create-release:
|
create-release:
|
||||||
if: github.repository == 'lucide-icons/lucide'
|
# Only create a new releases for new icons
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
id-token: write
|
||||||
|
contents: write
|
||||||
|
packages: read
|
||||||
|
actions: write
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
VERSION: ${{ steps.new-version.outputs.NEW_VERSION }}
|
VERSION: ${{ steps.semantic.outputs.new_release_version }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v2
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
|
- name: Semantic Release
|
||||||
|
id: semantic
|
||||||
|
uses: cycjimmy/semantic-release-action@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
tag_format: ${version}
|
||||||
cache: 'pnpm'
|
branches: |
|
||||||
|
['new-release-workflow']
|
||||||
|
extends: |
|
||||||
|
semantic-release-monorepo
|
||||||
|
extra_plugins: |
|
||||||
|
@semantic-release/github
|
||||||
|
@semantic-release/git
|
||||||
|
@semantic-release/release-notes-generator
|
||||||
|
conventional-changelog-conventionalcommits
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install --frozen-lockfile
|
|
||||||
|
|
||||||
- name: Fetch tags
|
|
||||||
run: git fetch --all --tags
|
|
||||||
|
|
||||||
- name: Get latest tag
|
|
||||||
id: latest-tag
|
|
||||||
run: echo "LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Check if we can patch
|
|
||||||
run: .github/workflows/version-up.sh --minor
|
|
||||||
|
|
||||||
- name: Create new version
|
|
||||||
id: new-version
|
|
||||||
run: echo "NEW_VERSION=$(.github/workflows/version-up.sh --minor)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Create change log
|
|
||||||
id: change-log
|
|
||||||
run: |
|
|
||||||
CHANGE_LOG=$(pnpm run generate:changelog --old-tag=${{ steps.latest-tag.outputs.LATEST_TAG }})
|
|
||||||
CHANGE_LOG=$(tail -n +5 <<< $CHANGE_LOG)
|
|
||||||
echo $CHANGE_LOG
|
|
||||||
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
|
|
||||||
echo "CHANGE_LOG<<$EOF" >> $GITHUB_OUTPUT
|
|
||||||
echo "$CHANGE_LOG" >> $GITHUB_OUTPUT
|
|
||||||
echo "$EOF" >> $GITHUB_OUTPUT
|
|
||||||
env:
|
env:
|
||||||
GITHUB_API_KEY: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Check output
|
- name: Do something when a new release published
|
||||||
|
if: steps.semantic.outputs.new_release_published == 'true'
|
||||||
run: |
|
run: |
|
||||||
echo '${{ steps.new-version.outputs.NEW_VERSION }}'
|
echo ${{ steps.semantic.outputs.new_release_version }}
|
||||||
echo '${{ steps.change-log.outputs.CHANGE_LOG }}'
|
echo ${{ steps.semantic.outputs.new_release_major_version }}
|
||||||
|
echo ${{ steps.semantic.outputs.new_release_minor_version }}
|
||||||
|
echo ${{ steps.semantic.outputs.new_release_patch_version }}
|
||||||
|
# - name: Create Release
|
||||||
|
# uses: softprops/action-gh-release@v1
|
||||||
|
# with:
|
||||||
|
# tag_name: ${{ steps.semantic.outputs.new_release_version }}
|
||||||
|
# name: Version ${{ steps.semantic.outputs.new_release_version }}
|
||||||
|
# body: ${{ steps.semantic.outputs.new_release_notes }}
|
||||||
|
|
||||||
- name: Create Release
|
# start-release:
|
||||||
uses: softprops/action-gh-release@v1
|
# if: github.repository == 'lucide-icons/lucide'
|
||||||
with:
|
# needs: create-release
|
||||||
tag_name: ${{ steps.new-version.outputs.NEW_VERSION }}
|
# uses: './.github/workflows/release.yml'
|
||||||
name: New icons ${{ steps.new-version.outputs.NEW_VERSION }}
|
# secrets: inherit
|
||||||
body: ${{ steps.change-log.outputs.CHANGE_LOG }}
|
# with:
|
||||||
|
# version: ${{ needs.create-release.outputs.VERSION }}
|
||||||
start-release:
|
|
||||||
if: github.repository == 'lucide-icons/lucide'
|
|
||||||
needs: create-release
|
|
||||||
uses: './.github/workflows/release.yml'
|
|
||||||
secrets: inherit
|
|
||||||
with:
|
|
||||||
version: ${{ needs.create-release.outputs.VERSION }}
|
|
||||||
|
|||||||
21
.github/workflows/linting.yml
vendored
@@ -21,3 +21,24 @@ jobs:
|
|||||||
|
|
||||||
- name: Run Linter
|
- name: Run Linter
|
||||||
run: pnpm lint
|
run: pnpm lint
|
||||||
|
|
||||||
|
pr-title:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: amannn/action-semantic-pull-request@v5
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
types: |
|
||||||
|
fix
|
||||||
|
feat
|
||||||
|
perf
|
||||||
|
refactor
|
||||||
|
test
|
||||||
|
style
|
||||||
|
docs
|
||||||
|
ci
|
||||||
|
build
|
||||||
|
requireScope: true
|
||||||
|
ignoreLabels: |
|
||||||
|
bot
|
||||||
|
|||||||
@@ -1,98 +1,98 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { startCase, camelCase } from 'lodash-es'
|
import { toPascalCase } from '@lucide/shared';
|
||||||
import ButtonMenu from '../base/ButtonMenu.vue'
|
import ButtonMenu from '../base/ButtonMenu.vue';
|
||||||
import { useIconStyleContext } from '../../composables/useIconStyle';
|
import { useIconStyleContext } from '../../composables/useIconStyle';
|
||||||
import useConfetti from '../../composables/useConfetti';
|
import useConfetti from '../../composables/useConfetti';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
name: string
|
name: string;
|
||||||
popoverPosition?: 'top' | 'bottom'
|
popoverPosition?: 'top' | 'bottom';
|
||||||
}>()
|
}>();
|
||||||
const { size, color, strokeWidth, absoluteStrokeWidth } = useIconStyleContext()
|
const { size, color, strokeWidth, absoluteStrokeWidth } = useIconStyleContext();
|
||||||
const { animate, confetti } = useConfetti()
|
const { animate, confetti } = useConfetti();
|
||||||
const componentName = computed(() => {
|
const componentName = computed(() => {
|
||||||
return startCase(camelCase(props.name)).replace(/\s/g, '')
|
return (toPascalCase(props.name) as string).replace(/\s/g, '');
|
||||||
})
|
});
|
||||||
|
|
||||||
function copyJSX() {
|
function copyJSX() {
|
||||||
let attrs = ['']
|
let attrs = [''];
|
||||||
|
|
||||||
if (size.value && size.value !== 24) {
|
if (size.value && size.value !== 24) {
|
||||||
attrs.push(`size={${size.value}}`)
|
attrs.push(`size={${size.value}}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (color.value && color.value !== 'currentColor') {
|
if (color.value && color.value !== 'currentColor') {
|
||||||
attrs.push(`color="${color.value}"`)
|
attrs.push(`color="${color.value}"`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strokeWidth.value && strokeWidth.value !== 2) {
|
if (strokeWidth.value && strokeWidth.value !== 2) {
|
||||||
attrs.push(`strokeWidth={${strokeWidth.value}}`)
|
attrs.push(`strokeWidth={${strokeWidth.value}}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (absoluteStrokeWidth.value) {
|
if (absoluteStrokeWidth.value) {
|
||||||
attrs.push(`absoluteStrokeWidth`)
|
attrs.push(`absoluteStrokeWidth`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const code = `<${componentName.value}${attrs.join(' ')} />`
|
const code = `<${componentName.value}${attrs.join(' ')} />`;
|
||||||
|
|
||||||
navigator.clipboard.writeText(code)
|
navigator.clipboard.writeText(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
function copyComponentName() {
|
function copyComponentName() {
|
||||||
const code = componentName.value
|
const code = componentName.value;
|
||||||
|
|
||||||
navigator.clipboard.writeText(code)
|
navigator.clipboard.writeText(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
function copyVue() {
|
function copyVue() {
|
||||||
let attrs = ['']
|
let attrs = [''];
|
||||||
|
|
||||||
if (size.value && size.value !== 24) {
|
if (size.value && size.value !== 24) {
|
||||||
attrs.push(`:size="${size.value}"`)
|
attrs.push(`:size="${size.value}"`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (color.value && color.value !== 'currentColor') {
|
if (color.value && color.value !== 'currentColor') {
|
||||||
attrs.push(`color="${color.value}"`)
|
attrs.push(`color="${color.value}"`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strokeWidth.value && strokeWidth.value !== 2) {
|
if (strokeWidth.value && strokeWidth.value !== 2) {
|
||||||
attrs.push(`:stroke-width="${strokeWidth.value}"`)
|
attrs.push(`:stroke-width="${strokeWidth.value}"`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (absoluteStrokeWidth.value) {
|
if (absoluteStrokeWidth.value) {
|
||||||
attrs.push(`absoluteStrokeWidth`)
|
attrs.push(`absoluteStrokeWidth`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const code = `<${componentName.value}${attrs.join(' ')} />`
|
const code = `<${componentName.value}${attrs.join(' ')} />`;
|
||||||
|
|
||||||
navigator.clipboard.writeText(code)
|
navigator.clipboard.writeText(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
function copyAngular() {
|
function copyAngular() {
|
||||||
let attrs = ['']
|
let attrs = [''];
|
||||||
|
|
||||||
attrs.push(`name="${props.name}"`)
|
attrs.push(`name="${props.name}"`);
|
||||||
|
|
||||||
if (size.value && size.value !== 24) {
|
if (size.value && size.value !== 24) {
|
||||||
attrs.push(`[size]="${size.value}"`)
|
attrs.push(`[size]="${size.value}"`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (color.value && color.value !== 'currentColor') {
|
if (color.value && color.value !== 'currentColor') {
|
||||||
attrs.push(`color="${color.value}"`)
|
attrs.push(`color="${color.value}"`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strokeWidth.value && strokeWidth.value !== 2) {
|
if (strokeWidth.value && strokeWidth.value !== 2) {
|
||||||
attrs.push(`[strokeWidth]="${strokeWidth.value}"`)
|
attrs.push(`[strokeWidth]="${strokeWidth.value}"`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (absoluteStrokeWidth.value) {
|
if (absoluteStrokeWidth.value) {
|
||||||
attrs.push(`[absoluteStrokeWidth]="true"`)
|
attrs.push(`[absoluteStrokeWidth]="true"`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const code = `<lucide-icon${attrs.join(' ')}></lucide-icon>`
|
const code = `<lucide-icon${attrs.join(' ')}></lucide-icon>`;
|
||||||
|
|
||||||
navigator.clipboard.writeText(code)
|
navigator.clipboard.writeText(code);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -18,9 +18,8 @@ import RelatedIcons from '~/.vitepress/theme/components/icons/RelatedIcons.vue'
|
|||||||
import CodeGroup from '~/.vitepress/theme/components/base/CodeGroup.vue'
|
import CodeGroup from '~/.vitepress/theme/components/base/CodeGroup.vue'
|
||||||
import Badge from '~/.vitepress/theme/components/base/Badge.vue'
|
import Badge from '~/.vitepress/theme/components/base/Badge.vue'
|
||||||
import Label from '~/.vitepress/theme/components/base/Label.vue'
|
import Label from '~/.vitepress/theme/components/base/Label.vue'
|
||||||
import VPButton from 'vitepress/dist/client/theme-default/components/VPButton.vue';
|
|
||||||
import { data } from './codeExamples.data'
|
import { data } from './codeExamples.data'
|
||||||
import { camelCase, startCase } from 'lodash-es'
|
import { toCamelCase, toPascalCase } from '@lucide/shared'
|
||||||
import { satisfies } from 'semver'
|
import { satisfies } from 'semver'
|
||||||
|
|
||||||
const { params } = useData()
|
const { params } = useData()
|
||||||
@@ -31,8 +30,8 @@ const tabs = computed(() => data.codeExamples?.map(
|
|||||||
|
|
||||||
const codeExample = computed(() => data.codeExamples?.map(
|
const codeExample = computed(() => data.codeExamples?.map(
|
||||||
(codeExample) => {
|
(codeExample) => {
|
||||||
const pascalCaseName = startCase(camelCase( params.value.name)).replace(/\s/g, '')
|
const pascalCaseName = toPascalCase( params.value.name)
|
||||||
const camelCaseName = camelCase(params.value.name)
|
const camelCaseName = toCamelCase(params.value.name)
|
||||||
|
|
||||||
return codeExample.code
|
return codeExample.code
|
||||||
.replace(/\$(?:<[^>]+>)*PascalCase/g, pascalCaseName)
|
.replace(/\$(?:<[^>]+>)*PascalCase/g, pascalCaseName)
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
stroke-linecap="round"
|
stroke-linecap="round"
|
||||||
stroke-linejoin="round"
|
stroke-linejoin="round"
|
||||||
>
|
>
|
||||||
<path d="M5.5 8.5 9 12l-3.5 3.5L2 12l3.5-3.5Z" />
|
<path d="M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z" />
|
||||||
<path d="m12 2 3.5 3.5L12 9 8.5 5.5 12 2Z" />
|
<path d="M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z" />
|
||||||
<path d="M18.5 8.5 22 12l-3.5 3.5L15 12l3.5-3.5Z" />
|
<path d="M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z" />
|
||||||
<path d="m12 15 3.5 3.5L12 22l-3.5-3.5L12 15Z" />
|
<path d="M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 415 B After Width: | Height: | Size: 763 B |
@@ -5,7 +5,8 @@
|
|||||||
"csandman",
|
"csandman",
|
||||||
"ericfennis",
|
"ericfennis",
|
||||||
"karsa-mistmere",
|
"karsa-mistmere",
|
||||||
"danielbayley"
|
"danielbayley",
|
||||||
|
"jguddas"
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"box",
|
"box",
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
stroke-linecap="round"
|
stroke-linecap="round"
|
||||||
stroke-linejoin="round"
|
stroke-linejoin="round"
|
||||||
>
|
>
|
||||||
<path d="m7.5 4.27 9 5.15" />
|
<path d="M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z" />
|
||||||
<path d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z" />
|
|
||||||
<path d="m3.3 7 8.7 5 8.7-5" />
|
|
||||||
<path d="M12 22V12" />
|
<path d="M12 22V12" />
|
||||||
|
<path d="m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7" />
|
||||||
|
<path d="m7.5 4.27 9 5.15" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 433 B After Width: | Height: | Size: 460 B |
@@ -1,7 +1,8 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../icon.schema.json",
|
"$schema": "../icon.schema.json",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
"danielbayley"
|
"danielbayley",
|
||||||
|
"jguddas"
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"driving",
|
"driving",
|
||||||
|
|||||||
@@ -9,9 +9,9 @@
|
|||||||
stroke-linecap="round"
|
stroke-linecap="round"
|
||||||
stroke-linejoin="round"
|
stroke-linejoin="round"
|
||||||
>
|
>
|
||||||
<path d="M9 9a3 3 0 1 1 6 0" />
|
|
||||||
<path d="M12 12v3" />
|
|
||||||
<path d="M11 15h2" />
|
<path d="M11 15h2" />
|
||||||
<path d="M19 9a7 7 0 1 0-13.6 2.3C6.4 14.4 8 19 8 19h8s1.6-4.6 2.6-7.7c.3-.8.4-1.5.4-2.3" />
|
<path d="M12 12v3" />
|
||||||
<path d="M12 19v3" />
|
<path d="M12 19v3" />
|
||||||
|
<path d="M15.282 19a1 1 0 0 0 .948-.68l2.37-6.988a7 7 0 1 0-13.2 0l2.37 6.988a1 1 0 0 0 .948.68z" />
|
||||||
|
<path d="M9 9a3 3 0 1 1 6 0" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 409 B After Width: | Height: | Size: 417 B |
@@ -1,7 +1,8 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../icon.schema.json",
|
"$schema": "../icon.schema.json",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
"kemie"
|
"kemie",
|
||||||
|
"jamiemlaw"
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"food",
|
"food",
|
||||||
|
|||||||
@@ -9,8 +9,9 @@
|
|||||||
stroke-linecap="round"
|
stroke-linecap="round"
|
||||||
stroke-linejoin="round"
|
stroke-linejoin="round"
|
||||||
>
|
>
|
||||||
<path d="M3 11v3a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1v-3" />
|
<path d="m2.37 11.223 8.372-6.777a2 2 0 0 1 2.516 0l8.371 6.777" />
|
||||||
<path d="M12 19H4a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-3.83" />
|
<path d="M21 15a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-5.25" />
|
||||||
<path d="m3 11 7.77-6.04a2 2 0 0 1 2.46 0L21 11H3Z" />
|
<path d="M3 15a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h9" />
|
||||||
<path d="M12.97 19.77 7 15h12.5l-3.75 4.5a2 2 0 0 1-2.78.27Z" />
|
<path d="m6.67 15 6.13 4.6a2 2 0 0 0 2.8-.4l3.15-4.2" />
|
||||||
|
<rect width="20" height="4" x="2" y="11" rx="1" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 483 B After Width: | Height: | Size: 501 B |
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"name": "@lucide/monorepo",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "pnpm -r --filter './packages/**' build",
|
"build": "pnpm -r --filter './packages/**' build",
|
||||||
|
|||||||
@@ -9,6 +9,17 @@ import { CamelToPascal } from './utility-types';
|
|||||||
export const toKebabCase = (string: string) =>
|
export const toKebabCase = (string: string) =>
|
||||||
string.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
|
string.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts string to camel case
|
||||||
|
*
|
||||||
|
* @param {string} string
|
||||||
|
* @returns {string} A camelized string
|
||||||
|
*/
|
||||||
|
export const toCamelCase = <T extends string>(string: T) =>
|
||||||
|
string.replace(/^([A-Z])|[\s-_]+(\w)/g, (match, p1, p2) =>
|
||||||
|
p2 ? p2.toUpperCase() : p1.toLowerCase(),
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts string to pascal case
|
* Converts string to pascal case
|
||||||
*
|
*
|
||||||
@@ -16,9 +27,7 @@ export const toKebabCase = (string: string) =>
|
|||||||
* @returns {string} A pascalized string
|
* @returns {string} A pascalized string
|
||||||
*/
|
*/
|
||||||
export const toPascalCase = <T extends string>(string: T): CamelToPascal<T> => {
|
export const toPascalCase = <T extends string>(string: T): CamelToPascal<T> => {
|
||||||
const camelCase = string.replace(/^([A-Z])|[\s-_]+(\w)/g, (match, p1, p2) =>
|
const camelCase = toCamelCase(string);
|
||||||
p2 ? p2.toUpperCase() : p1.toLowerCase(),
|
|
||||||
);
|
|
||||||
|
|
||||||
return (camelCase.charAt(0).toUpperCase() + camelCase.slice(1)) as CamelToPascal<T>;
|
return (camelCase.charAt(0).toUpperCase() + camelCase.slice(1)) as CamelToPascal<T>;
|
||||||
};
|
};
|
||||||
|
|||||||
6
release.config.mjs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
/**
|
||||||
|
* @type {import('semantic-release').GlobalConfig}
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
branches: ['main', 'new-release-workflow'],
|
||||||
|
};
|
||||||