Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-crowell committed Mar 12, 2024
1 parent a18cae6 commit fc4ef5a
Show file tree
Hide file tree
Showing 12 changed files with 1,193 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Publish

on:
workflow_dispatch:
inputs:
confirm:
type: boolean
description: 'Confirm Manual Publish'
default: false
required: true

workflow_call:
inputs:
access:
type: string
description: 'Publish Access'
default: 'public'
required: false
tag:
type: string
description: 'Publish Tag'
default: 'latest'
required: false


jobs:
build_and_publish:
runs-on: ubuntu-latest
name: Build and Publish
if: ${{ github.event_name != 'workflow_dispatch' || (github.event.inputs.confirm == true || github.event.inputs.confirm == 'true') }}

steps:

- name: Checkout Respository
uses: actions/checkout@v3
if: ${{ github.event_name != 'workflow_call' }}

- uses: pnpm/action-setup@v2
with:
version: latest

- name: Setup NodeJS with PNPM Caching
uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
scope: '@amnis'
cache: 'pnpm'

- name: Install NodeJS Dependencies
run: pnpm install --frozen-lockfile

- name: Build Project
run: |
pnpm build
pnpm build:libs
- name: Publish Project
run: pnpm publish -r --tag ${{ inputs.tag }} --access ${{ inputs.access }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
release-type: node
token: ${{ secrets.GITHUB_TOKEN }}
default-branch: main

- name: Publish
uses: './.github/workflows/publish.yml'
if: ${{ steps.release.outputs.release_created }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,6 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# OSX files
.DS_Store
12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "workspace",
"private": true,
"version": "0.0.0",
"description": "do-ob workspace for configurations",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
3 changes: 3 additions & 0 deletions packages/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Configuration Packages

Directory for the workspace's packages.
33 changes: 33 additions & 0 deletions packages/eslint-config/index.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module.exports = {
env: {
browser: true,
es2023: true
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module'
},
plugins: [
'@typescript-eslint'
],
rules: {
semi: ['error', 'always'],
quotes: ['error', 'single'],
indent: ['error', 2],
'eol-last': ['error', 'always'],
},
overrides: [
{
files: ['**/*.cjs'],
env: {
es2023: true,
node: true,
},
},
],
}
32 changes: 32 additions & 0 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "@do-ob/eslint-config",
"version": "0.0.0",
"description": "Default ESLint configuration for ESM Node.js projects.",
"type": "module",
"main": "index.cjs",
"module": "index.cjs",
"exports": {
".": {
"import": "./index.cjs",
"require": "./index.cjs"
}
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"eslint",
"typescript",
"config",
"configuration",
"esm"
],
"author": "Eric Crowell <[email protected]> (https://do-ob.io)",
"license": "MIT",
"dependencies": {
"typescript-eslint": "^7.2.0"
},
"peerDependencies": {
"eslint": "^8"
}
}
29 changes: 29 additions & 0 deletions packages/ts-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "@do-ob/ts-config",
"version": "0.0.0",
"description": "Default TypeScript configuration for ESM Node.js projects.",
"type": "module",
"main": "tsconfig.json",
"module": "tsconfig.json",
"exports": {
".": {
"import": "./tsconfig.json",
"require": "./tsconfig.json"
}
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"tsconfig",
"typescript",
"config",
"configuration",
"esm"
],
"author": "Eric Crowell <[email protected]>",
"license": "MIT",
"peerDependencies": {
"typescript": "^5"
}
}
12 changes: 12 additions & 0 deletions packages/ts-config/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"module": "NodeNext",
"moduleResolution": "NodeNext",
"isolatedModules": true,
"declaration": true,
"emitDeclarationOnly": true,
"allowImportingTsExtensions": true,
"outDir": "./dist",
"declarationDir": "./types"
}
}
Loading

0 comments on commit fc4ef5a

Please sign in to comment.