Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
22 changes: 0 additions & 22 deletions .github/workflows/check.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI

on:
pull_request:
branches:
- main
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
ci:
name: CI Checks
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Format check
run: bun run format

- name: Type check
run: bun run type-check

- name: Lint
run: bun run lint

- name: Build
run: bun run build
61 changes: 0 additions & 61 deletions .github/workflows/deploy.yml

This file was deleted.

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

on:
push:
tags:
- "v*.*.*"

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
build:
name: Build binaries
runs-on: ubuntu-latest
strategy:
matrix:
platform: [darwin, linux]
arch: [x64, arm64]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Build binary
run: bun build src/index.ts --target="bun-${{ matrix.platform }}-${{ matrix.arch }}" --outfile="bin/${{ matrix.platform }}-${{ matrix.arch }}" --compile

- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
path: bin
name: ${{ matrix.platform }}-${{ matrix.arch }}

release:
name: Release
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
id-token: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Format check
run: pnpm run format

- name: Type check
run: pnpm run type-check

- name: Lint
run: pnpm run lint

- name: Publish to npm
run: pnpm publish --no-git-checks --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: bin

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
bin/darwin-x64/darwin-x64
bin/darwin-arm64/darwin-arm64
bin/linux-x64/linux-x64
bin/linux-arm64/linux-arm64
body: |
## Installation

```bash
npm install @maastrich/moonx@${{ github.ref_name }}
```

The platform-specific binaries will be automatically downloaded during installation.

See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) for full details.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,4 @@ $RECYCLE.BIN/
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/node,git,macos,windows,visualstudiocode

# moonx binary
bin
bin/moonx-dev
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
engine-strict=true
auto-install-peers=false
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dist
node_modules
*.d.ts
pnpm-lock.yaml
coverage
.git
bin
2 changes: 2 additions & 0 deletions .prototools
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[plugins]
moon = "https://raw.githubusercontent.com/moonrepo/moon/master/proto-plugin.toml"
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# @maastrich/moonx

## <= 0.1.8

- Initial release
3 changes: 3 additions & 0 deletions bin/moonx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#! /usr/bin/env bash

echo "Binary not installed, you may need to run approve-build"
Binary file removed bun.lockb
Binary file not shown.
10 changes: 10 additions & 0 deletions configs/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"useTabs": false,
"trailingComma": "es5",
"printWidth": 80,
"arrowParens": "always",
"plugins": ["@prettier/plugin-oxc"]
}
6 changes: 6 additions & 0 deletions configs/knip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json",
"prettier": {
"config": "./configs/.prettierrc.json"
}
}
15 changes: 15 additions & 0 deletions configs/oxlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"rules": {
"typescript": "error",
"unicorn": "error",
"import": "error"
},
"env": {
"node": true,
"es2024": true
},
"globals": {
"NodeJS": "readonly"
},
"ignorePatterns": ["dist", "node_modules", "*.d.ts"]
}
42 changes: 29 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@maastrich/moonx",
"version": "0.1.6",
"version": "0.1.8",
"description": "A CLI tool to help you with moon syntax",
"keywords": [
"moon",
Expand All @@ -11,36 +11,52 @@
"license": "MIT",
"author": "Maastrich @maastrich",
"type": "module",
"main": "src/index.ts",
"bin": {
"moonx": "bin/moonx",
"mx": "bin/moonx"
},
"files": [
"bin",
"bin/moonx",
"scripts/setup-binary.js"
],
"scripts": {
"build": "bun build --compile . --outfile=\"bin/moonx\"",
"build": "bun build --compile src/index.ts --outfile=\"bin/moonx-dev\"",
"changeset": "changeset",
"format": "prettier --check . --config ./configs/.prettierrc.json",
"format:fix": "prettier --write . --config ./configs/.prettierrc.json",
"postinstall": "node scripts/setup-binary.js",
"prettier": "prettier --write .",
"semver-check": "bun run scripts/semver-check.ts",
"sort": "bun x sort-package-json"
"lint": "pnpm run lint:knip && pnpm run lint:oxlint",
"lint:fix": "pnpm run lint:knip:fix && pnpm run lint:oxlint:fix",
"lint:knip": "knip --config ./configs/knip.json",
"lint:knip:fix": "knip --config ./configs/knip.json --fix",
"lint:oxlint": "oxlint src scripts --config ./configs/oxlint.json",
"lint:oxlint:fix": "oxlint src scripts --config ./configs/oxlint.json --fix",
"release": "pnpm run build && changeset publish",
"sort": "pnpm sort-package-json",
"type-check": "tsc --noEmit",
"version": "changeset version"
},
"devDependencies": {
"@changesets/cli": "^2.29.7",
"@moonrepo/types": "^1.21.3",
"@trivago/prettier-plugin-sort-imports": "^4.2.1",
"@prettier/plugin-oxc": "^0.0.4",
"@types/bun": "^1.3.0",
"@types/node": "^24.9.1",
"@types/nunjucks": "^3.2.6",
"@types/semver": "^7.5.5",
"@withfig/autocomplete-types": "^1.29.0",
"bun-types": "^1.0.11",
"cac": "^6.7.14",
"chalk": "^5.3.0",
"knip": "^5.66.2",
"node-emoji": "^2.1.0",
"nunjucks": "^3.2.4",
"prettier": "^3.0.3",
"semver": "^7.6.3",
"oxlint": "^1.23.0",
"prettier": "^3.6.2",
"sort-package-json": "^2.6.0",
"typescript": "^5.9.3",
"yaml": "^2.3.4"
},
"packageManager": "pnpm@10.8.1",
"engines": {
"node": ">=18",
"pnpm": ">=9"
}
}
Loading