Skip to content

Commit

Permalink
chore: convert from UMD to ESM, cleanup/modernize (#228)
Browse files Browse the repository at this point in the history
- TypeScript: Update from v4.9.3 to v5.3.3
- TypeDoc: Update from v0.23.21 to v0.25.4
- `@typescript-eslint/eslint-plugin`, `@typescript-eslint/parser`: Update from v5.44.0 to v6.16.0
- Add personal lint config packages `markdownlint-config-neoncitylights`, `eslint-config-neoncitylights`
- CI: Upgrade CodeSandbox Node version from v14 to v18
- CI: modernize `main.yml` workflow (sync with neoncitylights/typescript template)
- Upgrade NPM lockfile version from v2 to v3
- Switch from Renovate to Dependabot for dependency updates
- Replaces Webpack with Vite
- Replaces Jest with Vitest
- Merges `typedoc.json` into `tsconfig.json`
- Make `.gitignore` closer to zero-config (Syncs with neoncitylights/typescript#234)
  • Loading branch information
neoncitylights authored Dec 29, 2023
1 parent 418169e commit 7114f95
Show file tree
Hide file tree
Showing 37 changed files with 4,913 additions and 8,286 deletions.
2 changes: 1 addition & 1 deletion .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"buildCommand": "build",
"node": "14"
"node": "18"
}
5 changes: 5 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
extends: [
'neoncitylights/typescript',
],
};
51 changes: 0 additions & 51 deletions .eslintrc.js

This file was deleted.

135 changes: 118 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,139 @@
name: Node.js workflow
name: Node.js CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

workflow_dispatch:

jobs:
build:
name: build (Node v@${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [lts/*, latest]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build packages
run: npm run build

lint:
name: lint (${{ matrix.tool }})
runs-on: ubuntu-latest
strategy:
matrix:
include:
- tool: ESLint
npm-cmd-suffix: es
npm-cmd-env: |
npm run lint:es-env
- tool: Markdownlint
npm-cmd-suffix: md
npm-cmd-env: |
node --version
npm --version
npm run lint:md-env
- tool: publint
npm-cmd-suffix: pub
npm-cmd-env: |
node --version
npm --version
npm run lint:pub-env
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: latest
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Print environment info
run: |
${{ matrix.npm-cmd-env }}
- name: Lint with ${{ matrix.tool }}
run: npm run lint:${{ matrix.npm-cmd-suffix }}

test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '14'
node-version: latest
cache: 'npm'
- name: Install
run: npm install
- name: Unit tests and lint
run: npm run test:all
- name: Build
run: npm run build:all
- name: Install dependencies
run: npm ci
- name: Test
run: npm run test
- name: Upload code coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

docs:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: latest
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build documentation
run: npm run build:typedoc
- name: Deploy documentation
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
npm run deploy -- -u "github-actions-bot <support+actions@github.com>"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.event_name == 'push' }}
- name: Upload code coverage
uses: codecov/codecov-action@v3

pkg-dry-run:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
node-version: latest
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Check if publishable
run: npm publish --access public --dry-run
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

ci-success:
runs-on: ubuntu-latest
if: ${{ success() }}
needs:
- build
- lint
- test
- docs
- pkg-dry-run
steps:
- name: ✅ CI succeeded
run: exit 0
153 changes: 151 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,154 @@
node_modules
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# NPM packaging
dist

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

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

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out
next-env.d.ts

# Nuxt.js build / generate output
.nuxt

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# TypeDoc
docs/typedocs
dist

# Storybook
build-storybook.log
storybook-static

# Vercel
.vercel

## VSCode
# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# VSCode Local History
# https://marketplace.visualstudio.com/items?itemName=xyz.local-history
.history

# JetBrains IDE
.idea

# Apple/MacOS
.DS_Store
5 changes: 0 additions & 5 deletions .idea/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions .idea/codeStyles/codeStyleConfig.xml

This file was deleted.

Loading

0 comments on commit 7114f95

Please sign in to comment.