Skip to content

Commit

Permalink
bump pkg ver & update test-app to use react18
Browse files Browse the repository at this point in the history
  • Loading branch information
aruniverse committed Sep 16, 2022
1 parent 6395617 commit 097cbf9
Show file tree
Hide file tree
Showing 14 changed files with 616 additions and 391 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,24 @@ jobs:
run:
working-directory: ./adblock-detect-react
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
with:
node-version: 12
fetch-depth: 2

- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: yarn
- run: yarn build
- run: yarn publish --access public

- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: true

- run: pnpm build

- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
auto-install-peers=false
strict-peer-dependencies=false
2 changes: 1 addition & 1 deletion LICENSE → LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Arun George
Copyright (c) 2020 - 2022 Arun George

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
21 changes: 21 additions & 0 deletions adblock-detect-react/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 - 2022 Arun George

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
31 changes: 0 additions & 31 deletions adblock-detect-react/esm.tsconfig.json

This file was deleted.

12 changes: 6 additions & 6 deletions adblock-detect-react/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "adblock-detect-react",
"version": "1.0.5",
"version": "1.1.0",
"description": "Provides utilities to check if ad block is enabled on a page via both a React hook and a wrapper component.",
"main": "cjs/index.js",
"module": "esm/index.js",
"types": "cjs/index.d.ts",
"types": "esm/index.d.ts",
"author": "https://github.com/aruniverse",
"license": "MIT",
"repository": {
Expand All @@ -25,11 +25,11 @@
],
"scripts": {
"build": "npm run -s build:cjs && npm run -s build:esm",
"build:cjs": "tsc -p cjs.tsconfig.json",
"build:esm": "tsc -p esm.tsconfig.json",
"build:cjs": "tsc 1>&2 --outDir cjs",
"build:esm": "tsc 1>&2 --module ES2020 --outDir esm",
"clean": "rimraf cjs esm",
"rebuild": "yarn clean && yarn build",
"publish:local": "yarn rebuild && yarn pack"
"rebuild": "npm run -s clean && npm run -s build",
"publish:local": "npm run -s rebuild && npm run -s pack"
},
"devDependencies": {
"@types/react": "^16.9.43",
Expand Down
15 changes: 3 additions & 12 deletions adblock-detect-react/src/hooks/useDetectAdBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,9 @@ export const useDetectAdBlock = () => {
method: "HEAD",
mode: "no-cors",
cache: "no-store",
})
// .then((res) => {
// if (process.env.NODE_ENV !== "production") {
// console.log(res);
// }
// })
.catch((err) => {
// if (process.env.NODE_ENV !== "production") {
// console.log(err);
// }
setAdBlockDetected(true);
});
}).catch(() => {
setAdBlockDetected(true);
});
}, []);

return adBlockDetected;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
{
"compilerOptions": {
"target": "es2017",
"lib": [
// Required for async iterators/generators:
"esnext.asynciterable",
// These are the defaults for "target": "es2017", but they have to be explicitly specified if we want to add anything to "lib":
"es2017",
"dom",
"dom.iterable",
"scripthost"
],
"module": "commonjs",
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"jsx": "react",
"declaration": true,
"sourceMap": true,
"inlineSources": true,
"outDir": "./cjs",
"downlevelIteration": true,
"allowJs": true
"removeComments": true,
},
"include": ["./src/**/*.ts*"],
"exclude": ["cjs", "esm", "node_modules"]
Expand Down
22 changes: 4 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,12 @@
"scripts": {
"preinstall": "npx only-allow pnpm",
"build": "turbo run build",
"clean": "turbo run clean && rm -rf node_modules"
"clean": "turbo run clean",
"clean:all": "turbo run clean && rimraf node_modules"
},
"devDependencies": {
"turbo": "latest"
},
"turbo": {
"npmClient": "pnpm",
"pipeline": {
"build": {
"dependsOn": [
"^build"
],
"outputs": [
"cjs/**",
"esm/**",
"dist/**"
]
},
"lint": {}
}
"turbo": "latest",
"rimraf": "3.0.2"
},
"resolutions": {
"immer": "^8.0.1"
Expand Down
Loading

1 comment on commit 097cbf9

@vercel
Copy link

@vercel vercel bot commented on 097cbf9 Sep 16, 2022

Choose a reason for hiding this comment

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

Please sign in to comment.