Skip to content

Commit 097cbf9

Browse files
committed
bump pkg ver & update test-app to use react18
1 parent 6395617 commit 097cbf9

File tree

14 files changed

+616
-391
lines changed

14 files changed

+616
-391
lines changed

.github/workflows/publish.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,24 @@ jobs:
1111
run:
1212
working-directory: ./adblock-detect-react
1313
steps:
14-
- uses: actions/checkout@v2
15-
- uses: actions/setup-node@v1
14+
- uses: actions/checkout@v3
1615
with:
17-
node-version: 12
16+
fetch-depth: 2
17+
18+
- uses: actions/setup-node@v3
19+
with:
20+
node-version: 16
1821
registry-url: https://registry.npmjs.org/
19-
- run: yarn
20-
- run: yarn build
21-
- run: yarn publish --access public
22+
23+
- uses: pnpm/[email protected]
24+
name: Install pnpm
25+
id: pnpm-install
26+
with:
27+
version: 7
28+
run_install: true
29+
30+
- run: pnpm build
31+
32+
- run: npm publish --access public
2233
env:
2334
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
24-

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
auto-install-peers=false
2+
strict-peer-dependencies=false

LICENSE renamed to LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Arun George
3+
Copyright (c) 2020 - 2022 Arun George
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

adblock-detect-react/LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 - 2022 Arun George
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

adblock-detect-react/esm.tsconfig.json

Lines changed: 0 additions & 31 deletions
This file was deleted.

adblock-detect-react/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "adblock-detect-react",
3-
"version": "1.0.5",
3+
"version": "1.1.0",
44
"description": "Provides utilities to check if ad block is enabled on a page via both a React hook and a wrapper component.",
55
"main": "cjs/index.js",
66
"module": "esm/index.js",
7-
"types": "cjs/index.d.ts",
7+
"types": "esm/index.d.ts",
88
"author": "https://github.com/aruniverse",
99
"license": "MIT",
1010
"repository": {
@@ -25,11 +25,11 @@
2525
],
2626
"scripts": {
2727
"build": "npm run -s build:cjs && npm run -s build:esm",
28-
"build:cjs": "tsc -p cjs.tsconfig.json",
29-
"build:esm": "tsc -p esm.tsconfig.json",
28+
"build:cjs": "tsc 1>&2 --outDir cjs",
29+
"build:esm": "tsc 1>&2 --module ES2020 --outDir esm",
3030
"clean": "rimraf cjs esm",
31-
"rebuild": "yarn clean && yarn build",
32-
"publish:local": "yarn rebuild && yarn pack"
31+
"rebuild": "npm run -s clean && npm run -s build",
32+
"publish:local": "npm run -s rebuild && npm run -s pack"
3333
},
3434
"devDependencies": {
3535
"@types/react": "^16.9.43",

adblock-detect-react/src/hooks/useDetectAdBlock.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,9 @@ export const useDetectAdBlock = () => {
1010
method: "HEAD",
1111
mode: "no-cors",
1212
cache: "no-store",
13-
})
14-
// .then((res) => {
15-
// if (process.env.NODE_ENV !== "production") {
16-
// console.log(res);
17-
// }
18-
// })
19-
.catch((err) => {
20-
// if (process.env.NODE_ENV !== "production") {
21-
// console.log(err);
22-
// }
23-
setAdBlockDetected(true);
24-
});
13+
}).catch(() => {
14+
setAdBlockDetected(true);
15+
});
2516
}, []);
2617

2718
return adBlockDetected;

adblock-detect-react/cjs.tsconfig.json renamed to adblock-detect-react/tsconfig.json

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,18 @@
11
{
22
"compilerOptions": {
33
"target": "es2017",
4-
"lib": [
5-
// Required for async iterators/generators:
6-
"esnext.asynciterable",
7-
// These are the defaults for "target": "es2017", but they have to be explicitly specified if we want to add anything to "lib":
8-
"es2017",
9-
"dom",
10-
"dom.iterable",
11-
"scripthost"
12-
],
134
"module": "commonjs",
145
"skipLibCheck": true,
156
"esModuleInterop": true,
167
"allowSyntheticDefaultImports": true,
178
"strict": true,
189
"forceConsistentCasingInFileNames": true,
1910
"moduleResolution": "node",
20-
"resolveJsonModule": true,
2111
"jsx": "react",
2212
"declaration": true,
2313
"sourceMap": true,
2414
"inlineSources": true,
25-
"outDir": "./cjs",
26-
"downlevelIteration": true,
27-
"allowJs": true
15+
"removeComments": true,
2816
},
2917
"include": ["./src/**/*.ts*"],
3018
"exclude": ["cjs", "esm", "node_modules"]

package.json

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,12 @@
55
"scripts": {
66
"preinstall": "npx only-allow pnpm",
77
"build": "turbo run build",
8-
"clean": "turbo run clean && rm -rf node_modules"
8+
"clean": "turbo run clean",
9+
"clean:all": "turbo run clean && rimraf node_modules"
910
},
1011
"devDependencies": {
11-
"turbo": "latest"
12-
},
13-
"turbo": {
14-
"npmClient": "pnpm",
15-
"pipeline": {
16-
"build": {
17-
"dependsOn": [
18-
"^build"
19-
],
20-
"outputs": [
21-
"cjs/**",
22-
"esm/**",
23-
"dist/**"
24-
]
25-
},
26-
"lint": {}
27-
}
12+
"turbo": "latest",
13+
"rimraf": "3.0.2"
2814
},
2915
"resolutions": {
3016
"immer": "^8.0.1"

0 commit comments

Comments
 (0)