Skip to content

Commit

Permalink
breaking: ESM only 🎉
Browse files Browse the repository at this point in the history
  • Loading branch information
mesqueeb committed Jun 1, 2024
1 parent cb55918 commit c9f5b73
Show file tree
Hide file tree
Showing 19 changed files with 6,058 additions and 8,884 deletions.
12 changes: 12 additions & 0 deletions .github/SPONSORS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: mesqueeb
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
37 changes: 37 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Test
on:
push:
branches: main
paths:
- src/**
- test/**
- '*.js'
- '*.ts'
- '*.json'
- .github/workflows/test.yml
pull_request:
branches: main
paths:
- src/**
- test/**
- '*.js'
- '*.ts'
- '*.json'
- .github/workflows/test.yml
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
strategy:
matrix:
node-version: ['18', '20']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm ci
- run: npm test
9 changes: 0 additions & 9 deletions .prettierrc

This file was deleted.

3 changes: 3 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import prettier from "@cycraft/eslint/prettier"

export default prettier
11 changes: 5 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
"[typescript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
"eslint.validate": ["javascript", "typescript"],
"editor.tabSize": 2, // make sure this is the same as .prettierrc
"files.trimFinalNewlines": true,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"editor.insertSpaces": true
"javascript.preferences.importModuleSpecifierEnding": "js",
"typescript.preferences.importModuleSpecifierEnding": "js"
}
133 changes: 0 additions & 133 deletions dist/cjs/index.cjs

This file was deleted.

32 changes: 15 additions & 17 deletions dist/cjs/index.d.cts → dist/core.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @example
* camelCase('$catDog', { keepSpecialCharacters: true }) === '$catDog'
*/
declare function camelCase(string: string, options?: {
export declare function camelCase(string: string, options?: {
keepSpecialCharacters?: boolean;
keep?: string[];
}): string;
Expand All @@ -24,7 +24,7 @@ declare function camelCase(string: string, options?: {
* @example
* pascalCase('$catDog', { keepSpecialCharacters: true }) === '$CatDog'
*/
declare function pascalCase(string: string, options?: {
export declare function pascalCase(string: string, options?: {
keepSpecialCharacters?: boolean;
keep?: string[];
}): string;
Expand All @@ -39,7 +39,7 @@ declare function pascalCase(string: string, options?: {
* @example
* upperCamelCase('$catDog', { keepSpecialCharacters: true }) === '$CatDog'
*/
declare const upperCamelCase: typeof pascalCase;
export declare const upperCamelCase: typeof pascalCase;
/**
* # 🥙 kebab-case
* converts a string to kebab-case
Expand All @@ -51,7 +51,7 @@ declare const upperCamelCase: typeof pascalCase;
* @example
* kebabCase('$catDog', { keepSpecialCharacters: true }) === '$cat-dog'
*/
declare function kebabCase(string: string, options?: {
export declare function kebabCase(string: string, options?: {
keepSpecialCharacters?: boolean;
keep?: string[];
}): string;
Expand All @@ -66,7 +66,7 @@ declare function kebabCase(string: string, options?: {
* @example
* snakeCase('$catDog', { keepSpecialCharacters: true }) === '$cat_dog'
*/
declare function snakeCase(string: string, options?: {
export declare function snakeCase(string: string, options?: {
keepSpecialCharacters?: boolean;
keep?: string[];
}): string;
Expand All @@ -81,7 +81,7 @@ declare function snakeCase(string: string, options?: {
* @example
* constantCase('$catDog', { keepSpecialCharacters: true }) === '$CAT_DOG'
*/
declare function constantCase(string: string, options?: {
export declare function constantCase(string: string, options?: {
keepSpecialCharacters?: boolean;
keep?: string[];
}): string;
Expand All @@ -96,7 +96,7 @@ declare function constantCase(string: string, options?: {
* @example
* trainCase('$catDog', { keepSpecialCharacters: true }) === '$Cat-Dog'
*/
declare function trainCase(string: string, options?: {
export declare function trainCase(string: string, options?: {
keepSpecialCharacters?: boolean;
keep?: string[];
}): string;
Expand All @@ -111,7 +111,7 @@ declare function trainCase(string: string, options?: {
* @example
* adaCase('$catDog', { keepSpecialCharacters: true }) === '$Cat_Dog'
*/
declare function adaCase(string: string, options?: {
export declare function adaCase(string: string, options?: {
keepSpecialCharacters?: boolean;
keep?: string[];
}): string;
Expand All @@ -126,7 +126,7 @@ declare function adaCase(string: string, options?: {
* @example
* cobolCase('$catDog', { keepSpecialCharacters: true }) === '$CAT-DOG'
*/
declare function cobolCase(string: string, options?: {
export declare function cobolCase(string: string, options?: {
keepSpecialCharacters?: boolean;
keep?: string[];
}): string;
Expand All @@ -141,7 +141,7 @@ declare function cobolCase(string: string, options?: {
* @example
* dotNotation('$catDog', { keepSpecialCharacters: true }) === '$cat.Dog'
*/
declare function dotNotation(string: string, options?: {
export declare function dotNotation(string: string, options?: {
keepSpecialCharacters?: boolean;
keep?: string[];
}): string;
Expand All @@ -156,7 +156,7 @@ declare function dotNotation(string: string, options?: {
* @example
* pathCase('$catDog', { keepSpecialCharacters: false }) === 'cat/Dog'
*/
declare function pathCase(string: string, options?: {
export declare function pathCase(string: string, options?: {
keepSpecialCharacters?: boolean;
keep?: string[];
}): string;
Expand All @@ -171,7 +171,7 @@ declare function pathCase(string: string, options?: {
* @example
* spaceCase('$catDog', { keepSpecialCharacters: false }) === 'cat Dog'
*/
declare function spaceCase(string: string, options?: {
export declare function spaceCase(string: string, options?: {
keepSpecialCharacters?: boolean;
keep?: string[];
}): string;
Expand All @@ -188,7 +188,7 @@ declare function spaceCase(string: string, options?: {
*
* ⟪ if you do not want to add spaces, use `pascalCase()` ⟫
*/
declare function capitalCase(string: string, options?: {
export declare function capitalCase(string: string, options?: {
keepSpecialCharacters?: boolean;
keep?: string[];
}): string;
Expand All @@ -205,7 +205,7 @@ declare function capitalCase(string: string, options?: {
*
* ⟪ if you do not want to add spaces, use the native JS `toLowerCase()` ⟫
*/
declare function lowerCase(string: string, options?: {
export declare function lowerCase(string: string, options?: {
keepSpecialCharacters?: boolean;
keep?: string[];
}): string;
Expand All @@ -222,9 +222,7 @@ declare function lowerCase(string: string, options?: {
*
* ⟪ if you do not want to add spaces, use the native JS `toUpperCase()` ⟫
*/
declare function upperCase(string: string, options?: {
export declare function upperCase(string: string, options?: {
keepSpecialCharacters?: boolean;
keep?: string[];
}): string;

export { adaCase, camelCase, capitalCase, cobolCase, constantCase, dotNotation, kebabCase, lowerCase, pascalCase, pathCase, snakeCase, spaceCase, trainCase, upperCamelCase, upperCase };
Loading

0 comments on commit c9f5b73

Please sign in to comment.