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
35 changes: 28 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# DORMANT until Phase 2 (npm publish). Phase 1 distributes via GitHub URL + git
# tags, so this workflow is disabled by the `if: false` guard below. To go live:
# 1. Create the `zoldytech` npm org and enable OIDC trusted publishing for this repo.
# 2. Remove `"private": true` from package.json and uncomment `publishConfig`.
# 3. Delete the `if: false` line.
# Publishing is then gated on pushing a `v*` git tag whose version matches package.json.
# Publishing is gated on pushing a `v*` git tag whose version matches package.json (verified in
# the `publish` job below — a mismatch fails the job). Requires OIDC trusted publishing to be
# enabled for this repo on the @zoldytech npm org (npmjs.com -> package settings -> Trusted
# Publisher -> GitHub Actions -> Zoldytech/javascript -> release.yml).
#
# Publish and release-creation are separate jobs, each with least-privilege permissions. The tag
# itself already exists once pushed (that's what triggers this workflow) regardless of outcome,
# but the GitHub Release is only created after `publish` succeeds — and lives in its own job so it
# can be re-run on its own if it fails, without re-attempting `npm publish` (which would fail once
# the version is already on the registry).
name: Release

on:
Expand All @@ -12,7 +16,6 @@ on:

jobs:
publish:
if: false # DORMANT — see header
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -25,6 +28,24 @@ jobs:
cache: npm
registry-url: https://registry.npmjs.org
- run: npm ci
- name: Verify tag matches package.json version
run: |
PKG_VERSION="v$(node -p "require('./package.json').version")"
if [ "$PKG_VERSION" != "${{ github.ref_name }}" ]; then
echo "::error::Tag ${{ github.ref_name }} does not match package.json version ($PKG_VERSION)"
exit 1
fi
- run: npm run lint
- run: npm test
- run: npm publish --provenance --access public

release:
needs: publish
runs-on: ubuntu-latest
permissions:
contents: write # create the GitHub Release
steps:
- uses: actions/checkout@v4
- run: gh release create "${{ github.ref_name }}" --generate-notes
env:
GITHUB_TOKEN: ${{ github.token }}
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# @zoldytech/javascript

[![npm version](https://img.shields.io/npm/v/@zoldytech/javascript.svg)](https://npmjs.com/package/@zoldytech/javascript)
[![npm downloads](https://img.shields.io/npm/dm/@zoldytech/javascript.svg)](https://npmjs.com/package/@zoldytech/javascript)
[![CI](https://img.shields.io/github/actions/workflow/status/Zoldytech/javascript/ci.yml?branch=main)](https://github.com/Zoldytech/javascript/actions/workflows/ci.yml)

A general-purpose ESLint **house style**, built on [`@antfu/eslint-config`](https://github.com/antfu/eslint-config)
and made **SonarQube-compatible**: local ESLint mirrors what the SonarQube gate flags, so you fix
Sonar issues before they reach CI. Five stack presets — **plain JS/TS**, **React + Vite**,
Expand All @@ -26,10 +30,8 @@ Sonar issues before they reach CI. Five stack presets — **plain JS/TS**, **Rea

## Install

Distributed via GitHub URL, pinned to a tag (no build step runs on install — raw ESM):

```bash
npm i -D "github:zoldytech/javascript#0.1.2"
npm i -D @zoldytech/javascript
```

## Usage
Expand Down
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
{
"name": "@zoldytech/javascript",
"type": "module",
"version": "0.1.3",
"private": true,
"version": "0.1.4",
"description": "Zoldytech's JavaScript/TypeScript standards: SonarQube-compatible ESLint presets (Next.js, NestJS, React+Vite, plain JS/TS) plus shared Prettier and tsconfig configs.",
"license": "MIT",
"homepage": "https://github.com/Zoldytech/javascript#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/Zoldytech/javascript.git"
},
"bugs": {
"url": "https://github.com/Zoldytech/javascript/issues"
},
"publishConfig": {
"access": "public"
},
"prettier": "./prettier/prettierrc.json",
"exports": {
"./eslint": "./eslint/index.js",
Expand Down
Loading