Skip to content

Commit

Permalink
feat: implement initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
herteleo committed Jun 28, 2023
0 parents commit 64f78a1
Show file tree
Hide file tree
Showing 11 changed files with 5,360 additions and 0 deletions.
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:
- main

permissions:
contents: read # for checkout

jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Install semantic-release
run: npm install -g semantic-release @semantic-release/git
- name: Install dependencies
run: npm ci
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: semantic-release --branches main --plugins @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/npm @semantic-release/github @semantic-release/git
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"dbaeumer.vscode-eslint"
]
}
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"prettier.enable": false,
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.organizeImports": false
}
}
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) 2023 Leonard Hertel

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.
88 changes: 88 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# cpycnf

> Define recurring file copy tasks in a config and execute them.
## Usage

### Global

```sh
npm install cpycnf --global
```
```sh
$ cpycnf
```

### Local

```sh
npm install cpycnf [--save-dev]
```

```sh
$ npx cpycnf
```

Add to `package.json`

```json
{
"name": "my-package",
"scripts": {
"copy": "cpycnf"
}
}
```

## Configuration

Add the `cpycnf` config to your `package.json` or a dedicated config file: `.cpycnfrc.{json,js,cjs}`, `.config/cpycnfrc`, `.config/cpycnfrc.{json,js,cjs}`, `cpycnf.config.{js,cjs}`

### Example

*One-to-one applicable to all `.json` config files.*

```json
{
"tasks": [
["node_modules/jquery/dist/jquery.min.*", "public/jquery"],
[
[
"node_modules/bootstrap/dist/js/bootstrap.bundle.min.*",
"node_modules/bootstrap/dist/css/bootstrap.min.*"
], "public/bootstrap", { "flat": true }
]
]
}
```

Every task in the `tasks` array consists of an array with a fixed structure:
```ts
type Task = [source: string | string[], destination: string, options: Options]
```
Under the hood `cpycnf` uses [cpy](https://github.com/sindresorhus/cpy#api).
Head over to [cpy#options](https://github.com/sindresorhus/cpy#options) for the options reference.
### Example package.json
```json
{
"name": "my-package",
// ...
"cpycnf": {
"tasks": [
// ...
]
}
}
```
### Example .js, .cjs
```js
module.exports = {
tasks: [
// ...
]
}
```
Loading

0 comments on commit 64f78a1

Please sign in to comment.