Skip to content

Commit

Permalink
feat: global declare
Browse files Browse the repository at this point in the history
  • Loading branch information
monkeyWie committed Dec 4, 2023
1 parent 7c99677 commit 5515fb6
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"version": "1.2.3",
"version": "1.3.0",
"packageManager": "[email protected]",
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/create-gopeed-ext/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-gopeed-ext",
"version": "1.2.3",
"version": "1.3.0",
"keywords": [
"gopeed"
],
Expand Down
6 changes: 5 additions & 1 deletion packages/create-gopeed-ext/templates/webpack/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
"prettier/prettier": "error"
},
"env": {
"browser": true
"browser": true,
"node": true
},
"globals": {
"gopeed": true
}
}
4 changes: 2 additions & 2 deletions packages/create-gopeed-ext/templates/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"gopeed": "^1.2.3",
"@gopeed/types": "^1.2.3",
"gopeed": "^1.3.0",
"@gopeed/types": "^1.3.0",
"prettier": "^3.0.3",
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1"
Expand Down
2 changes: 0 additions & 2 deletions packages/create-gopeed-ext/templates/webpack/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import gopeed from 'gopeed';

gopeed.events.onResolve((ctx) => {
ctx.res = {
name: 'example',
Expand Down
2 changes: 1 addition & 1 deletion packages/gopeed-rest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gopeed/rest",
"version": "1.2.3",
"version": "1.3.0",
"description": "",
"main": "dist/index.js",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/gopeed-types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gopeed/types",
"version": "1.2.3",
"version": "1.3.0",
"description": "",
"main": "dist/index.js",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/gopeed/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gopeed",
"version": "1.2.3",
"version": "1.3.0",
"description": "",
"main": "dist/index.js",
"exports": {
Expand Down
6 changes: 3 additions & 3 deletions packages/gopeed/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ interface Gopeed {
storage: Storage;
}

declare const gopeed: Gopeed;

export default gopeed;
declare global {
const gopeed: Gopeed;
}

0 comments on commit 5515fb6

Please sign in to comment.