diff --git a/.github/workflows/pr-any.yml b/.github/workflows/pr-any.yml index de9f8a44e..599248325 100644 --- a/.github/workflows/pr-any.yml +++ b/.github/workflows/pr-any.yml @@ -5,7 +5,7 @@ jobs: pr: strategy: matrix: - step: ['lint', 'test', 'build', 'docs'] + step: ['lint', 'test', 'build'] name: ${{ matrix.step }} runs-on: ubuntu-latest steps: diff --git a/.github/workflows/push-master.yml b/.github/workflows/push-master.yml index 017387cee..22b6eb75e 100644 --- a/.github/workflows/push-master.yml +++ b/.github/workflows/push-master.yml @@ -8,7 +8,7 @@ jobs: master: strategy: matrix: - step: ['build:release', 'docs:release'] + step: ['build:release'] name: ${{ matrix.step }} if: "! startsWith(github.event.head_commit.message, '[CI Skip]') && github.repository == 'polkadot-js/phishing'" runs-on: ubuntu-latest @@ -18,7 +18,6 @@ jobs: token: ${{ secrets.GH_PAT }} - name: ${{ matrix.step }} env: - GH_PAGES_SRC: docs GH_PAT: ${{ secrets.GH_PAT }} GH_RELEASE_GITHUB_API_TOKEN: ${{ secrets.GH_PAT }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 000000000..3a6f28117 --- /dev/null +++ b/docs/README.md @@ -0,0 +1 @@ +Please see https://github.com/polkadot-js/phishing diff --git a/lerna.json b/lerna.json new file mode 100644 index 000000000..781ca9b67 --- /dev/null +++ b/lerna.json @@ -0,0 +1,13 @@ +{ + "npmClient": "yarn", + "useWorkspaces": true, + "command": { + "publish": { + "allowBranch": "master" + } + }, + "packages": [ + "packages/*" + ], + "version": "0.1.0" +} diff --git a/package.json b/package.json index 3c0930440..ceb4f4579 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,10 @@ "repository": "https://github.com/polkadot-js/phishing", "author": "Jaco Greeff ", "license": "Apache-2", + "private": true, + "workspaces": [ + "packages/*" + ], "resolutions": { "babel-core": "^7.0.0-bridge.0", "typescript": "^4.0.2" @@ -9,16 +13,11 @@ "scripts": { "build": "polkadot-dev-build-ts", "build:release": "polkadot-ci-ghact-build --skip-beta", - "docs": "echo \"no docs build step\"", - "docs:release": "polkadot-ci-ghact-docs", "lint": "polkadot-dev-run-lint", "clean": "polkadot-dev-clean-build", "postinstall": "polkadot-dev-yarn-only", "test": "echo \"no tests\"" }, - "dependencies": { - "@polkadot/x-fetch": "^0.3.2" - }, "devDependencies": { "@babel/core": "^7.11.6", "@polkadot/dev": "^0.55.53", diff --git a/LICENSE b/packages/phishing/LICENSE similarity index 100% rename from LICENSE rename to packages/phishing/LICENSE diff --git a/packages/phishing/README.md b/packages/phishing/README.md new file mode 100644 index 000000000..48d1d1de7 --- /dev/null +++ b/packages/phishing/README.md @@ -0,0 +1,9 @@ +# @polkadot/phishing + +```js +import loadAndCheck from '@polkadot/phishing'; + +const isOnDeny = await retrieveCheckDeny(window.location.host); + +console.log(`isOnDeny=${isOnDeny}`); +``` diff --git a/packages/phishing/package.json b/packages/phishing/package.json new file mode 100644 index 000000000..734d22796 --- /dev/null +++ b/packages/phishing/package.json @@ -0,0 +1,28 @@ +{ + "name": "@polkadot/phishing", + "version": "0.1.0", + "description": "Simple phishing scripts from a central source", + "main": "index.js", + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/polkadot-js/phishing.git" + }, + "author": "Jaco Greeff ", + "maintainers": [ + "Jaco Greeff " + ], + "contributors": [], + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/polkadot-js/phishing/issues" + }, + "homepage": "https://github.com/polkadot-js/common/tree/master/packages/phishing#readme", + "dependencies": { + "@babel/runtime": "^7.11.2", + "@polkadot/x-fetch": "0.3.2" + } +} diff --git a/src/index.ts b/packages/phishing/src/index.ts similarity index 92% rename from src/index.ts rename to packages/phishing/src/index.ts index 6f231831c..a7cd79785 100644 --- a/src/index.ts +++ b/packages/phishing/src/index.ts @@ -14,7 +14,7 @@ export async function retrieveHostList (): Promise { } // checks a host to see if it appears in the list -export async function checkHost (items: string[], host: string): Promise { +export function checkHost (items: string[], host: string): boolean { const hostParts = host.split('.').reverse(); return items.some((item): boolean => { diff --git a/src/types.ts b/packages/phishing/src/types.ts similarity index 100% rename from src/types.ts rename to packages/phishing/src/types.ts diff --git a/yarn.lock b/yarn.lock index 79bfa9137..83a4a22eb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2847,7 +2847,16 @@ __metadata: languageName: node linkType: hard -"@polkadot/x-fetch@npm:^0.3.2": +"@polkadot/phishing@workspace:packages/phishing": + version: 0.0.0-use.local + resolution: "@polkadot/phishing@workspace:packages/phishing" + dependencies: + "@babel/runtime": ^7.11.2 + "@polkadot/x-fetch": 0.3.2 + languageName: unknown + linkType: soft + +"@polkadot/x-fetch@npm:0.3.2": version: 0.3.2 resolution: "@polkadot/x-fetch@npm:0.3.2" dependencies: @@ -15352,7 +15361,6 @@ fsevents@^1.2.7: dependencies: "@babel/core": ^7.11.6 "@polkadot/dev": ^0.55.53 - "@polkadot/x-fetch": ^0.3.2 "@types/jest": ^26.0.10 languageName: unknown linkType: soft