feat: migrate to starlight

This commit is contained in:
DuroCodes
2024-05-06 17:15:30 -04:00
parent 767acedea7
commit bb190f2d81
15140 changed files with 2828326 additions and 35408 deletions

21
node_modules/preferred-pm/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2018-2022 Zoltan Kochan <z@kochan.io>
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
node_modules/preferred-pm/README.md generated vendored Normal file
View File

@@ -0,0 +1,39 @@
# preferred-pm
> Returns the preferred package manager of a project
[![npm version](https://img.shields.io/npm/v/preferred-pm.svg)](https://www.npmjs.com/package/preferred-pm)
* Inside a Yarn workspace, Yarn is preferred.
* Inside a pnpm workspace, pnpm is preferred.
* If a `package-lock.json` is present, npm is preferred.
* If a `yarn.lock` is present, Yarn is preferred.
* If a `pnpm-lock.yaml` is present, pnpm is preferred.
* If a `bun.lockb` is present, Bun is preferred.
* If a `node_modules` is present, tries to detect which package manager installed it.
## Installation
```
<pnpm|yarn|npm|bun> add preferred-pm
```
## Usage
```js
'use strict'
const preferredPM = require('preferred-pm')
preferredPM(process.cwd())
.then(pm => console.log(pm))
//> {name: "npm", version: ">=5"}
```
## Related
* [which-pm](https://github.com/zkochan/packages/tree/main/which-pm) - Detects what package manager was used for installation
* [which-pm-runs](https://github.com/zkochan/packages/tree/main/which-pm-runs) - Detects what package manager executes the process
## License
[MIT](LICENSE) © [Zoltan Kochan](https://kochan.io)

3
node_modules/preferred-pm/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
export = preferredPM
declare function preferredPM (pkgPath: string): Promise<{ name: 'npm' | 'pnpm' | 'yarn' | 'bun', version: string } | undefined>

65
node_modules/preferred-pm/index.js generated vendored Normal file
View File

@@ -0,0 +1,65 @@
'use strict'
const findYarnWorkspaceRoot = require('find-yarn-workspace-root2')
const findUp = require('find-up')
const path = require('path')
const pathExists = require('path-exists')
const whichPM = require('which-pm')
module.exports = async function preferredPM (pkgPath) {
if (typeof pkgPath !== 'string') {
throw new TypeError(`pkgPath should be a string, got ${typeof pkgPath}`)
}
if (await pathExists(path.join(pkgPath, 'package-lock.json'))) {
return {
name: 'npm',
version: '>=5'
}
}
if (await pathExists(path.join(pkgPath, 'yarn.lock'))) {
return {
name: 'yarn',
version: '*'
}
}
if (await pathExists(path.join(pkgPath, 'pnpm-lock.yaml'))) {
return {
name: 'pnpm',
version: '>=3'
}
}
if (await pathExists(path.join(pkgPath, 'shrinkwrap.yaml'))) {
return {
name: 'pnpm',
version: '1 || 2'
}
}
if (await pathExists(path.join(pkgPath, 'bun.lockb'))) {
return {
name: 'bun',
version: '*'
}
}
if (await findUp('pnpm-lock.yaml', { cwd: pkgPath })) {
return {
name: 'pnpm',
version: '>=3'
}
}
try {
const workspaceRoot = findYarnWorkspaceRoot(pkgPath)
if (typeof workspaceRoot === 'string') {
if (await pathExists(path.join(workspaceRoot, 'package-lock.json'))) {
return {
name: 'npm',
version: '>=7'
}
}
return {
name: 'yarn',
version: '*'
}
}
} catch (err) {}
const pm = await whichPM(pkgPath)
return pm && { name: pm.name, version: pm.version || '*' }
}

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2017-present Zoltan Kochan <z@kochan.io>
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.

View File

@@ -0,0 +1,34 @@
# which-pm
> Detects what package manager was used for installation
[![npm version](https://img.shields.io/npm/v/which-pm.svg)](https://www.npmjs.com/package/which-pm)
Can detect [npm](https://github.com/npm/cli), [pnpm](https://github.com/pnpm/pnpm) and [yarn](https://github.com/yarnpkg/yarn).
## Installation
```bash
<pnpm|yarn|npm> add which-pm
```
## Usage
```js
'use strict'
const whichpm = require('which-pm')
whichpm(process.cwd())
.then(pm => console.log(pm))
.catch(err => console.error(err))
//> {name: "pnpm", version: "0.64.2"}
```
## Related
* [preferred-pm](https://github.com/zkochan/packages/tree/master/preferred-pm) - Returns the preferred package manager of a project
* [which-pm-runs](https://github.com/zkochan/packages/tree/master/which-pm-runs) - Detects what package manager executes the process
## License
[MIT](LICENSE) © [Zoltan Kochan](https://kochan.io)

View File

@@ -0,0 +1,25 @@
declare function whichpm (pkgPath: string): Promise<whichpm.Result>
declare namespace whichpm {
type Result = NPM | YARN | PNPM | Other
interface NPM {
readonly name: 'npm'
}
interface YARN {
readonly name: 'yarn'
}
interface PNPM {
readonly name: 'pnpm'
readonly version: string
}
interface Other {
readonly name: string
readonly version?: string
}
}
export = whichpm

View File

@@ -0,0 +1,36 @@
'use strict'
const path = require('path')
const pathExists = require('path-exists')
const loadYamlFile = require('load-yaml-file')
module.exports = async function (pkgPath) {
const modulesPath = path.join(pkgPath, 'node_modules')
const exists = await pathExists(path.join(modulesPath, '.yarn-integrity'))
if (exists) return { name: 'yarn' }
try {
const modules = await loadYamlFile(path.join(modulesPath, '.modules.yaml'))
return toNameAndVersion(modules.packageManager)
} catch (err) {
if (err.code !== 'ENOENT') throw err
}
const modulesExists = await pathExists(modulesPath)
return modulesExists ? { name: 'npm' } : null
}
function toNameAndVersion (pkgSpec) {
if (pkgSpec[0] === '@') {
const woPrefix = pkgSpec.substr(1)
const parts = woPrefix.split('@')
return {
name: `@${parts[0]}`,
version: parts[1]
}
}
const parts = pkgSpec.split('@')
return {
name: parts[0],
version: parts[1]
}
}

View File

@@ -0,0 +1,37 @@
{
"name": "which-pm",
"version": "2.0.0",
"description": "Detects what package manager was used for installation",
"main": "index.js",
"types": "index.d.ts",
"files": [
"index.js",
"index.d.ts"
],
"scripts": {
"test": "standard && preview && node test"
},
"engines": {
"node": ">=8.15"
},
"repository": "https://github.com/zkochan/packages/tree/master/which-pm",
"bugs": {
"url": "https://github.com/zkochan/packages/labels/package%3A%20which-pm"
},
"keywords": [
"npm",
"pnpm",
"yarn"
],
"author": "Zoltan Kochan",
"license": "MIT",
"dependencies": {
"load-yaml-file": "^0.2.0",
"path-exists": "^4.0.0"
},
"devDependencies": {
"package-preview": "2.0.0",
"standard": "^12.0.1",
"tape": "^4.8.0"
}
}

50
node_modules/preferred-pm/package.json generated vendored Normal file
View File

@@ -0,0 +1,50 @@
{
"name": "preferred-pm",
"version": "3.1.3",
"description": "Detects what package manager was used for installation",
"main": "index.js",
"files": [
"index.js",
"index.d.ts"
],
"engines": {
"node": ">=10"
},
"repository": "https://github.com/zkochan/packages/tree/main/preferred-pm",
"bugs": {
"url": "https://github.com/zkochan/packages/labels/package%3A%20preferred-pm"
},
"keywords": [
"npm",
"pnpm",
"yarn"
],
"author": {
"name": "Zoltan Kochan",
"email": "z@kochan.io",
"url": "https://www.kochan.io/",
"twitter": "ZoltanKochan"
},
"license": "MIT",
"dependenciesMeta": {
"preferred-pm": {
"injected": true
}
},
"dependencies": {
"find-up": "^5.0.0",
"find-yarn-workspace-root2": "1.2.16",
"path-exists": "^4.0.0",
"which-pm": "2.0.0"
},
"devDependencies": {
"ncp": "^2.0.0",
"preferred-pm": "file:",
"standard": "^16.0.4",
"tape": "^5.3.2",
"tempy": "^1.0.1"
},
"scripts": {
"test": "standard && node test"
}
}