Skip to content

Commit

Permalink
feat: init
Browse files Browse the repository at this point in the history
  • Loading branch information
privatenumber committed Feb 5, 2023
0 parents commit 4eed637
Show file tree
Hide file tree
Showing 13 changed files with 3,730 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release

on:
push:
branches: [master, next, next-major, beta, alpha]

jobs:
release:
name: Release
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'

- name: Setup pnpm
uses: pnpm/action-setup@v2.2.2
with:
version: 7
run_install: true

- name: Lint
run: pnpm lint

- name: Type check
run: pnpm type-check

- name: Release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm dlx semantic-release
49 changes: 49 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Test

on:
push:
branches: [develop]
pull_request:
branches: [develop, master, next, next-major, beta, alpha]

jobs:
test:
name: Test
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

runs-on: ${{ matrix.os }}
timeout-minutes: 10

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'

- name: Setup pnpm
uses: pnpm/action-setup@v2.2.2
with:
version: 7
run_install: true

- name: Lint
if: ${{ matrix.os == 'ubuntu-latest' }}
run: pnpm lint

- name: Type check
if: ${{ matrix.os == 'ubuntu-latest' }}
run: pnpm type-check

- name: Build
run: pnpm build

- name: Test
run: pnpm test

- name: Test Node v12
run: pnpm --use-node-version=12.22.12 test
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# macOS
.DS_Store

# Logs
logs
*.log

# Node dependency directory
node_modules

# Output of 'npm pack'
*.tgz

# Distribution
dist

# Cache
.eslintcache
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.12.1
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) Hiroki Osame <hiroki.osame@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# is-fs-case-sensitive [![Latest version](https://badgen.net/npm/v/is-fs-case-sensitive)](https://npm.im/is-fs-case-sensitive) [![Install size](https://packagephobia.now.sh/badge?p=is-fs-case-sensitive)](https://packagephobia.now.sh/result?p=is-fs-case-sensitive)

Detect whether the file-system has case-sensitive file paths.

## 🙋‍♂️ Why?
File systems can have case-sensitive or case-insensitive file paths:

- [macOS is case-insensitive by default](https://support.apple.com/guide/disk-utility/file-system-formats-dsku19ed921c/mac#dsku127e6e61)
- [Windows is case-insensitive by default](https://learn.microsoft.com/en-us/windows/wsl/case-sensitivity)
- [Linux is case-sensitive](https://stackoverflow.com/a/26300931/911407)

This distinction is important for tools that navigate the file-system (e.g. whether to apply a glob case-sensitively).

## 🚀 Install
```sh
npm install is-fs-case-sensitive
```

## 👨🏻‍🏫 Examples

```ts
import { isFsCaseSensitive } from 'is-fs-case-sensitive'

console.log(isFsCaseSensitive())
// => false
```

## ⚙️ API

### isFsCaseSensitive(fs)

Returns: `boolean`

#### fs
Type: `typeof fs`

Default: `import('fs')`

The file-system to use to check for case-sensitivity.
73 changes: 73 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"name": "is-fs-case-sensitive",
"version": "0.0.0-semantic-release",
"description": "The missing is-fs-case-sensitive()",
"keywords": [
"fs",
"promise",
"promises",
"exists"
],
"license": "MIT",
"repository": "privatenumber/is-fs-case-sensitive",
"funding": "https://github.com/privatenumber/is-fs-case-sensitive?sponsor=1",
"author": {
"name": "Hiroki Osame",
"email": "hiroki.osame@gmail.com"
},
"type": "module",
"files": [
"dist"
],
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.cts",
"exports": {
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
},
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
}
},
"imports": {
"#is-fs-case-sensitive": {
"types": "./src/index.ts",
"development": "./src/index.ts",
"default": "./dist/index.mjs"
}
},
"scripts": {
"prepare": "simple-git-hooks",
"lint": "eslint --cache .",
"type-check": "tsc --noEmit",
"test": "tsx tests",
"dev": "tsx watch --conditions=development tests",
"build": "pkgroll --minify",
"prepack": "pnpm build && clean-pkg-json"
},
"simple-git-hooks": {
"pre-commit": "pnpm test && pnpm lint-staged"
},
"lint-staged": {
"*.ts": "pnpm lint"
},
"devDependencies": {
"@pvtnbr/eslint-config": "^0.33.0",
"@types/node": "^18.11.18",
"clean-pkg-json": "^1.2.0",
"eslint": "^8.30.0",
"lint-staged": "^13.1.0",
"manten": "^0.6.0",
"memfs": "^3.4.12",
"pkgroll": "^1.8.0",
"simple-git-hooks": "^2.8.1",
"tsx": "^3.12.1",
"typescript": "^4.9.4"
},
"eslintConfig": {
"extends": "@pvtnbr"
}
}
Loading

0 comments on commit 4eed637

Please sign in to comment.