docs: add readme for setup-apt and os-env

This commit is contained in:
Amin Yahyaabadi 2024-08-16 02:01:51 -07:00
parent dc74686724
commit 1865b24b57
No known key found for this signature in database
GPG Key ID: F52AF77F636088F0
15 changed files with 307 additions and 136 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,8 @@
"name": "ci-log",
"version": "1.0.0",
"description": "Colorful logging and print for any environment including GitHub Actions",
"homepage": "https://github.com/aminya/setup-cpp",
"repository": "https://github.com/aminya/setup-cpp",
"homepage": "https://github.com/aminya/setup-cpp/tree/master/packages/ci-log",
"license": "Apache-2.0",
"author": "Amin Yahyaabadi",
"main": "./dist/index.js",

View File

@ -2,7 +2,8 @@
"name": "exec-powershell",
"version": "1.0.0",
"description": "Run a powershell command.",
"homepage": "https://github.com/aminya/setup-cpp",
"repository": "https://github.com/aminya/setup-cpp",
"homepage": "https://github.com/aminya/setup-cpp/tree/master/packages/exec-powershell",
"license": "Apache-2.0",
"author": "Amin Yahyaabadi",
"main": "./dist/index.js",
@ -13,8 +14,9 @@
"lint.eslint": "eslint **/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/ --fix"
},
"dependencies": {
"execa": "<8",
"which": "^4.0.0"
"execa": "^7",
"which": "^4.0.0",
"@types/node": "^14"
},
"devDependencies": {
"@types/which": "^3.0.0"

85
packages/os-env/README.md Normal file
View File

@ -0,0 +1,85 @@
<h1 align="center">os-env</h1>
<p>
<img alt="Version" src="https://img.shields.io/badge/version-1.0.0-blue.svg?cacheSeconds=2592000" />
<img src="https://img.shields.io/badge/node-%3E%3D12-blue.svg" />
<a href="#" target="_blank">
<img alt="License: Apache--2.0" src="https://img.shields.io/badge/License-Apache--2.0-yellow.svg" />
</a>
</p>
> Manage environment variables, PATH, and rc files
## Install
```sh
npm install --save os-env
```
## Usage
<!-- INSERT GENERATED DOCS START -->
### `defaultRcPath` (variable)
### `RcOptions` (type)
### `sourceRCInRc` (variable)
handles adding conditions to source rc file from .bashrc and .profile
### `finalizeRC` (function)
**Parameters:**
- rcOptions (`RcOptions`)
**returns:** Promise<void>
### `escapeString` (function)
**Parameters:**
- valGiven (`string`)
- shouldEscapeSpace (`boolean`)
**returns:** any
### `AddEnvOptions` (type)
### `addEnv` (function)
Add an environment variable.
This function is cross-platforms and works in all the local or CI systems.
**Parameters:**
- name (`string`)
- valGiven (`string`)
- givenOptions (`Partial<AddEnvOptions>`)
**returns:** Promise<void>
### `addPath` (function)
Add a path to the PATH environment variable.
This function is cross-platforms and works in all the local or CI systems.
**Parameters:**
- path (`string`)
- givenOptions (`Partial<AddPathOptions>`)
**returns:** Promise<void>
<!-- INSERT GENERATED DOCS END -->
## 🤝 Contributing
You can sponsor my work here:
https://github.com/sponsors/aminya
Pull requests, issues and feature requests are welcome.
See the [Contributing guide](https://github.com/aminya/setup-cpp/blob/master/CONTRIBUTING.md).

View File

@ -2,7 +2,8 @@
"name": "os-env",
"version": "1.0.0",
"description": "Manage environment variables, PATH, and rc files",
"homepage": "https://github.com/aminya/setup-cpp",
"repository": "https://github.com/aminya/setup-cpp",
"homepage": "https://github.com/aminya/setup-cpp/tree/master/packages/os-env",
"license": "Apache-2.0",
"author": "Amin Yahyaabadi",
"main": "./dist/index.js",

View File

@ -0,0 +1,102 @@
<h1 align="center">setup-apt</h1>
<p>
<img alt="Version" src="https://img.shields.io/badge/version-1.0.0-blue.svg?cacheSeconds=2592000" />
<img src="https://img.shields.io/badge/node-%3E%3D12-blue.svg" />
<a href="#" target="_blank">
<img alt="License: Apache--2.0" src="https://img.shields.io/badge/License-Apache--2.0-yellow.svg" />
</a>
</p>
> Setup apt packages and repositories in Debian/Ubuntu-based distributions
## Install
```sh
npm install --save setup-apt
```
## Usage
<!-- INSERT GENERATED DOCS START -->
### `InstallationInfo` (type)
### `aptTimeout` (variable)
### `AptPackage` (type)
### `installAptPack` (function)
A function that installs a package using apt
**Parameters:**
- packages (`AptPackage[]`)
- update (`boolean`)
**returns:** Promise<InstallationInfo>
### `hasNala` (function)
**returns:** boolean
### `getApt` (function)
**returns:** string
### `addAptKeyViaServer` (function)
**Parameters:**
- keys (`string[]`)
- name (`string`)
- server (`string`)
**returns:** Promise<string>
### `addAptKeyViaDownload` (function)
**Parameters:**
- name (`string`)
- url (`string`)
**returns:** Promise<string>
### `updateAptAlternatives` (function)
**Parameters:**
- name (`string`)
- path (`string`)
- rcOptions (`RcOptions`)
- priority (`number`)
**returns:** Promise<void>
### `isAptPackInstalled` (function)
**Parameters:**
- pack (`string`)
**returns:** Promise<boolean>
### `isAptPackRegexInstalled` (function)
**Parameters:**
- regexp (`string`)
**returns:** Promise<boolean>
<!-- INSERT GENERATED DOCS END -->
## 🤝 Contributing
You can sponsor my work here:
https://github.com/sponsors/aminya
Pull requests, issues and feature requests are welcome.
See the [Contributing guide](https://github.com/aminya/setup-cpp/blob/master/CONTRIBUTING.md).

View File

@ -2,7 +2,8 @@
"name": "setup-apt",
"version": "1.0.0",
"description": "Setup apt packages and repositories in Debian/Ubuntu-based distributions",
"homepage": "https://github.com/aminya/setup-cpp",
"repository": "https://github.com/aminya/setup-cpp",
"homepage": "https://github.com/aminya/setup-cpp/tree/master/packages/setup-apt",
"license": "Apache-2.0",
"author": "Amin Yahyaabadi",
"main": "./dist/index.js",

View File

@ -33,7 +33,7 @@ Replaces a tilde with the user's home directory
**returns:** string
```tsx
UntildifyUser("~/foo") // /home/user/foo
UntildifyUser('~/foo'); // /home/user/foo
```
<!-- INSERT GENERATED DOCS END -->

View File

@ -2,7 +2,8 @@
"name": "untildify-user",
"version": "1.0.0",
"description": "Untildify a path for the current user even if it is root",
"homepage": "https://github.com/aminya/setup-cpp",
"repository": "https://github.com/aminya/setup-cpp",
"homepage": "https://github.com/aminya/setup-cpp/tree/master/packages/untildify-user",
"license": "Apache-2.0",
"author": "Amin Yahyaabadi",
"main": "./dist/index.js",

View File

@ -233,9 +233,12 @@ importers:
packages/exec-powershell:
dependencies:
'@types/node':
specifier: ^14
version: 14.18.63
execa:
specifier: <8
version: 7.1.1
specifier: ^7
version: 7.2.0
which:
specifier: ^4.0.0
version: 4.0.0
@ -1651,6 +1654,9 @@ packages:
'@types/node@12.20.55':
resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==}
'@types/node@14.18.63':
resolution: {integrity: sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==}
'@types/node@18.19.44':
resolution: {integrity: sha512-ZsbGerYg72WMXUIE9fYxtvfzLEuq6q8mKERdWFnqTmOvudMxnz+CBNRoOwJ2kNpFOncrKjT1hZwxjlFgQ9qvQA==}
@ -2935,10 +2941,6 @@ packages:
resolution: {integrity: sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
execa@7.1.1:
resolution: {integrity: sha512-wH0eMf/UXckdUYnO21+HDztteVv05rq2GXksxT4fCGeHkBhw1DROXh40wcjMcRqDOWE7iPJ4n3M7e2+YFP+76Q==}
engines: {node: ^14.18.0 || ^16.14.0 || >=18.0.0}
execa@7.2.0:
resolution: {integrity: sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==}
engines: {node: ^14.18.0 || ^16.14.0 || >=18.0.0}
@ -4222,10 +4224,6 @@ packages:
resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==}
engines: {node: '>=8'}
npm-run-path@5.2.0:
resolution: {integrity: sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
npm-run-path@5.3.0:
resolution: {integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
@ -7145,6 +7143,8 @@ snapshots:
'@types/node@12.20.55': {}
'@types/node@14.18.63': {}
'@types/node@18.19.44':
dependencies:
undici-types: 5.26.5
@ -8872,18 +8872,6 @@ snapshots:
signal-exit: 3.0.7
strip-final-newline: 3.0.0
execa@7.1.1:
dependencies:
cross-spawn: 7.0.3
get-stream: 6.0.1
human-signals: 4.3.1
is-stream: 3.0.0
merge-stream: 2.0.0
npm-run-path: 5.2.0
onetime: 6.0.0
signal-exit: 3.0.7
strip-final-newline: 3.0.0
execa@7.2.0:
dependencies:
cross-spawn: 7.0.3
@ -10401,10 +10389,6 @@ snapshots:
dependencies:
path-key: 3.1.1
npm-run-path@5.2.0:
dependencies:
path-key: 4.0.0
npm-run-path@5.3.0:
dependencies:
path-key: 4.0.0