No description
  • TypeScript 86.2%
  • JavaScript 13.8%
Find a file
TR 1f2d676b56
All checks were successful
Build and Publish / publish (push) Successful in 13s
Merge pull request 'chore: bumped version' (#3) from temir/create-oci-compose:dev into main
Reviewed-on: #3
2026-07-05 20:08:22 +02:00
.forgejo/workflows feat: added build-publish workflow 2026-07-05 19:39:27 +02:00
scripts chore: added files from template@0.6.0 template 2026-07-05 19:27:36 +02:00
src chore: added files from template@0.6.0 template 2026-07-05 19:27:36 +02:00
tests chore: added files from template@0.6.0 template 2026-07-05 19:27:36 +02:00
.gitignore chore: added files from template@0.6.0 template 2026-07-05 19:27:36 +02:00
.npmrc feat: added build-publish workflow 2026-07-05 19:39:27 +02:00
CHANGELOG.md chore: added files from template@0.6.0 template 2026-07-05 19:27:36 +02:00
LICENSE chore: updated metadata 2026-07-05 19:31:32 +02:00
package-lock.json chore: bumped version 2026-07-05 20:07:49 +02:00
package.json chore: bumped version 2026-07-05 20:07:49 +02:00
README.md feat: added build-publish workflow 2026-07-05 19:39:27 +02:00
tsconfig.json chore: added files from template@0.6.0 template 2026-07-05 19:27:36 +02:00

Introduction

This template scaffolds a ...

Table of Contents

  1. Quick Start
  2. Documentation
  3. DevOps
    1. Change Management
    2. Registry
    3. CI/CD Workflows

Quick Start

# placeholder:
    # <TEMPLATE_PACKAGE_NAME: @temir.ra/create-oci-compose
    # <TEMPLATE_NAME: @temir.ra/oci-compose

# print the latest version
npm info "@temir.ra/create-oci-compose" version

# create/update a package from the template in the current directory
npm create --no-install --no-git "@temir.ra/oci-compose@latest" .

# set metadata in package.json

npm update

Documentation

The following sections explain the configurations and conventions baked into the generated package. Useful when adapting it to fit specific needs.

<DOCUMENTATION>

DevOps

npm install
npm update

npm run clean
npm run build
npm run tests

npx tsx dist/cli.bundle.js -- example/
git fetch upstream
git fetch origin
git fetch . upstream/main:origin/main
git fetch . origin/main:main
git push origin main
git merge --ff-only main
git push

Change Management

  1. Create a new branch for the change.
  2. Make the changes and commit.
  3. Bump the version in package.json.
  4. Add an entry for the new version in CHANGELOG.md.
  5. Pull-request the branch.
  6. Ensure package artifacts are current.
  7. Publish.

Registry

.npmrc:

@temir.ra:registry=https://registry.npmjs.org/
//registry.npmjs.org/:_authToken=${NPMJSORG_REGISTRY_AUTH_TOKEN}

or bunfig.toml:

[install.scopes]
"temir.ra" = { url = "https://registry.npmjs.org/", token = "$NPMJSORG_REGISTRY_AUTH_TOKEN" }
# registry.npmjs.org/
export NPMJSORG_REGISTRY_AUTH_TOKEN=<AUTH_TOKEN>
# or
$env:NPMJSORG_REGISTRY_AUTH_TOKEN = "<AUTH_TOKEN>"
npm publish

CI/CD Workflows

Build and Publish

⚠️ .npmrc configuring the package registry and its authentication token is required for the workflow to work.

Parameter Type Description
RUNNER_LABEL Variable The label of the runner to use for the workflow.
ACCESS_TOKEN Secret The authentication token for the package registry.

.github/workflows/build-publish.yml:

name: Build and Publish

on:
  push:
    branches:
      - main

jobs:
  publish:
    runs-on: ${{ vars.RUNNER_LABEL }}
    steps:
      - uses: actions/checkout@v4

      - name: Install
        env:
          NPMJSORG_REGISTRY_AUTH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
        run: npm ci

      - name: Build
        run: npm run build

      - name: Test
        run: npm run tests

      - name: Publish
        env:
          NPMJSORG_REGISTRY_AUTH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
        run: |
          PKG_NAME=$(node -p "require('./package.json').name")
          PKG_VERSION=$(node -p "require('./package.json').version")
          NPM_TAG="latest"
          if echo "$PKG_VERSION" | grep -q -- '-'; then
            NPM_TAG="next"
          fi
          if npm view "$PKG_NAME@$PKG_VERSION" version >/dev/null 2>&1; then
            echo "$PKG_NAME@$PKG_VERSION already published, skipping."
          else
            npm publish --tag "$NPM_TAG"
          fi