Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.

Commit 38942b8

Browse files
committed
Add browser package
1 parent d155710 commit 38942b8

File tree

18 files changed

+443
-0
lines changed

18 files changed

+443
-0
lines changed

packages/browser/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# @version-checker/browser
2+
3+
> A proxy package providing support for the browser.
4+
5+
**Note**: This is currently **EXPERIMENTAL**, as it depends on `@octokit/core^5.0.0-beta.4^ and the
6+
[Node.js Fetch API](https://nodejs.org/dist/latest-v18.x/docs/api/globals.html#fetch).

packages/browser/package.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"name": "@version-checker/browser",
3+
"version": "3.0.0",
4+
"description": "A proxy package providing support for the browser.",
5+
"keywords": [
6+
"version-checker"
7+
],
8+
"author": "Axel Rindle <mail@axelrindle.de>",
9+
"homepage": "https://axelrindle.github.io/github-version-checker/",
10+
"license": "MIT",
11+
"main": "./dist/cjs/index.js",
12+
"module": "./dist/esm/index.js",
13+
"types": "./dist/index.d.ts",
14+
"exports": {
15+
".": {
16+
"require": "./dist/cjs/index.js",
17+
"import": "./dist/esm/index.js",
18+
"types": "./dist/index.d.ts"
19+
}
20+
},
21+
"files": [
22+
"dist"
23+
],
24+
"repository": {
25+
"type": "git",
26+
"url": "git+https://github.com/axelrindle/github-version-checker.git"
27+
},
28+
"scripts": {
29+
"clean": "rimraf dist",
30+
"build": "concurrently 'npm:build:*'",
31+
"esbuild-base": "esbuild src/index.ts --bundle --platform=browser",
32+
"build:browser:esm": "npm run esbuild-base -- --format=esm --outdir=dist/esm",
33+
"build:browser:cjs": "npm run esbuild-base -- --format=cjs --outdir=dist/cjs",
34+
"build:types": "tsc -p tsconfig.types.json"
35+
},
36+
"bugs": {
37+
"url": "https://github.com/axelrindle/github-version-checker/issues"
38+
},
39+
"dependencies": {
40+
"@octokit/core": "^5.0.0-beta.4",
41+
"@version-checker/core": "*"
42+
},
43+
"devDependencies": {
44+
"concurrently": "^8.2.0",
45+
"esbuild": "^0.18.11",
46+
"rimraf": "^5.0.1"
47+
}
48+
}

packages/browser/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import versionCheck from '@version-checker/core'
2+
3+
export default versionCheck
4+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "@sindresorhus/tsconfig",
3+
"compilerOptions": {
4+
"outDir": "dist",
5+
"emitDeclarationOnly": true,
6+
},
7+
"include": [
8+
"src/",
9+
]
10+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
env: { browser: true, es2020: true },
3+
extends: [
4+
'eslint:recommended',
5+
'plugin:@typescript-eslint/recommended',
6+
'plugin:react-hooks/recommended',
7+
],
8+
parser: '@typescript-eslint/parser',
9+
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
10+
plugins: ['react-refresh'],
11+
rules: {
12+
'react-refresh/only-export-components': 'warn',
13+
},
14+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8" />
6+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8+
<title>@version-checker/browser sample</title>
9+
</head>
10+
11+
<body>
12+
<div id="root"></div>
13+
<script type="module" src="/src/main.tsx"></script>
14+
</body>
15+
16+
</html>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "example-browser",
3+
"private": true,
4+
"version": "3.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "tsc && vite build",
9+
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
10+
"preview": "vite preview"
11+
},
12+
"dependencies": {
13+
"@version-checker/browser": "*",
14+
"react": "^18.2.0",
15+
"react-dom": "^18.2.0",
16+
"react-query": "^3.39.3"
17+
},
18+
"devDependencies": {
19+
"@types/react": "^18.0.37",
20+
"@types/react-dom": "^18.0.11",
21+
"@typescript-eslint/eslint-plugin": "^5.59.0",
22+
"@typescript-eslint/parser": "^5.59.0",
23+
"@vitejs/plugin-react": "^4.0.0",
24+
"eslint": "^8.38.0",
25+
"eslint-plugin-react-hooks": "^4.6.0",
26+
"eslint-plugin-react-refresh": "^0.3.4",
27+
"typescript": "^5.0.2",
28+
"vite": "^4.3.9"
29+
}
30+
}
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#root {
2+
max-width: 1280px;
3+
margin: 0 auto;
4+
padding: 2rem;
5+
text-align: center;
6+
}
7+
8+
.logo {
9+
height: 6em;
10+
padding: 1.5em;
11+
will-change: filter;
12+
transition: filter 300ms;
13+
}
14+
15+
.logo:hover {
16+
filter: drop-shadow(0 0 2em #646cffaa);
17+
}
18+
19+
.logo.react:hover {
20+
filter: drop-shadow(0 0 2em #61dafbaa);
21+
}
22+
23+
@keyframes logo-spin {
24+
from {
25+
transform: rotate(0deg);
26+
}
27+
28+
to {
29+
transform: rotate(360deg);
30+
}
31+
}
32+
33+
@media (prefers-reduced-motion: no-preference) {
34+
a:nth-of-type(2) .logo {
35+
animation: logo-spin infinite 20s linear;
36+
}
37+
}
38+
39+
.card {
40+
border: 1px solid #888;
41+
border-radius: 8px;
42+
padding: 2em;
43+
margin-top: 24px;
44+
}
45+
46+
.read-the-docs {
47+
color: #888;
48+
}

0 commit comments

Comments
 (0)