Skip to content

Commit 562b76d

Browse files
authored
Merge pull request #250 from Web3-API/prealpha-dev
Prep 0.0.1-prealpha.9
2 parents 6a84f68 + b1319a7 commit 562b76d

70 files changed

Lines changed: 1594 additions & 672 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v12.16.2
1+
v14.16.0

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
# Web3API 0.0.1-prealpha.9
2+
## Features
3+
* `@web3api/cli`: CLI Internalized Text Support
4+
* Currently English is implemented, and Spanish support is slated to be added next.
5+
* `@web3api/schema-parse`: GraphQL Infinite Cycle Detection
6+
* Bad object relationships within the Web3API's GraphQL schema are now automatically detected, ensuring developers never create objects that can never be instantiated properly.
7+
* `@web3api/templates`: Auto-Generate Smart Contract ABI & Bytecode Assemblyscript Module
8+
* This auto-generated module is being used within the `deployContract` mutation.
9+
10+
## Bug Fixes
11+
* `@web3api/core-js`: The `resolve-uri` core algorithm had an "off by one" iteration bug, where it never retried the first `api-resolver` in the implementations array.
12+
* `@web3api/ethereum-plugin-js`: When using a provider that lacks signing capabilities (ex: Infura RPC endpoint), the `getContract` function was trying to get a signer when one did not exist.
13+
* `@web3api/ipfs-plugin-js`: Fixed this plugin's schema, as it was using unsupported syntax.
14+
15+
## Misc
16+
* Upgrade node version to v14.16.0.
17+
* Upgrade TypeScript version to v4.0.7.
18+
119
# Web3API 0.0.1-prealpha.8
220
## Bug Fixes
321
* Fixed bug in `@web3api/react` package.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.1-prealpha.8
1+
0.0.1-prealpha.9

packages/cli/.eslintrc.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = {
2+
plugins: [
3+
"formatjs"
4+
],
5+
rules: {
6+
"formatjs/enforce-default-message": ["error", "literal"],
7+
"formatjs/enforce-placeholders": "error",
8+
"formatjs/no-camel-case": "warn",
9+
"formatjs/no-emoji": "warn",
10+
"formatjs/no-multiple-whitespaces": "warn",
11+
"formatjs/no-multiple-plurals": "warn",
12+
"formatjs/no-offset": "warn",
13+
"formatjs/enforce-id": ["off", { "idInterpolationPattern": "[sha512:contenthash:base64:6]" }]
14+
}
15+
};

packages/cli/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
compiled-lang/*.json
2+
src/lib/intl/types.ts

packages/cli/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
testMatch: ["**/__tests__/**/?(*.)+(spec|test).[jt]s?(x)"],
66
globals: {
77
"ts-jest": {
8-
diagnostics: false,
8+
diagnostics: false
99
},
1010
},
1111
setupFilesAfterEnv: ["./jest.setup.js"],

packages/cli/lang/en.json

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
{
2+
"commands_build_address": "ENS Address",
3+
"commands_build_description": "Builds a Web3API and (optionally) uploads it to IPFS",
4+
"commands_build_ensRegistry": "ENS Registry",
5+
"commands_build_error_outputDirMissingPath": "{option} option missing {argument} argument",
6+
"commands_build_error_resolution": "ENS Resolution Failed",
7+
"commands_build_error_testEnsAddressMissing": "{option} option missing {argument} argument",
8+
"commands_build_error_testEnsNodeMissing": "{option} option requires the {required} option",
9+
"commands_build_ethProvider": "Ethereum Provider",
10+
"commands_build_keypressListener_exit": "Exit: [CTRL + C], [ESC], or [Q]",
11+
"commands_build_keypressListener_watching": "Watching",
12+
"commands_build_options_e": "Publish the package to a test ENS domain locally (requires --ipfs)",
13+
"commands_build_options_e_address": "address",
14+
"commands_build_options_e_domain": "domain",
15+
"commands_build_options_h": "Show usage information",
16+
"commands_build_options_i": "Upload build results to an IPFS node (default: dev-server's node)",
17+
"commands_build_options_i_node": "node",
18+
"commands_build_options_o": "Output directory for build results (default: build/)",
19+
"commands_build_options_o_path": "path",
20+
"commands_build_options_options": "options",
21+
"commands_build_options_t": "Use the development server's ENS instance",
22+
"commands_build_options_w": "Automatically rebuild when changes are made (default: false)",
23+
"commands_build_uriViewers": "URI Viewers",
24+
"commands_codegen_description": "Auto-generate API Types",
25+
"commands_codegen_error_domain": "domain",
26+
"commands_codegen_options_e": "ENS address to lookup external schemas (default: 0x0000...2e1e)",
27+
"commands_codegen_options_e_address": "address",
28+
"commands_codegen_options_genFile": "Generation file",
29+
"commands_codegen_options_genFilePath": "Path to the generation file (default",
30+
"commands_codegen_options_h": "Show usage information",
31+
"commands_codegen_options_i": "IPFS node to load external schemas (default: dev-server's node)",
32+
"commands_codegen_options_i_node": "node",
33+
"commands_codegen_options_m": "Path to the Web3API manifest file (default",
34+
"commands_build_options_manifest": "manifest",
35+
"commands_codegen_options_o": "Output directory for generated types (default: types/)",
36+
"commands_codegen_options_o_path": "path",
37+
"commands_options_options": "options",
38+
"commands_codegen_success": "Types were generated successfully",
39+
"commands_create_description": "Create a new project with w3 CLI",
40+
"commands_create_directoryExists": "Directory with name {dir} already exists",
41+
"commands_create_error_commandFail": "Command failed: {error}",
42+
"commands_create_error_noCommand": "Please provide a command",
43+
"commands_create_error_noLang": "Please provide a language",
44+
"commands_create_error_noName": "Please provide a project name",
45+
"commands_create_error_outputDirMissingPath": "{option} option missing {argument} argument",
46+
"commands_create_error_unrecognizedCommand": "Unrecognized command",
47+
"commands_create_error_unrecognizedLanguage": "Unrecognized language",
48+
"commands_create_options_command": "command",
49+
"commands_create_options_commands": "Commands",
50+
"commands_create_options_createApp": "Create a Web3API application",
51+
"commands_create_options_createPlugin": "Create a Web3API plugin",
52+
"commands_create_options_createProject": "Create a Web3API project",
53+
"commands_create_options_h": "Show usage information",
54+
"commands_create_options_lang": "lang",
55+
"commands_create_options_langs": "langs",
56+
"commands_create_options_o": "Output directory for the new project",
57+
"commands_create_options_o_path": "path",
58+
"commands_create_options_projectName": "project-name",
59+
"commands_create_options_recipeScript": "recipe-script",
60+
"commands_create_overwritePrompt": "Do you want to overwrite this directory?",
61+
"commands_create_overwriting": "Overwriting {dir}...",
62+
"commands_create_readyDapp": "You are ready to build a dApp using Web3API",
63+
"commands_create_readyPlugin": "You are ready to build a plugin into a Web3API",
64+
"commands_create_readyProtocol": "You are ready to turn your protocol into a Web3API",
65+
"commands_create_settingUp": "Setting everything up...",
66+
"commands_query_description": "Query Web3APIs using recipe scripts",
67+
"commands_query_error_missingScript": "Required argument {script} is missing",
68+
"commands_query_error_noApi": "API needs to be initialized",
69+
"commands_query_error_readFail": "Failed to read query {query}",
70+
"commands_testEnv_description": "Manage a test environment for Web3API",
71+
"commands_testEnv_error_never": "This should never happen...",
72+
"commands_testEnv_error_noCommand": "No command given",
73+
"commands_testEnv_error_unrecognizedCommand": "Unrecognized command: {command}",
74+
"commands_testEnv_options_command": "command",
75+
"commands_testEnv_options_start": "Startup the test env",
76+
"commands_testEnv_options_stop": "Shutdown the test env",
77+
"commands_testEnv_shutdown_error": "Failed to shutdown test environment",
78+
"commands_testEnv_shutdown_text": "Shutting down test environment...",
79+
"commands_testEnv_shutdown_warning": "Warning shutting down test environment",
80+
"commands_testEnv_startup_error": "Failed to start test environment",
81+
"commands_testEnv_startup_text": "Starting test environment...",
82+
"commands_testEnv_startup_warning": "Warning starting test environment",
83+
"commands_w3_error_notACommand": "is not a command",
84+
"commands_w3_helpPrompt": "Type {command} to view common commands",
85+
"lib_codeGenerator_genCodeError": "Failed to generate types",
86+
"lib_codeGenerator_genCodeText": "Generate types",
87+
"lib_codeGenerator_genCodeWarning": "Warnings while generating types",
88+
"lib_codeGenerator_genTemplateStep": "Generating types from {path}",
89+
"lib_codeGenerator_wrongGenFile": "The generation file provided is wrong.",
90+
"lib_codeGenerator_templateNoModify": "NOTE: This is generated by 'w3 codegen', DO NOT MODIFY",
91+
"lib_codeGenerator_noRunMethod": "The generation file provided doesn't have the 'run' method.",
92+
"lib_compiler_compileError": "Failed to compile Web3API",
93+
"lib_compiler_compileText": "Compile Web3API",
94+
"lib_compiler_compileWarning": "Warnings while compiling Web3API",
95+
"lib_compiler_failedSchemaReturn": "Schema composer failed to return a combined schema.",
96+
"lib_compiler_missingDefinition": "Missing schema definition for the module {name}",
97+
"lib_compiler_step": "Compiling WASM module",
98+
"lib_compiler_noNodeModules": "could not locate {folder} in parent directories of web3api manifest",
99+
"lib_compiler_noInit": "WASM module is missing the _w3_init export. This should never happen...",
100+
"lib_compiler_noInvoke": "WASM module is missing the _w3_invoke export. This should never happen...",
101+
"lib_generators_projectGenerator_fallback": "Falling back to the local Yarn cache.",
102+
"lib_generators_projectGenerator_offline": "You appear to be offline.",
103+
"lib_helpers_manifest_loadError": "Failed to load web3api from {path}",
104+
"lib_helpers_manifest_loadText": "Load web3api from {path}",
105+
"lib_helpers_manifest_loadWarning": "Warnings loading web3api from {path}",
106+
"lib_helpers_manifest_outputError": "Failed to output web3api to {path}",
107+
"lib_helpers_manifest_outputText": "Output web3api to {path}",
108+
"lib_helpers_manifest_outputWarning": "Warnings outputting web3api to {path}",
109+
"lib_helpers_manifest_unableToDump": "Unable to dump manifest: {manifest}",
110+
"lib_helpers_manifest_unableToLoad": "Unable to load manifest: {path}",
111+
"lib_helpers_parameters_unexpectedValue": "Unexpected value provided for one or more of {options}. See --help for more information.",
112+
"lib_publishers_ipfsPublisher_urlMalformed": "IPFS URL Malformed",
113+
"lib_watcher_alreadyWatching": "Watcher session is already in progress. Directory: {dir}"
114+
}

packages/cli/lang/es.json

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
{
2+
"commands_build_address": "ENS Address",
3+
"commands_build_description": "Builds a Web3API and (optionally) uploads it to IPFS",
4+
"commands_build_ensRegistry": "ENS Registry",
5+
"commands_build_error_outputDirMissingPath": "{option} option missing {argument} argument",
6+
"commands_build_error_resolution": "ENS Resolution Failed",
7+
"commands_build_error_testEnsAddressMissing": "{option} option missing {argument} argument",
8+
"commands_build_error_testEnsNodeMissing": "{option} option requires the {required} option",
9+
"commands_build_ethProvider": "Ethereum Provider",
10+
"commands_build_keypressListener_exit": "Exit: [CTRL + C], [ESC], or [Q]",
11+
"commands_build_keypressListener_watching": "Watching",
12+
"commands_build_options_e": "Publish the package to a test ENS domain locally (requires --ipfs)",
13+
"commands_build_options_e_address": "address",
14+
"commands_build_options_e_domain": "domain",
15+
"commands_build_options_h": "Show usage information",
16+
"commands_build_options_i": "Upload build results to an IPFS node (default: dev-server's node)",
17+
"commands_build_options_i_node": "node",
18+
"commands_build_options_o": "Output directory for build results (default: build/)",
19+
"commands_build_options_o_path": "path",
20+
"commands_build_options_options": "options",
21+
"commands_build_options_t": "Use the development server's ENS instance",
22+
"commands_build_options_w": "Automatically rebuild when changes are made (default: false)",
23+
"commands_build_uriViewers": "URI Viewers",
24+
"commands_codegen_description": "Auto-generate API Types",
25+
"commands_codegen_error_domain": "domain",
26+
"commands_codegen_options_e": "ENS address to lookup external schemas (default: 0x0000...2e1e)",
27+
"commands_codegen_options_e_address": "address",
28+
"commands_codegen_options_genFile": "Generation file",
29+
"commands_codegen_options_genFilePath": "Path to the generation file (default",
30+
"commands_codegen_options_h": "Show usage information",
31+
"commands_codegen_options_i": "IPFS node to load external schemas (default: dev-server's node)",
32+
"commands_codegen_options_i_node": "node",
33+
"commands_codegen_options_m": "Path to the Web3API manifest file (default",
34+
"commands_build_options_manifest": "manifest",
35+
"commands_codegen_options_o": "Output directory for generated types (default: types/)",
36+
"commands_codegen_options_o_path": "path",
37+
"commands_options_options": "options",
38+
"commands_codegen_success": "Types were generated successfully",
39+
"commands_create_description": "Create a new project with w3 CLI",
40+
"commands_create_directoryExists": "Directory with name {dir} already exists",
41+
"commands_create_error_commandFail": "Command failed: {error}",
42+
"commands_create_error_noCommand": "Please provide a command",
43+
"commands_create_error_noLang": "Please provide a language",
44+
"commands_create_error_noName": "Please provide a project name",
45+
"commands_create_error_outputDirMissingPath": "{option} option missing {argument} argument",
46+
"commands_create_error_unrecognizedCommand": "Unrecognized command",
47+
"commands_create_error_unrecognizedLanguage": "Unrecognized language",
48+
"commands_create_options_command": "command",
49+
"commands_create_options_commands": "Commands",
50+
"commands_create_options_createApp": "Create a Web3API application",
51+
"commands_create_options_createPlugin": "Create a Web3API plugin",
52+
"commands_create_options_createProject": "Create a Web3API project",
53+
"commands_create_options_h": "Show usage information",
54+
"commands_create_options_lang": "lang",
55+
"commands_create_options_langs": "langs",
56+
"commands_create_options_o": "Output directory for the new project",
57+
"commands_create_options_o_path": "path",
58+
"commands_create_options_projectName": "project-name",
59+
"commands_create_options_recipeScript": "recipe-script",
60+
"commands_create_overwritePrompt": "Do you want to overwrite this directory?",
61+
"commands_create_overwriting": "Overwriting {dir}...",
62+
"commands_create_readyDapp": "You are ready to build a dApp using Web3API",
63+
"commands_create_readyPlugin": "You are ready to build a plugin into a Web3API",
64+
"commands_create_readyProtocol": "You are ready to turn your protocol into a Web3API",
65+
"commands_create_settingUp": "Setting everything up...",
66+
"commands_query_description": "Query Web3APIs using recipe scripts",
67+
"commands_query_error_missingScript": "Required argument {script} is missing",
68+
"commands_query_error_noApi": "API needs to be initialized",
69+
"commands_query_error_readFail": "Failed to read query {query}",
70+
"commands_testEnv_description": "Manage a test environment for Web3API",
71+
"commands_testEnv_error_never": "This should never happen...",
72+
"commands_testEnv_error_noCommand": "No command given",
73+
"commands_testEnv_error_unrecognizedCommand": "Unrecognized command: {command}",
74+
"commands_testEnv_options_command": "command",
75+
"commands_testEnv_options_start": "Startup the test env",
76+
"commands_testEnv_options_stop": "Shutdown the test env",
77+
"commands_testEnv_shutdown_error": "Failed to shutdown test environment",
78+
"commands_testEnv_shutdown_text": "Shutting down test environment...",
79+
"commands_testEnv_shutdown_warning": "Warning shutting down test environment",
80+
"commands_testEnv_startup_error": "Failed to start test environment",
81+
"commands_testEnv_startup_text": "Starting test environment...",
82+
"commands_testEnv_startup_warning": "Warning starting test environment",
83+
"commands_w3_error_notACommand": "is not a command",
84+
"commands_w3_helpPrompt": "Type {command} to view common commands",
85+
"lib_codeGenerator_genCodeError": "Failed to generate types",
86+
"lib_codeGenerator_genCodeText": "Generate types",
87+
"lib_codeGenerator_genCodeWarning": "Warnings while generating types",
88+
"lib_codeGenerator_genTemplateStep": "Generating types from {path}",
89+
"lib_codeGenerator_wrongGenFile": "The generation file provided is wrong.",
90+
"lib_codeGenerator_templateNoModify": "NOTE: This is generated by 'w3 codegen', DO NOT MODIFY",
91+
"lib_codeGenerator_noRunMethod": "The generation file provided doesn't have the 'run' method.",
92+
"lib_compiler_compileError": "Failed to compile Web3API",
93+
"lib_compiler_compileText": "Compile Web3API",
94+
"lib_compiler_compileWarning": "Warnings while compiling Web3API",
95+
"lib_compiler_failedSchemaReturn": "Schema composer failed to return a combined schema.",
96+
"lib_compiler_missingDefinition": "Missing schema definition for the module {name}",
97+
"lib_compiler_step": "Compiling WASM module",
98+
"lib_compiler_noNodeModules": "could not locate {folder} in parent directories of web3api manifest",
99+
"lib_compiler_noInit": "WASM module is missing the _w3_init export. This should never happen...",
100+
"lib_compiler_noInvoke": "WASM module is missing the _w3_invoke export. This should never happen...",
101+
"lib_generators_projectGenerator_fallback": "Falling back to the local Yarn cache.",
102+
"lib_generators_projectGenerator_offline": "You appear to be offline.",
103+
"lib_helpers_manifest_loadError": "Failed to load web3api from {path}",
104+
"lib_helpers_manifest_loadText": "Load web3api from {path}",
105+
"lib_helpers_manifest_loadWarning": "Warnings loading web3api from {path}",
106+
"lib_helpers_manifest_outputError": "Failed to output web3api to {path}",
107+
"lib_helpers_manifest_outputText": "Output web3api to {path}",
108+
"lib_helpers_manifest_outputWarning": "Warnings outputting web3api to {path}",
109+
"lib_helpers_manifest_unableToDump": "Unable to dump manifest: {manifest}",
110+
"lib_helpers_manifest_unableToLoad": "Unable to load manifest: {path}",
111+
"lib_helpers_parameters_unexpectedValue": "Unexpected value provided for one or more of {options}. See --help for more information.",
112+
"lib_publishers_ipfsPublisher_urlMalformed": "IPFS URL Malformed",
113+
"lib_watcher_alreadyWatching": "Watcher session is already in progress. Directory: {dir}"
114+
}

packages/cli/package.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
},
1717
"scripts": {
1818
"build": "rimraf ./build && tsc --project tsconfig.build.json",
19+
"prebuild": "ts-node ./scripts/generateIntlTypes.ts",
1920
"lint": "eslint --color --ext .ts src/",
2021
"test": "jest --passWithNoTests --runInBand --verbose",
2122
"test:ci": "jest --passWithNoTests --runInBand --verbose",
@@ -31,28 +32,33 @@
3132
"@web3api/schema-bind": "0.0.1-prealpha.8",
3233
"@web3api/schema-compose": "0.0.1-prealpha.8",
3334
"@web3api/schema-parse": "0.0.1-prealpha.8",
35+
"@formatjs/intl": "1.8.2",
3436
"assemblyscript": "0.17.14",
3537
"axios": "0.19.2",
3638
"chalk": "4.1.0",
37-
"chokidar": "^3.5.1",
39+
"chokidar": "3.5.1",
3840
"fs-extra": "9.0.1",
3941
"gluegun": "4.6.1",
4042
"graphql-tag": "2.11.0",
41-
"ipfs-http-client": "^48.1.3",
43+
"ipfs-http-client": "48.1.3",
4244
"js-yaml": "3.14.0",
4345
"mustache": "4.0.1",
4446
"ora": "4.0.0",
47+
"os-locale": "5.0.0",
4548
"spawn-command": "0.0.2-1",
4649
"ws": "7.3.1"
4750
},
4851
"devDependencies": {
4952
"@types/jest": "26.0.8",
5053
"@types/node": "12.6.9",
5154
"@web3api/test-env-js": "0.0.1-prealpha.8",
52-
"jest": "26.2.2",
55+
"jest": "26.6.3",
5356
"rimraf": "3.0.2",
54-
"ts-jest": "26.1.4",
55-
"typescript": "3.9.6"
57+
"ts-jest": "26.5.4",
58+
"typescript": "4.0.7",
59+
"ts-node": "8.10.2",
60+
"ts-morph": "10.0.1",
61+
"eslint-plugin-formatjs": "2.12.7"
5662
},
5763
"gitHead": "7346adaf5adb7e6bbb70d9247583e995650d390a",
5864
"publishConfig": {

0 commit comments

Comments
 (0)