diff --git a/.github/workflows/generate-docs.yml b/.github/legacy-workflows/generate-docs.yml similarity index 97% rename from .github/workflows/generate-docs.yml rename to .github/legacy-workflows/generate-docs.yml index af04a0c0..dea273a7 100644 --- a/.github/workflows/generate-docs.yml +++ b/.github/legacy-workflows/generate-docs.yml @@ -1,4 +1,4 @@ -name: Generate Documentation +## name: Generate Documentation on: push: diff --git a/.github/workflows/test-browser.yml b/.github/legacy-workflows/test-browser.yml similarity index 100% rename from .github/workflows/test-browser.yml rename to .github/legacy-workflows/test-browser.yml diff --git a/.github/workflows/test-ci.yml b/.github/legacy-workflows/test-ci.yml similarity index 100% rename from .github/workflows/test-ci.yml rename to .github/legacy-workflows/test-ci.yml diff --git a/.github/workflows/test-env.yml b/.github/legacy-workflows/test-env.yml similarity index 100% rename from .github/workflows/test-env.yml rename to .github/legacy-workflows/test-env.yml diff --git a/.github/workflows/branch-build.yml b/.github/workflows/branch-build.yml new file mode 100644 index 00000000..6cf4cf2b --- /dev/null +++ b/.github/workflows/branch-build.yml @@ -0,0 +1,21 @@ +name: Auto Version Branch Workflow +on: + pull_request: + types: [closed] + branches: + - 'v?[0-9]+.[0-9]+' +jobs: + call-common-workflow: + uses: dominant-strategies/quai-cicd/.github/workflows/deploy-sandbox-common.yml@main + with: + needs_build: true + install_command: "npm ci" + build_command": "npm run build-clean" + cloud_deploy: false + skip_deploy: true + update_version: false + needs_docker: false + include_chart: false + secrets: + GH_PAT: ${{ secrets.GH_PAT }} + BUILD_ARGS: '' diff --git a/.github/workflows/cut-release.yml b/.github/workflows/cut-release.yml new file mode 100644 index 00000000..ba5e8c57 --- /dev/null +++ b/.github/workflows/cut-release.yml @@ -0,0 +1,26 @@ +name: Cut Release +on: + workflow_dispatch: + inputs: + branch: + description: 'Branch to use' + required: true + default: 'master' +jobs: + call-common-workflow: + uses: dominant-strategies/quai-cicd/.github/workflows/cut-release-common.yml@main + with: + branch: ${{ github.event.inputs.branch }} + needs_build: true + needs_docker: false + install_command: "npm ci" + build_command: "npm run build-clean" + cloud_deploy: false + skip_deploy: true + update_version: true + include_chart: false + secrets: + GH_PAT: ${{ secrets.GH_PAT }} + BUILD_ARGS: '' + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY2 }} + GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml new file mode 100644 index 00000000..5faa271c --- /dev/null +++ b/.github/workflows/dev-build.yml @@ -0,0 +1,20 @@ +name: Auto Dev Workflow +on: + pull_request: + types: [closed] + branches: [ "master" ] +jobs: + call-common-workflow: + uses: dominant-strategies/quai-cicd/.github/workflows/deploy-dev-common.yml@main + with: + needs_build: true + install_command: "npm ci" + build_command: "npm run build-clean" + cloud_deploy: false + skip_deploy: true + update_version: false + needs_docker: false + include_chart: false + secrets: + GH_PAT: ${{ secrets.GH_PAT }} + BUILD_ARGS: '' diff --git a/.github/workflows/patch.yml b/.github/workflows/patch.yml new file mode 100644 index 00000000..7f76dccf --- /dev/null +++ b/.github/workflows/patch.yml @@ -0,0 +1,20 @@ +name: Deploy to Garden +on: workflow_dispatch +jobs: + call-common-workflow: + uses: dominant-strategies/quai-cicd/.github/workflows/deploy-sandbox-common.yml@main + with: + needs_build: true + needs_docker: false + install_command: "npm ci" + build_command: "npm run build-clean" + cloud_deploy: false + skip_deploy: true + update_version: true + include_chart: false + secrets: + GH_PAT: ${{ secrets.GH_PAT }} + BUILD_ARGS: '' + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY2 }} + GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} + GH_GCP_TOKEN: ${{ secrets.GH_GCP_TOKEN }} diff --git a/README.md b/README.md index 6a9364f2..02b8bb56 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,65 @@ The bundled library is available in the `./dist/` folder in this repo. ``` +### Using Local Version as Dependency in Other Projects + +For developers looking to contribute to quais or integrate it into their projects with local modifications, setting up a local development environment is essential. This section guides you through the process of building quais and linking it to another project on your machine using npm link. + +**Prepare quais for Symbolic Linking** + +1. Clone the quais repository and navigate into it. + + ```bash + git clone https://github.com/dominant-strategies/quais-6.js.git + cd quais-6.js + ``` + +2. Install dependencies. + + ``` bash + npm install + ``` + +3. Create a global symbolic link for quais. This makes the quais package available to link in any other project. Whenever a local change is made to quais that you want to test in another project, you must run this command again to update the symbolic link. + + ```bash + npm run update-symlink + ``` + + _Caution - The `update-symlink` command updates the globally available symbolic link to the build of the current branch you are on when the command is run. This can potentially lead to incompatible version usage if quais is linked to multiple projects locally._ + +**Linking quais to Another Project** + +After setting up quais for local development, you can link it to another project to test changes or develop features that depend on quais. + +1. Navigate to your project. + ```bash + cd path/to/your/project + ``` +2. Link the globally linked quais package to your project. This replaces the npm-installed quais package with the symlinked version. + ```bash + npm link quais + ``` +3. Build your project: Depending on your project's setup, you may need to rebuild it to ensure that the linked quais library is correctly integrated. +npm run build + +**Testing Changes** + +With quais linked to your project, any changes made to the quais library can be immediately tested within the context of your project. Remember to rebuild quais (`npm run update-symlink`) after making changes to ensure they are reflected in your project. + +**Reverting to the Published Package** + +If you need to revert back to the official quais package published on npm, you can unlink quais and reinstall the package. +1. Unlink quais by removing the symlink. + ```bash + npm unlink quais + ``` + +2. Reinstall quais: Install the quais package from npm to use the published version. + ```bash + npm install quais + ``` + ## Documentation Browse the [documentation](https://docs.quais.org) online: diff --git a/package-lock.json b/package-lock.json index 2098291a..84d20d1c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "quais6", - "version": "0.0.1", + "version": "v0.1.0-pre", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "quais6", - "version": "0.0.1", + "version": "v0.1.0-pre", "license": "MIT", "dependencies": { "@adraffy/ens-normalize": "1.10.0", @@ -14,6 +14,7 @@ "@noble/hashes": "1.3.2", "@types/node": "18.15.13", "aes-js": "4.0.0-beta.5", + "axios": "^1.6.7", "dotenv": "^16.4.1", "google-protobuf": "^3.21.2", "tslib": "2.4.0", @@ -253,6 +254,21 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "node_modules/axios": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", + "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", + "dependencies": { + "follow-redirects": "^1.15.4", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -417,6 +433,17 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -487,6 +514,14 @@ "node": ">=0.10.0" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/diff": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", @@ -577,6 +612,25 @@ "flat": "cli.js" } }, + "node_modules/follow-redirects": { + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", + "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/foreground-child": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", @@ -590,6 +644,19 @@ "node": ">=8.0.0" } }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -956,6 +1023,25 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/minimatch": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", @@ -1144,6 +1230,11 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", diff --git a/package.json b/package.json index 8daa754c..fe669516 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "@noble/hashes": "1.3.2", "@types/node": "18.15.13", "aes-js": "4.0.0-beta.5", + "axios": "^1.6.7", "dotenv": "^16.4.1", "google-protobuf": "^3.21.2", "tslib": "2.4.0", @@ -85,7 +86,7 @@ "default": "./lib.commonjs/wordlists/index.js" } }, - "gitHead": "f3e4f59d2e076da4483e1c45a54d728972b59066", + "gitHead": "3bd0bf5b077f4aa5fab480474e3982e50e1af506", "homepage": "https://qu.ai", "keywords": [ "quainetwork", @@ -110,10 +111,11 @@ "auto-build": "npm run build -- -w", "build": "tsc --project tsconfig.esm.json", "build-all": "npm run build && npm run build-commonjs", - "build-clean": "npm run clean && npm run build && node lib.esm/_admin/update-version.js && node lib.esm/_admin/update-changelog.js && npm run build-all && npm run _build-dist && npm run _dist-stats", + "build-clean": "npm run clean && npm run build && npm run build-all && npm run _build-dist && npm run _dist-stats", "build-commonjs": "tsc --project tsconfig.commonjs.json", "build-dist": "npm run build && npm run _build-dist && npm run _dist-stats", "clean": "rm -rf dist lib.esm lib.commonjs && cp -r misc/basedirs/* .", + "update-symlink": "npm run clean && npm run build-all && npm rm -g quais-6 -g && npm link", "postpublish": "node lib.esm/_admin/create-release.js", "stats": "echo 'Dependencies' && npm ls --all --omit=dev", "test": "npm run test-esm", @@ -123,5 +125,5 @@ "test-esm": "mocha --trace-warnings --reporter ./reporter.cjs ./lib.esm/_tests/test-*.js" }, "sideEffects": false, - "version": "0.0.1" -} + "version": "v0.1.0-pre" +} \ No newline at end of file