Skip to content

Commit

Permalink
[migrate] upgrade to Node.js 20, PNPM 9, ESLint 9, KoAJAX 3, Marked 1…
Browse files Browse the repository at this point in the history
…5 & other latest Upstream packages/actions
  • Loading branch information
TechQuery committed Nov 10, 2024
1 parent 77ce7ef commit accbf9a
Show file tree
Hide file tree
Showing 11 changed files with 4,265 additions and 2,581 deletions.
27 changes: 0 additions & 27 deletions .eslintrc.json

This file was deleted.

14 changes: 7 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@ jobs:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 8
- uses: actions/setup-node@v3
version: 9
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
registry-url: https://registry.npmjs.org
cache: pnpm
- name: Install Dependencies
run: pnpm i --frozen-lockfile

- name: Build & Publish
run: npm publish
run: npm publish --acess public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Deploy to GitHub pages
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
publish_dir: ./docs
personal_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 8
- uses: actions/setup-node@v3
version: 9
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
cache: pnpm
- name: Install & Build
run: |
Expand Down
8 changes: 2 additions & 6 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
.editorconfig
.eslintrc.json
.*
eslint.config.js
test/
.parcel*
docs/
.vscode/
.husky/
.github/
12 changes: 6 additions & 6 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

[Web Components][1] library for GitHub based on [WebCell][2]

[![NPM Dependency](https://img.shields.io/librariesio/github/TechQuery/GitHub-Web-Widget.svg)][3]
[![CI & CD](https://github.com/TechQuery/GitHub-Web-Widget/actions/workflows/main.yml/badge.svg)][4]
[![NPM Dependency](https://img.shields.io/librariesio/github/EasyWebApp/GitHub-Web-Widget.svg)][3]
[![CI & CD](https://github.com/EasyWebApp/GitHub-Web-Widget/actions/workflows/main.yml/badge.svg)][4]

[![NPM](https://nodei.co/npm/github-web-widget.png?downloads=true&downloadRank=true&stars=true)][5]

## Demo

https://tech-query.me/GitHub-Web-Widget/demo/
https://web-cell.dev/GitHub-Web-Widget/demo/

## Components

Expand Down Expand Up @@ -74,7 +74,7 @@ npm install parcel @parcel/config-default @parcel/transformer-typescript-tsc -D
<title>Your Blog</title>
<link
rel="stylesheet"
href="https://unpkg.com/bootstrap@5.3.2/dist/css/bootstrap.min.css"
href="https://unpkg.com/bootstrap@5.3.3/dist/css/bootstrap.min.css"
/>
<link
rel="stylesheet"
Expand Down Expand Up @@ -154,5 +154,5 @@ new DOMRenderer().render(
[9]: http://www.newmediacampaigns.com/blog/a-beautiful-jquery-github-widget
[10]: https://tech-query.me/GitHub-Web-Widget/interfaces/issue.githubissueprops.html
[11]: https://tech-query.me/GitHub-Web-Widget/interfaces/eventflow.githubeventsprops.html
[12]: https://github.com/TechQuery/GitHub-Web-Widget/blob/master/test/index.html
[13]: https://github.com/TechQuery/GitHub-Web-Widget/blob/master/test/index.tsx
[12]: https://github.com/EasyWebApp/GitHub-Web-Widget/blob/master/test/index.html
[13]: https://github.com/EasyWebApp/GitHub-Web-Widget/blob/master/test/index.tsx
69 changes: 69 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import { fixupPluginRules } from '@eslint/compat';
import eslint from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import reactPlugin from 'eslint-plugin-react';
import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort';
import globals from 'globals';
import tsEslint from 'typescript-eslint';
import { fileURLToPath } from 'url';

const tsconfigRootDir = fileURLToPath(new URL('.', import.meta.url));

export default tsEslint.config(
// register all of the plugins up-front
{
plugins: {
'@typescript-eslint': tsEslint.plugin,
// @ts-expect-error https://github.com/jsx-eslint/eslint-plugin-react/issues/3699
react: fixupPluginRules(reactPlugin),
'simple-import-sort': simpleImportSortPlugin
}
},
// config with just ignores is the replacement for `.eslintignore`
{ ignores: ['**/node_modules/**', '**/dist/**', '**/.parcel-cache/**'] },

// extends ...
eslint.configs.recommended,
...tsEslint.configs.recommended,

// base config
{
languageOptions: {
globals: { ...globals.es2022, ...globals.browser, ...globals.node },
parserOptions: {
projectService: true,
tsconfigRootDir,
warnOnUnsupportedTypeScriptVersion: false
}
},
rules: {
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': 'error',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-unsafe-declaration-merging': 'warn',
'react/jsx-no-target-blank': 'warn',
'react/jsx-sort-props': [
'error',
{
reservedFirst: true,
callbacksLast: true,
noSortAlphabetically: true
}
]
}
},
{
files: ['**/*.js'],
extends: [tsEslint.configs.disableTypeChecked],
rules: {
// turn off other type-aware rules
'@typescript-eslint/internal/no-poorly-typed-ts-props': 'off',

// turn off rules that don't apply to JS code
'@typescript-eslint/explicit-function-return-type': 'off'
}
},
eslintConfigPrettier
);
59 changes: 32 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "github-web-widget",
"version": "4.0.0-rc.2",
"version": "4.0.0",
"description": "Web Components library for GitHub based on WebCell",
"keywords": [
"github",
Expand Down Expand Up @@ -28,48 +28,53 @@
"start": "rm -rf .parcel-cache/ docs/demo/ && cd test/ && parcel index.html --dist-dir ../docs/demo/ --open",
"pack-demo": "cd test/ && parcel build index.html --public-url . --dist-dir ../docs/demo/",
"test": "lint-staged",
"pack-dist": "rm -rf .parcel-cache/ dist/ && parcel build",
"pack-dist": "rm -rf .parcel-cache/ dist/ && tsc --noEmit && parcel build",
"pack-docs": "rm -rf docs/ && typedoc source/ && npm run pack-demo",
"build": "rm -rf dist/ && npm run pack-dist && npm run pack-docs",
"help": "npm run pack-docs && open-cli docs/index.html",
"prepublishOnly": "npm test && npm run build"
},
"dependencies": {
"dom-renderer": "^2.1.3",
"koajax": "^0.9.6",
"marked": "^12.0.0",
"mobx": "^6.12.0",
"dom-renderer": "^2.4.4",
"koajax": "^3.0.3",
"marked": "^15.0.0",
"marked-highlight": "^2.2.1",
"mobx": "^6.13.5",
"prismjs": "^1.29.0",
"web-cell": "^3.0.0-rc.15"
"web-cell": "^3.0.1"
},
"peerDependencies": {
"bootstrap": "^5",
"github-markdown-css": "^5"
},
"devDependencies": {
"@octokit/openapi-types": "^19.1.0",
"@parcel/config-default": "~2.11.0",
"@parcel/packager-ts": "~2.11.0",
"@parcel/transformer-less": "~2.11.0",
"@parcel/transformer-typescript-tsc": "~2.11.0",
"@parcel/transformer-typescript-types": "~2.11.0",
"@types/prismjs": "^1.26.3",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@eslint/compat": "^1.2.2",
"@eslint/js": "^9.14.0",
"@octokit/openapi-types": "^22.2.0",
"@parcel/config-default": "~2.12.0",
"@parcel/packager-ts": "~2.12.0",
"@parcel/transformer-less": "~2.12.0",
"@parcel/transformer-typescript-tsc": "~2.12.0",
"@parcel/transformer-typescript-types": "~2.12.0",
"@types/eslint-config-prettier": "^6.11.3",
"@types/node": "^20",
"@types/prismjs": "^1.26.5",
"cross-env": "^7.0.3",
"element-internals-polyfill": "^1.3.10",
"eslint": "^8.56.0",
"element-internals-polyfill": "^1.3.12",
"eslint": "^9.14.0",
"eslint-config-prettier": "^9.1.0",
"husky": "^9.0.10",
"iterable-observer": "^1.0.1",
"lint-staged": "^15.2.2",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-simple-import-sort": "^12.1.1",
"globals": "^15.12.0",
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
"open-cli": "^8.0.0",
"parcel": "~2.11.0",
"prettier": "^3.2.5",
"typedoc": "^0.25.8",
"typedoc-plugin-mdn-links": "^3.1.15",
"typescript": "~5.3.3",
"web-utility": "^4.1.3"
"parcel": "~2.12.0",
"prettier": "^3.3.3",
"typedoc": "^0.26.11",
"typedoc-plugin-mdn-links": "^3.3.7",
"typescript": "~5.6.3",
"typescript-eslint": "^8.13.0"
},
"prettier": {
"tabWidth": 4,
Expand Down
Loading

1 comment on commit accbf9a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for github-web-widget ready!

✅ Preview
https://github-web-widget-gdlq1437i-techquerys-projects.vercel.app

Built with commit accbf9a.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.