Skip to content

Commit

Permalink
Merge branch 'move-migrate-to-cli' into 'main'
Browse files Browse the repository at this point in the history
migration to CLI

See merge request anagolay/anagolay-js!61
  • Loading branch information
woss committed Nov 26, 2022
2 parents 695948a + 487eae1 commit 95ae182
Show file tree
Hide file tree
Showing 38 changed files with 209 additions and 735 deletions.
1 change: 1 addition & 0 deletions .devops/gitpod/start-cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ PROJECT_ROOT=$(git rev-parse --show-toplevel)
pnpm env use --global 18.4.0

# brew install starship romkatv/powerlevel10k/powerlevel10k
brew install romkatv/powerlevel10k/powerlevel10k

# pnpm add --global @microsoft/rush

Expand Down
1 change: 1 addition & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tasks:
brew install romkatv/powerlevel10k/powerlevel10k neovim
node $GITPOD_REPO_ROOT/common/scripts/install-run-rush.js install
node $GITPOD_REPO_ROOT/common/scripts/install-run-rush.js build
node $GITPOD_REPO_ROOT/common/scripts/install-run-rush.js prettier
exit
- name: Start stuff
command: bash $GITPOD_REPO_ROOT/.devops/gitpod/start-cmd.sh && exit
Expand Down
10 changes: 5 additions & 5 deletions api-extractor-docs/json/api.api.json
Original file line number Diff line number Diff line change
Expand Up @@ -1150,19 +1150,19 @@
{
"kind": "Function",
"canonicalReference": "@anagolay/api!pallets.operations.retrieveOperationsPaged:function(1)",
"docComment": "/**\n * Fetch the operations and their versions.\n *\n * @param pageNum - \n *\n * @param pageSize - \n *\n * @returns Decoded structure {@link IOperationWithVersions}\n */\n",
"docComment": "/**\n * Fetch the operations and their versions.\n *\n * @param pageNum - default is `0`\n *\n * @param pageSize - default is `100`\n *\n * @returns Decoded structure {@link IOperationWithVersions}\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function retrieveOperationsPaged(pageNum: "
"text": "export declare function retrieveOperationsPaged(pageNum?: "
},
{
"kind": "Content",
"text": "number"
},
{
"kind": "Content",
"text": ", pageSize: "
"text": ", pageSize?: "
},
{
"kind": "Content",
Expand Down Expand Up @@ -1208,15 +1208,15 @@
"startIndex": 1,
"endIndex": 2
},
"isOptional": false
"isOptional": true
},
{
"parameterName": "pageSize",
"parameterTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"isOptional": false
"isOptional": true
}
],
"name": "retrieveOperationsPaged"
Expand Down
2 changes: 1 addition & 1 deletion api-extractor-docs/md/api.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ function requestVerificationAndSend(params: {
}, signer: AddressOrPair, options?: Partial<SignerOptions>): Promise<ICustomEventEmitter<[AccountId32, AnVerificationRequest]>>;

// @public
function retrieveOperationsPaged(pageNum: number, pageSize: number): Promise<IOperationWithVersions[]>;
function retrieveOperationsPaged(pageNum?: number, pageSize?: number): Promise<IOperationWithVersions[]>;

// @public
function save(operationData: OperationData, versionData: OperationVersionData, signer: AddressOrPair, options?: Partial<SignerOptions>): Promise<ICustomEventEmitter<unknown>>;
Expand Down
4 changes: 2 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@anagolay/app",
"version": "0.1.0",
"version": "0.2.0",
"description": "Anagolay Web App",
"license": "AGPLv3",
"type": "module",
Expand All @@ -15,7 +15,7 @@
"eslint:fix": "eslint --config ./.eslintrc.cjs --ignore-path ../.eslintignore --ext .svelte,.ts --fix .",
"package": "svelte-kit package",
"preview": "vite preview",
"publish:surge": "pnpm build:svelte && surge --domain anagolay.surge.sh",
"publish:surge": "pnpm build:app && surge --domain anagolay.surge.sh",
"surge": "surge",
"test": "playwright test"
},
Expand Down
1 change: 1 addition & 0 deletions app/svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const config = {
}),
kit: {
adapter: adapter({
// fallback: '200.html', // this is for the surge.sh
fallback: 'index.html',
precompress: true
}),
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
{
"packageName": "@anagolay/api",
"comment": "add new pallet. verification api",
"type": "minor"
"type": "patch"
}
],
"packageName": "@anagolay/api"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"changes": [
{
"packageName": "@anagolay/api",
"comment": "dsa",
"comment": "add default values",
"type": "patch"
}
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@anagolay/cli",
"comment": "add migration cli ",
"type": "minor"
}
],
"packageName": "@anagolay/cli"
}

This file was deleted.

This file was deleted.

This file was deleted.

51 changes: 0 additions & 51 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion common/config/rush/repo-state.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush.
{
"pnpmShrinkwrapHash": "46569f301d34ed2cfd9367831570f292a1228bf6",
"pnpmShrinkwrapHash": "916cdca97120aaf627d1b233815e98c1c70c512b",
"preferredVersionsHash": "e8a150a1598e394910b7d0337b3c1d7a488e8a77"
}
3 changes: 2 additions & 1 deletion common/config/rush/version-policies.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@
{
"policyName": "anagolayApi",
"definitionName": "lockStepVersion",
"version": "0.1.0"
"version": "0.1.0",
"nextBump": "minor"
},
// this is generally unstable and lockedMajor will NEVER change
{
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
idiyanale:
image: registry.gitlab.com/anagolay/anagolay/idiyanale:8dad9e18 # this is 4.x
image: registry.gitlab.com/anagolay/anagolay/idiyanale:5d1620bd
container_name: idiyanale_testet
volumes:
- idiyanale_data:/data
Expand Down
2 changes: 1 addition & 1 deletion libraries/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@anagolay/api",
"version": "0.2.0",
"version": "0.1.0",
"description": "Anagolay JS/TS API",
"homepage": "https://gitlab.com/anagolay/anagolay-js/-/tree/main/sdk/api#readme",
"bugs": {
Expand Down
8 changes: 4 additions & 4 deletions libraries/api/src/pallets/operations/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ export function createSubmittableExtrinsic(

/**
* Fetch the operations and their versions.
* @param pageNum -
* @param pageSize -
* @param pageNum - default is `0`
* @param pageSize - default is `100`
* @returns Decoded structure {@link IOperationWithVersions}
*/
export async function retrieveOperationsPaged(
pageNum: number,
pageSize: number
pageNum: number = 0,
pageSize: number = 100
): Promise<IOperationWithVersions[]> {
const api = getCachedApi();

Expand Down
2 changes: 1 addition & 1 deletion libraries/types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@anagolay/types",
"version": "0.2.0",
"version": "0.1.0",
"description": "Anagolay Custom and Auto-generated types and interfaces",
"keywords": [
"anagolay",
Expand Down
6 changes: 0 additions & 6 deletions rush.json
Original file line number Diff line number Diff line change
Expand Up @@ -449,12 +449,6 @@
"reviewCategory": "webapp",
"shouldPublish": false
},
{
"packageName": "@anagolay/migrate",
"projectFolder": "tools/migrate",
"reviewCategory": "tools",
"shouldPublish": false
},
{
"packageName": "testing-package",
"reviewCategory": "tools",
Expand Down
8 changes: 4 additions & 4 deletions tools/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@anagolay/cli",
"version": "0.1.0",
"version": "0.2.0",
"description": "Anagolay CLI",
"keywords": [],
"homepage": "https://gitlab.com/anagolay/network-js-sdk/-/tree/main/sdk/cli#readme",
Expand All @@ -22,9 +22,9 @@
"_phase:code-quality": "eslint --ignore-path ../../.eslintignore .",
"_phase:test": "heft test --no-build",
"build": "NODE_ENV=production heft test --clean",
"build:bin": "pkg --targets node16-linux ./dist/anagolay.js --out-path binaries",
"link:bin": "sudo ln -sf $GITPOD_REPO_ROOT/sdk/cli/dist/anagolay.js /usr/local/bin/anagolay && sudo chmod +x /usr/local/bin/anagolay",
"link:bin:lib": "sudo ln -sf $GITPOD_REPO_ROOT/sdk/cli/lib/index.js /usr/local/bin/anagolay-lib && sudo chmod +x /usr/local/bin/anagolay-lib",
"build:bin": "pkg --targets node18-linux ./dist/anagolay.js --out-path binaries",
"link:bin": "sudo ln -sf $GITPOD_REPO_ROOT/tools/cli/dist/anagolay.js /usr/local/bin/anagolay && sudo chmod +x /usr/local/bin/anagolay",
"link:bin:lib": "sudo ln -sf $GITPOD_REPO_ROOT/tools/cli/lib/index.js /usr/local/bin/anagolay-lib && sudo chmod +x /usr/local/bin/anagolay-lib",
"lint": "eslint ./src --ext .js,.jsx,.ts,.tsx",
"start": "heft start",
"watch": "heft build --clean --watch",
Expand Down
20 changes: 20 additions & 0 deletions tools/cli/src/commands/migrate/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Command } from 'commander';

import operations from './subCommands/operations';

/**
* Workflow main Command
*
* @remarks Usage `anagolay help workflow`
*
* @public
*/
export default async function makeCommand(): Promise<Command> {
const cmd = new Command('migrate');
cmd.description('Migration commands, useful when you want to pull something from one chain to another');

// add subcommands
cmd.addCommand(await operations());

return cmd;
}
Loading

0 comments on commit 95ae182

Please sign in to comment.