Skip to content

Commit

Permalink
rewrite from scratch
Browse files Browse the repository at this point in the history
add typescript
add anca
add devcontainer
  • Loading branch information
TimurRin committed Jul 19, 2024
1 parent 935ae0d commit 333d1c7
Show file tree
Hide file tree
Showing 32 changed files with 2,208 additions and 1,809 deletions.
3 changes: 3 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM docker.io/node:22.4.0

USER node
16 changes: 16 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"build": {
"context": ".",
"dockerfile": "./Dockerfile"
},
"customizations": {
"vscode": {
"extensions": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"streetsidesoftware.code-spell-checker"
]
}
},
"name": "Node.js 22"
}
21 changes: 0 additions & 21 deletions .github/workflows/publish-npm.yml

This file was deleted.

61 changes: 61 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Release

on:
release:
types: [created]

jobs:
publish-npm:
runs-on: ubuntu-latest
name: "Publish package to npm registry"
steps:
- uses: actions/checkout@v4
name: "Checkout repo"
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org/
name: "Install Node.js"
- run: npm ci
name: "Install dependencies"
- run: npm test
name: "Run tests"
- run: npm run build
name: "Build distribution bundle"
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
name: "Publish to registry"
build-executables:
permissions: write-all
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
name: Build executables on ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
name: Checkout repo
- uses: actions/setup-node@v4
with:
node-version: 22
name: Install Node.js
- run: npm ci
name: Install dependencies
- run: npm run build:sea
name: Build executables
- run: |
EXT=""
if [ "${{ matrix.os }}" == "windows-latest" ]; then
EXT=".exe"
fi
mv build/sea/app${EXT} build/sea/${{ github.event.repository.name }}-${{ github.ref_name }}-${{ runner.arch }}${EXT}
shell: bash
name: Rename executable
- uses: softprops/action-gh-release@v1
with:
files: |
build/sea/${{ github.event.repository.name }}-${{ github.ref_name }}-${{ runner.arch }}${{ matrix.os == 'windows-latest' && '.exe' || '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: Attach executables to release
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Test

on:
push:
branches: ["**"]

jobs:
test-commit:
runs-on: ubuntu-latest
strategy:
matrix:
node: [18, 20, 22]
name: Test repo on Node.js ${{ matrix.node }}
steps:
- uses: actions/checkout@v4
name: "Checkout repo"
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
registry-url: https://registry.npmjs.org/
name: "Install Node.js"
- run: npm ci
name: "Install dependencies"
- run: npm test
name: "Run tests"
53 changes: 37 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
*.local

# Editor directories and files
.idea
.DS_Store
Expand All @@ -20,15 +8,48 @@ node_modules
*.sw?
.vscode

# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Temp folder
tmp

# Built sources
/dist
/build
*.spec

# Dependency directories
node_modules/
jspm_packages/
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
.yarn-integrity

# Local settings
.env
config.json
.env.development.local
.env.test.local
.env.production.local
.env.local

# Node.js logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Data
/data
/public/assets
# Output of 'npm pack'
*.tgz
21 changes: 20 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
# General
**/.git
**/.svn
**/.hg

# Binaries
/bin

# Devcontainer
.devcontainer

# Node.js
**/node_modules
package-lock.json
src/cinnabar.js

# Distributions
/build
/dist

# Cinnabar Meta
**/cinnabar.js
**/cinnabar.ts
cinnabar.json

# Anca
anca.json
16 changes: 16 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or create a pull request.

## Installation

We support [Devcontainers](https://containers.dev/). You can use the provided development container to work on this project. The development container includes all the necessary tools and dependencies to work on this project.

Otherwise, download, install and configure [Node.js](https://nodejs.org/en/download/).

Then, run the following commands to install the dependencies and run the tests:

```bash
npm ci
npm test
```
49 changes: 12 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,31 @@
# Cinnabar Forge Meta
# @cinnabar-forge/meta

**DISCLAIMER**: Until version 1.0.0, all versions below should be considered unstable and are subject to change.
> **DISCLAIMER**: This project is not production ready. All versions below 1.0.0 should be considered unstable
A Node.js CLI tool designed to manage project configurations and versions efficiently. This tool provides an interactive CLI for updating project metadata and managing versions with semantic versioning.
Configuration editor and version updater

## Features
## Installation

- Interactive CLI for easy management of project settings.
- Supports updating project metadata such as name, description, and version.
- Automated version management including dev, patch, minor, and major updates.
- Git integration for committing changes, tagging versions, and pushing updates.
### Binary

## Getting Started
[Get the latest binaries](https://example.com/github/user/app-name/releases/latest).

### Installation
If you want to use the app with a command line, rename it to `@cinnabar-forge/meta` or `@cinnabar-forge/meta.exe` and add the location to `PATH`.

Install globally using npm:
### npm

```bash
npm install -g @cinnabar-forge/meta
```

This will make the `cinnabar-meta` command available in your terminal.

### Usage

```bash
cinnabar-meta
```

#### Updating the project version

- Select `Update version`.
- Choose the version update type (dev, patch, minor, major).
- Confirm update (and, if necessary, commit and push).

## Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or create a pull request.

Clone the repository and install dependencies:

```bash
git clone git@github.com:cinnabar-forge/node-meta.git
cd node-meta
npm ci
```
Visit [`CONTRIBUTING.md`](CONTRIBUTING.md).

## License

Cinnabar Forge Meta is licensed under the ISC License - see the [LICENSE](LICENSE) file for details.
Visit [`LICENSE`](LICENSE).

## Authors
## Anca

- Timur Moziev ([@TimurRin](https://github.com/TimurRin))
This repository is a part of [Anca](https://github.com/cinnabar-forge/anca) standardization project. Parts of the files and code are generated by Anca.
38 changes: 38 additions & 0 deletions anca.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"authors": [
{
"name": "Timur Moziev",
"github": "TimurRin",
"email": "timur.moziev@gmail.com",
"type": "maintainer",
"url": "https://timurrin.github.io/"
}
],
"cinnabarMeta": {
"dataVersion": 0,
"version": {
"latest": "0.1.2-next.20240719134752",
"timestamp": 1721396872
},
"files": [
{
"path": "./src/cinnabar.ts",
"type": "typescript"
}
]
},
"deployment": {
"preparation": [
"npm ci",
"npm run build"
],
"start": [
"node ./dist/index.js"
]
},
"development": {
"readme": {}
},
"type": "app",
"stack": "nodejs"
}
22 changes: 0 additions & 22 deletions cinnabar.json

This file was deleted.

Loading

0 comments on commit 333d1c7

Please sign in to comment.