Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: upgrade #59

Merged
merged 1 commit into from
Oct 25, 2024
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
28 changes: 0 additions & 28 deletions .eslintrc.cjs

This file was deleted.

10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:

jobs:
build:
if: github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -27,4 +28,11 @@ jobs:
- run: yarn build
- run: yarn lint
- run: yarn test:coverage
- run: yarn docs
# - run: yarn docs
# - name: Deploy
# if: github.ref == 'refs/heads/master' && github.event_name == 'push'
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./docs
# enable_jekyll: false
9 changes: 6 additions & 3 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
description: 'Semantic Version Number (i.e., 5.5.0 or patch, minor, major, prepatch, preminor, premajor, prerelease)'
required: true
default: patch
preid:
description: 'Pre Release Identifier (i.e., alpha, beta)'
required: true
default: alpha
jobs:
create_release:
runs-on: ubuntu-latest
Expand All @@ -22,10 +26,9 @@ jobs:
- name: Change version number
id: version
run: |
echo -n "::set-output name=next_tag::"
npm version --no-git-tag-version ${{ github.event.inputs.versionName }}
echo "next_tag=$(npm version --no-git-tag-version ${{ github.event.inputs.versionName }} --preid ${{ github.event.inputs.preid }})" >> $GITHUB_OUTPUT
- name: Create pull request into main
uses: peter-evans/create-pull-request@v6
uses: peter-evans/create-pull-request@v7
with:
branch: release/${{ steps.version.outputs.next_tag }}
commit-message: 'chore: release ${{ steps.version.outputs.next_tag }}'
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/dependabot_automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Dependabot auto-merge
on:
pull_request:
branches:
- 'dev' # only into dev

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'sgratzl/cytoscape.js-layers'
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
- name: Enable auto-merge for Dependabot PRs
# patch only
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
22 changes: 15 additions & 7 deletions .github/workflows/release_helper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,26 @@ jobs:
node-version: 20
- name: Extract version
id: extract_version
run: node -pe "'::set-output name=version::' + require('./package.json').version"
run: |
node -pe "'version=' + require('./package.json').version" >> $GITHUB_OUTPUT
node -pe "'npm_tag=' + (require('./package.json').version.includes('-') ? 'next' : 'latest')" >> $GITHUB_OUTPUT
- name: Print version
run: |
echo "releasing ${{ steps.extract_version.outputs.version }} with tag ${{ steps.extract_version.outputs.npm_tag }}"
- name: Create Release
id: create_release
uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: v${{ steps.extract_version.outputs.version }}
tag: v${{ steps.extract_version.outputs.version }}
version: ${{ steps.extract_version.outputs.version }}
prerelease: ${{ needs.create_release.outputs.tag_name == 'next' }}
publish: true
outputs:
version: ${{ steps.extract_version.outputs.version }}
npm_tag: ${{ steps.extract_version.outputs.npm_tag }}
upload_url: ${{ steps.create_release.outputs.upload_url }}
tag_name: ${{ steps.create_release.outputs.tag_name }}

Expand Down Expand Up @@ -66,12 +75,11 @@ jobs:
files: 'package.tgz'
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ needs.create_release.outputs.tag_name }}
- name: Publish to NPM
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
access: public
check-version: true
- name: Pack Publish
run: |
yarn config set npmAuthToken "${{ secrets.NPM_TOKEN }}"
yarn pack
yarn npm publish --tag "${{ needs.create_release.outputs.npm_tag }}"

sync_dev:
needs: correct_repository
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ npm-debug.log*
/docs
samples/*.map
samples/*.js
*.tsbuildinfo
*.tsbuildinfo
.eslintcache
/docs
894 changes: 0 additions & 894 deletions .yarn/releases/yarn-4.2.2.cjs

This file was deleted.

934 changes: 934 additions & 0 deletions .yarn/releases/yarn-4.5.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
yarnPath: .yarn/releases/yarn-4.2.2.cjs
yarnPath: .yarn/releases/yarn-4.5.1.cjs
61 changes: 61 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// @ts-check

import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import prettier from 'eslint-plugin-prettier';

export default tseslint.config(eslint.configs.recommended, ...tseslint.configs.recommended, {
plugins: { prettier },
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'max-classes-per-file': 'off',
'no-underscore-dangle': 'off',
'import/extensions': 'off',
},
});

// import path from "node:path";
// import { fileURLToPath } from "node:url";
// import js from "@eslint/js";
// import { FlatCompat } from "@eslint/eslintrc";

// const __filename = fileURLToPath(import.meta.url);
// const __dirname = path.dirname(__filename);
// const compat = new FlatCompat({
// baseDirectory: __dirname,
// recommendedConfig: js.configs.recommended,
// allConfig: js.configs.all
// });

// export default [...fixupConfigRules(compat.extends(
// "airbnb-typescript",
// "react-app",
// "plugin:prettier/recommended",
// "prettier",
// )), {
// plugins: {
// prettier: fixupPluginRules(prettier),
// },

// languageOptions: {
// ecmaVersion: 5,
// sourceType: "script",

// parserOptions: {
// project: "./tsconfig.eslint.json",
// },
// },

// settings: {
// react: {
// version: "99.99.99",
// },
// },

// rules: {
// "@typescript-eslint/no-explicit-any": "off",
// "max-classes-per-file": "off",
// "no-underscore-dangle": "off",
// "import/extensions": "off",
// },
// }];
6 changes: 0 additions & 6 deletions jest.config.js

This file was deleted.

79 changes: 38 additions & 41 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
},
"global": "CytoscapeBubbleSets",
"dependencies": {
"@types/cytoscape": "^3.21.2",
"@types/cytoscape": "^3.21.8",
"@types/lodash.throttle": "^4.1.9",
"bubblesets-js": "^2.3.2",
"bubblesets-js": "^2.3.4",
"lodash.throttle": "^4.1.1"
},
"peerDependencies": {
Expand All @@ -43,68 +43,65 @@
"unpkg": "build/index.umd.min.js",
"jsdelivr": "build/index.umd.min.js",
"types": "build/index.d.ts",
"exports": {
".": {
"import": "./build/index.js",
"require": "./build/index.cjs",
"scripts": "./build/index.umd.min.js",
"types": "./build/index.d.ts"
}
},
"sideEffects": false,
"files": [
"build",
"src/**/*.ts",
"src/**/*.tsx"
],
"devDependencies": {
"@babel/core": "^7.24.7",
"@babel/preset-env": "^7.24.7",
"@babel/core": "^7.25.9",
"@babel/preset-env": "^7.25.9",
"@eslint/js": "^9.13.0",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.7",
"@rollup/plugin-typescript": "^11.1.6",
"@types/jest": "^29.5.12",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
"@yarnpkg/sdks": "^3.1.2",
"cytoscape": "^3.29.2",
"cytoscape-layers": "^2.4.4",
"eslint": "^8.57.0",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.2",
"eslint-plugin-react-hooks": "^4.6.2",
"jest": "^29.7.0",
"prettier": "^3.3.1",
"rimraf": "^5.0.7",
"rollup": "^4.18.0",
"@rollup/plugin-commonjs": "^28.0.1",
"@rollup/plugin-node-resolve": "^15.3.0",
"@rollup/plugin-replace": "^6.0.1",
"@rollup/plugin-typescript": "^12.1.1",
"@vitest/coverage-v8": "^2.1.3",
"@yarnpkg/sdks": "^3.2.0",
"cytoscape": "^3.30.3",
"cytoscape-layers": "^2.4.6",
"eslint": "^9.13.0",
"eslint-plugin-prettier": "^5.2.1",
"jsdom": "^25.0.1",
"prettier": "^3.3.3",
"rimraf": "^6.0.1",
"rollup": "^4.24.0",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-terser": "^7.0.2",
"ts-jest": "^29.1.4",
"tslib": "^2.6.3",
"typedoc": "^0.25.13",
"typescript": "^5.4.5"
},
"resolutions": {
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0"
"tslib": "^2.8.0",
"typedoc": "^0.26.10",
"typescript": "^5.6.3",
"typescript-eslint": "^8.10.0",
"vite": "^5.4.9",
"vitest": "^2.1.3"
},
"scripts": {
"clean": "rimraf build docs node_modules \"*.tgz\" \"*.tsbuildinfo\" \"samples/*.js\" \"samples/*.map\"",
"clean": "rimraf --glob build node_modules \"*.tgz\" \"*.tsbuildinfo\"",
"compile": "tsc -b tsconfig.c.json",
"start": "yarn run watch",
"watch": "rollup -c -w",
"build": "rollup -c",
"test": "yarn node --experimental-vm-modules $(yarn bin jest) --passWithNoTests --detectOpenHandles --forceExit",
"test": "vitest --passWithNoTests",
"test:watch": "yarn run test --watch",
"test:coverage": "yarn run test --coverage",
"lint": "yarn run eslint && yarn run prettier",
"fix": "yarn run eslint:fix && yarn run prettier:write",
"prettier:write": "prettier \"*\" \"*/**\" --write",
"prettier": "prettier \"*\" \"*/**\" --check",
"eslint": "eslint src --ext .ts,.tsx",
"eslint": "eslint src --cache",
"eslint:fix": "yarn run eslint --fix",
"docs": "typedoc src/index.ts",
"docs": "typedoc --options typedoc.json",
"prepare": "yarn run build"
},
"packageManager": "yarn@4.2.2"
"packageManager": "yarn@4.5.1"
}
4 changes: 0 additions & 4 deletions tsconfig.eslint.json

This file was deleted.

16 changes: 16 additions & 0 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://typedoc.org/schema.json",
"entryPoints": ["./src"],
"exclude": ["**/*.spec.ts"],
"name": "cytoscape-bubblesets",
"out": "./docs/",
"readme": "none",
"theme": "default",
"excludeExternals": true,
"excludeInternal": true,
"excludePrivate": true,
"includeVersion": true,
"categorizeByGroup": true,
"cleanOutputDir": true,
"hideGenerator": true
}
9 changes: 9 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/// <reference types="vitest/config" />
import { defineConfig } from 'vite';

export default defineConfig({
test: {
environment: 'jsdom',
root: './src',
},
});
Loading