@sentio/cli 1.0.5 → 1.1.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/build.js CHANGED
@@ -26,10 +26,10 @@ exports.buildProcessor = buildProcessor;
26
26
  async function buildProcessorForTarget(onlyGen) {
27
27
  await codeGenEthersProcessor(path_1.default.join('abis', 'evm'));
28
28
  // eslint-disable-next-line @typescript-eslint/no-var-requires
29
- const solanaModule = require('@sentio/sdk/lib/solana-codegen/codegen');
29
+ const solanaModule = require('@sentio/sdk-solana/lib/codegen/codegen');
30
30
  solanaModule.codeGenSolanaProcessor(path_1.default.join('abis', 'solana'));
31
31
  // eslint-disable-next-line @typescript-eslint/no-var-requires
32
- const aptosModuole = require('@sentio/sdk/lib/aptos-codegen/codegen');
32
+ const aptosModuole = require('@sentio/sdk-aptos/lib/codegen/codegen');
33
33
  aptosModuole.codeGenAptosProcessor(path_1.default.join('abis', 'aptos'));
34
34
  if (onlyGen) {
35
35
  return;
package/lib/build.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"build.js","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AACzB,gDAAuB;AACvB,4CAAmB;AACnB,iDAAoC;AAE7B,KAAK,UAAU,cAAc,CAAC,OAAgB;IACnD,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,WAAW,EAAE,CAAA;KACpB;IAED,oFAAoF;IACpF,uBAAuB;IACvB,MAAM,uBAAuB,CAAC,OAAO,CAAC,CAAA;IACtC,IAAI;IAEJ,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,cAAc,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAA;QAChE,MAAM,QAAQ,CAAC,eAAe,EAAE,SAAS,CAAC,CAAA;QAC1C,MAAM,QAAQ,CAAC,wBAAwB,GAAG,cAAc,EAAE,WAAW,CAAC,CAAA;KACvE;AACH,C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EAAE,CAAA;AACf,CAAC","sourcesContent":["import chalk from 'chalk'\nimport path from 'path'\nimport fs from 'fs'\nimport { exec } from 'child_process'\n\nexport async function buildProcessor(onlyGen: boolean) {\n if (!onlyGen) {\n await installDeps()\n }\n\n // targets.forEach(async (target) => await buildProcessorForTarget(onlyGen, target))\n // for (const target) {\n await buildProcessorForTarget(onlyGen)\n // }\n\n if (!onlyGen) {\n const WEBPACK_CONFIG = path.join(__dirname, 'webpack.config.js')\n await execStep('yarn tsc -p .', 'Compile')\n await execStep('yarn webpack --config=' + WEBPACK_CONFIG, 'Packaging')\n }\n}\n\nasync function buildProcessorForTarget(onlyGen: boolean) {\n await codeGenEthersProcessor(path.join('abis', 'evm'))\n\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const solanaModule = require('@sentio/sdk/lib/solana-codegen/codegen')\n solanaModule.codeGenSolanaProcessor(path.join('abis', 'solana'))\n\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const aptosModuole = require('@sentio/sdk/lib/aptos-codegen/codegen')\n aptosModuole.codeGenAptosProcessor(path.join('abis', 'aptos'))\n\n if (onlyGen) {\n return\n }\n}\n\nasync function installDeps() {\n await execStep('yarn install --ignore-scripts', 'Yarn Install')\n}\n\nexport async function codeGenEthersProcessor(\n abisDir: string,\n ETHERS_TARGET = path.dirname(require.resolve('@sentio/sdk/lib/target-ethers-sentio')),\n outDir = 'src/types/internal'\n) {\n if (!fs.existsSync(abisDir)) {\n return\n }\n\n let haveJson = false\n const files = fs.readdirSync(abisDir)\n for (const file of files) {\n if (file.toLowerCase().endsWith('.json')) {\n haveJson = true\n break\n }\n }\n if (!haveJson) {\n return\n }\n\n console.log(chalk.green('Generated Types for EVM'))\n\n // TODO this will fail during postinstall, need to locate real typechain path\n await execStep(\n 'yarn typechain --target ' + ETHERS_TARGET + ` --out-dir ${outDir} ${path.join(abisDir, '*.json')}`,\n 'Type definitions gen'\n )\n}\n\nasync function execStep(cmd: string, stepName: string) {\n const child = exec(cmd)\n console.log(chalk.blue(stepName + ' begin'))\n\n if (!child.stdout || !child.stderr) {\n console.error(chalk.red(stepName + ' failed'))\n process.exit(1)\n }\n\n child.stdout.pipe(process.stdout)\n child.stderr.pipe(process.stderr)\n\n await new Promise((resolve) => {\n child.on('close', resolve)\n })\n\n if (child.exitCode) {\n console.error(chalk.red(stepName + ' failed'))\n process.exit(child.exitCode)\n }\n console.log(chalk.blue(stepName + ' success'))\n console.log()\n}\n"]}
1
+ {"version":3,"file":"build.js","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AACzB,gDAAuB;AACvB,4CAAmB;AACnB,iDAAoC;AAE7B,KAAK,UAAU,cAAc,CAAC,OAAgB;IACnD,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,WAAW,EAAE,CAAA;KACpB;IAED,oFAAoF;IACpF,uBAAuB;IACvB,MAAM,uBAAuB,CAAC,OAAO,CAAC,CAAA;IACtC,IAAI;IAEJ,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,cAAc,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAA;QAChE,MAAM,QAAQ,CAAC,eAAe,EAAE,SAAS,CAAC,CAAA;QAC1C,MAAM,QAAQ,CAAC,wBAAwB,GAAG,cAAc,EAAE,WAAW,CAAC,CAAA;KACvE;AACH,CAAC;AAfD,wCAeC;AAED,KAAK,UAAU,uBAAuB,CAAC,OAAgB;IACrD,MAAM,sBAAsB,CAAC,cAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAA;IAEtD,8DAA8D;IAC9D,MAAM,YAAY,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAA;IACtE,YAAY,CAAC,sBAAsB,CAAC,cAAI,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAA;IAEhE,8DAA8D;IAC9D,MAAM,YAAY,GAAG,OAAO,CAAC,uCAAuC,CAAC,CAAA;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AG,QAAQ,CAAC,CAAC,CAAA;IAE5C,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;QAClC,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAA;QAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;KAChB;IAED,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IACjC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IAEjC,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC5B,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAC5B,CAAC,CAAC,CAAA;IAEF,IAAI,KAAK,CAAC,QAAQ,EAAE;QAClB,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAA;QAC9C,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;KAC7B;IACD,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,CAAC,CAAA;IAC9C,OAAO,CAAC,GAAG,EAAE,CAAA;AACf,CAAC","sourcesContent":["import chalk from 'chalk'\nimport path from 'path'\nimport fs from 'fs'\nimport { exec } from 'child_process'\n\nexport async function buildProcessor(onlyGen: boolean) {\n if (!onlyGen) {\n await installDeps()\n }\n\n // targets.forEach(async (target) => await buildProcessorForTarget(onlyGen, target))\n // for (const target) {\n await buildProcessorForTarget(onlyGen)\n // }\n\n if (!onlyGen) {\n const WEBPACK_CONFIG = path.join(__dirname, 'webpack.config.js')\n await execStep('yarn tsc -p .', 'Compile')\n await execStep('yarn webpack --config=' + WEBPACK_CONFIG, 'Packaging')\n }\n}\n\nasync function buildProcessorForTarget(onlyGen: boolean) {\n await codeGenEthersProcessor(path.join('abis', 'evm'))\n\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const solanaModule = require('@sentio/sdk-solana/lib/codegen/codegen')\n solanaModule.codeGenSolanaProcessor(path.join('abis', 'solana'))\n\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const aptosModuole = require('@sentio/sdk-aptos/lib/codegen/codegen')\n aptosModuole.codeGenAptosProcessor(path.join('abis', 'aptos'))\n\n if (onlyGen) {\n return\n }\n}\n\nasync function installDeps() {\n await execStep('yarn install --ignore-scripts', 'Yarn Install')\n}\n\nexport async function codeGenEthersProcessor(\n abisDir: string,\n ETHERS_TARGET = path.dirname(require.resolve('@sentio/sdk/lib/target-ethers-sentio')),\n outDir = 'src/types/internal'\n) {\n if (!fs.existsSync(abisDir)) {\n return\n }\n\n let haveJson = false\n const files = fs.readdirSync(abisDir)\n for (const file of files) {\n if (file.toLowerCase().endsWith('.json')) {\n haveJson = true\n break\n }\n }\n if (!haveJson) {\n return\n }\n\n console.log(chalk.green('Generated Types for EVM'))\n\n // TODO this will fail during postinstall, need to locate real typechain path\n await execStep(\n 'yarn typechain --target ' + ETHERS_TARGET + ` --out-dir ${outDir} ${path.join(abisDir, '*.json')}`,\n 'Type definitions gen'\n )\n}\n\nasync function execStep(cmd: string, stepName: string) {\n const child = exec(cmd)\n console.log(chalk.blue(stepName + ' begin'))\n\n if (!child.stdout || !child.stderr) {\n console.error(chalk.red(stepName + ' failed'))\n process.exit(1)\n }\n\n child.stdout.pipe(process.stdout)\n child.stderr.pipe(process.stderr)\n\n await new Promise((resolve) => {\n child.on('close', resolve)\n })\n\n if (child.exitCode) {\n console.error(chalk.red(stepName + ' failed'))\n process.exit(child.exitCode)\n }\n console.log(chalk.blue(stepName + ' success'))\n console.log()\n}\n"]}
@@ -101,7 +101,17 @@ async function runCreate(argv) {
101
101
  if (!cliVersion.startsWith('^')) {
102
102
  cliVersion = '^' + cliVersion;
103
103
  }
104
- packageJson.dependencies['@sentio/sdk'] = '^' + (await (0, latest_version_1.default)('@sentio/sdk'));
104
+ const sdkVersion = '^' + (await (0, latest_version_1.default)('@sentio/sdk'));
105
+ packageJson.dependencies['@sentio/sdk'] = sdkVersion;
106
+ switch (chainType) {
107
+ case 'aptos':
108
+ packageJson.dependencies['@sentio/sdk-aptos'] = sdkVersion;
109
+ break;
110
+ case 'solana':
111
+ packageJson.dependencies['@sentio/sdk-solana'] = sdkVersion;
112
+ break;
113
+ default:
114
+ }
105
115
  packageJson.dependencies['@sentio/cli'] = cliVersion;
106
116
  packageJson.name = projectName;
107
117
  // Don't add directly to avoid deps issue
@@ -1 +1 @@
1
- {"version":3,"file":"run-create.js","sourceRoot":"","sources":["../../src/commands/run-create.ts"],"names":[],"mappings":";;;;;;AAAA,0EAA+C;AAC/C,4EAAiD;AACjD,gDAAuB;AACvB,wDAAyB;AACzB,kDAAyB;AACzB,oCAAwC;AACxC,oEAA0C;AAEnC,KAAK,UAAU,SAAS,CAAC,IAAc;IAC5C,MAAM,iBAAiB,GAAG;QACxB;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,2BAA2B;SACzC;QACD;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,GAAG;YACV,aAAa,EAAE,IAAI;YACnB,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,cAAc;SAC5B;QACD;YACE,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,GAAG;YACV,WAAW,EAAE,qFAAqF;YAClG,IAAI,EAAE,MAAM;SACb;QACD;YACE,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE,GAAG;YACV,WAAW,EACT,iJAAiJ;YACnJ,IAAI,EAAE,MAAM;YACZ,YAAY,EAAE,KAAK;SACpB;KACF,CAAA;IAED,MAAM,OAAO,GAAG,IAAA,2BAAe,EAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAA;I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AAU,CAAA;YACpD,WAAW,CAAC,IAAI,GAAG,WAAW,CAAA;YAE9B,yCAAyC;YACzC,WAAW,CAAC,OAAO,CAAC,WAAW,GAAG,YAAY,CAAA;YAE9C,kBAAE,CAAC,aAAa,CAAC,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;SACxE;QACD,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,+BAA+B,GAAG,WAAW,GAAG,GAAG,CAAC,CAAC,CAAA;KAC9E;AACH,CAAC;AA9GD,8BA8GC","sourcesContent":["import commandLineArgs from 'command-line-args'\nimport commandLineUsage from 'command-line-usage'\nimport path from 'path'\nimport fs from 'fs-extra'\nimport chalk from 'chalk'\nimport { getCliVersion } from '../utils'\nimport latestVersion from 'latest-version'\n\nexport async function runCreate(argv: string[]) {\n const optionDefinitions = [\n {\n name: 'help',\n alias: 'h',\n type: Boolean,\n description: 'Display this usage guide.',\n },\n {\n name: 'name',\n alias: 'n',\n defaultOption: true,\n type: String,\n description: 'Project name',\n },\n {\n name: 'directory',\n alias: 'd',\n description: '(Optional) The root direct new project will be created, default current working dir',\n type: String,\n },\n {\n name: 'chain-type',\n alias: 'c',\n description:\n 'The type of project you want to create, can be evm, aptos, solana, raw (if you want to start from scratch and support multiple types of chains)',\n type: String,\n defaultValue: 'evm',\n },\n ]\n\n const options = commandLineArgs(optionDefinitions, { argv })\n const usage = commandLineUsage([\n {\n header: 'Create a template project',\n content: 'sentio create <name>',\n },\n {\n header: 'Options',\n optionList: optionDefinitions,\n },\n ])\n\n if (options.help || !options.name) {\n console.log(usage)\n } else {\n const chainType: string = options['chain-type'].toLowerCase()\n switch (chainType) {\n case 'evm':\n break\n case 'aptos':\n break\n case 'raw':\n break\n case 'solana':\n break\n default:\n console.error(chalk.red('non supported chain-type for template creation, use --help for more information.'))\n console.log(usage)\n process.exit(1)\n }\n const templateFolder = path.resolve(__dirname, '../../templates', chainType)\n const projectName = options.name || 'default'\n\n const rootDir = options.directory || process.cwd()\n const dstFolder = path.resolve(rootDir, projectName)\n if (fs.existsSync(dstFolder)) {\n console.error(chalk.red(\"can't create project '\" + projectName + \"', directory already existed\"))\n process.exit(1)\n }\n\n fs.copySync(templateFolder, dstFolder, {\n filter: (src, _) => {\n // TODO read from .gitignore to be more reliable\n if (\n src.endsWith('types') ||\n src.endsWith('dist') ||\n src.endsWith('node_modules') ||\n src.endsWith('.lock') ||\n src.endsWith('dist')\n ) {\n return false\n }\n return true\n },\n overwrite: false,\n })\n if (options.name) {\n const sentioYamlPath = path.resolve(dstFolder, 'sentio.yaml')\n fs.writeFileSync(sentioYamlPath, 'project: ' + projectName + '\\n', { flag: 'w+' })\n\n const packageJsonPath = path.resolve(dstFolder, 'package.json')\n const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'))\n\n let cliVersion = getCliVersion()\n if (!cliVersion.startsWith('^')) {\n cliVersion = '^' + cliVersion\n }\n\n packageJson.dependencies['@sentio/sdk'] = '^' + (await latestVersion('@sentio/sdk'))\n packageJson.dependencies['@sentio/cli'] = cliVersion\n packageJson.name = projectName\n\n // Don't add directly to avoid deps issue\n packageJson.scripts.postinstall = 'sentio gen'\n\n fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2))\n }\n console.log(chalk.green(\"successfully create project '\" + projectName + \"'\"))\n }\n}\n"]}
1
+ {"version":3,"file":"run-create.js","sourceRoot":"","sources":["../../src/commands/run-create.ts"],"names":[],"mappings":";;;;;;AAAA,0EAA+C;AAC/C,4EAAiD;AACjD,gDAAuB;AACvB,wDAAyB;AACzB,kDAAyB;AACzB,oCAAwC;AACxC,oEAA0C;AAEnC,KAAK,UAAU,SAAS,CAAC,IAAc;IAC5C,MAAM,iBAAiB,GAAG;QACxB;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,2BAA2B;SACzC;QACD;Y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,EAAE,cAAc,CAAC,CAAA;YAC/D,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,kBAAE,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAA;YAExE,IAAI,UAAU,GAAG,IAAA,qBAAa,GAAE,CAAA;YAChC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;gBAC/B,UAAU,GAAG,GAAG,GAAG,UAAU,CAAA;aAC9B;YAED,MAAM,UAAU,GAAG,GAAG,GAAG,CAAC,MAAM,IAAA,wBAAa,EAAC,aAAa,CAAC,CAAC,CAAA;YAC7D,WAAW,CAAC,YAAY,CAAC,aAAa,CAAC,GAAG,UAAU,CAAA;YAEpD,QAAQ,SAAS,EAAE;gBACjB,KAAK,OAAO;oBACV,WAAW,CAAC,YAAY,CAAC,mBAAmB,CAAC,GAAG,UAAU,CAAA;oBAC1D,MAAK;gBACP,KAAK,QAAQ;oBACX,WAAW,CAAC,YAAY,CAAC,oBAAoB,CAAC,GAAG,UAAU,CAAA;oBAC3D,MAAK;gBACP,QAAQ;aACT;YAED,WAAW,CAAC,YAAY,CAAC,aAAa,CAAC,GAAG,UAAU,CAAA;YACpD,WAAW,CAAC,IAAI,GAAG,WAAW,CAAA;YAE9B,yCAAyC;YACzC,WAAW,CAAC,OAAO,CAAC,WAAW,GAAG,YAAY,CAAA;YAE9C,kBAAE,CAAC,aAAa,CAAC,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;SACxE;QACD,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,+BAA+B,GAAG,WAAW,GAAG,GAAG,CAAC,CAAC,CAAA;KAC9E;AACH,CAAC;AA1HD,8BA0HC","sourcesContent":["import commandLineArgs from 'command-line-args'\nimport commandLineUsage from 'command-line-usage'\nimport path from 'path'\nimport fs from 'fs-extra'\nimport chalk from 'chalk'\nimport { getCliVersion } from '../utils'\nimport latestVersion from 'latest-version'\n\nexport async function runCreate(argv: string[]) {\n const optionDefinitions = [\n {\n name: 'help',\n alias: 'h',\n type: Boolean,\n description: 'Display this usage guide.',\n },\n {\n name: 'name',\n alias: 'n',\n defaultOption: true,\n type: String,\n description: 'Project name',\n },\n {\n name: 'directory',\n alias: 'd',\n description: '(Optional) The root direct new project will be created, default current working dir',\n type: String,\n },\n {\n name: 'chain-type',\n alias: 'c',\n description:\n 'The type of project you want to create, can be evm, aptos, solana, raw (if you want to start from scratch and support multiple types of chains)',\n type: String,\n defaultValue: 'evm',\n },\n ]\n\n const options = commandLineArgs(optionDefinitions, { argv })\n const usage = commandLineUsage([\n {\n header: 'Create a template project',\n content: 'sentio create <name>',\n },\n {\n header: 'Options',\n optionList: optionDefinitions,\n },\n ])\n\n if (options.help || !options.name) {\n console.log(usage)\n } else {\n const chainType: string = options['chain-type'].toLowerCase()\n switch (chainType) {\n case 'evm':\n break\n case 'aptos':\n break\n case 'raw':\n break\n case 'solana':\n break\n default:\n console.error(chalk.red('non supported chain-type for template creation, use --help for more information.'))\n console.log(usage)\n process.exit(1)\n }\n const templateFolder = path.resolve(__dirname, '../../templates', chainType)\n const projectName = options.name || 'default'\n\n const rootDir = options.directory || process.cwd()\n const dstFolder = path.resolve(rootDir, projectName)\n if (fs.existsSync(dstFolder)) {\n console.error(chalk.red(\"can't create project '\" + projectName + \"', directory already existed\"))\n process.exit(1)\n }\n\n fs.copySync(templateFolder, dstFolder, {\n filter: (src, _) => {\n // TODO read from .gitignore to be more reliable\n if (\n src.endsWith('types') ||\n src.endsWith('dist') ||\n src.endsWith('node_modules') ||\n src.endsWith('.lock') ||\n src.endsWith('dist')\n ) {\n return false\n }\n return true\n },\n overwrite: false,\n })\n if (options.name) {\n const sentioYamlPath = path.resolve(dstFolder, 'sentio.yaml')\n fs.writeFileSync(sentioYamlPath, 'project: ' + projectName + '\\n', { flag: 'w+' })\n\n const packageJsonPath = path.resolve(dstFolder, 'package.json')\n const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'))\n\n let cliVersion = getCliVersion()\n if (!cliVersion.startsWith('^')) {\n cliVersion = '^' + cliVersion\n }\n\n const sdkVersion = '^' + (await latestVersion('@sentio/sdk'))\n packageJson.dependencies['@sentio/sdk'] = sdkVersion\n\n switch (chainType) {\n case 'aptos':\n packageJson.dependencies['@sentio/sdk-aptos'] = sdkVersion\n break\n case 'solana':\n packageJson.dependencies['@sentio/sdk-solana'] = sdkVersion\n break\n default:\n }\n\n packageJson.dependencies['@sentio/cli'] = cliVersion\n packageJson.name = projectName\n\n // Don't add directly to avoid deps issue\n packageJson.scripts.postinstall = 'sentio gen'\n\n fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2))\n }\n console.log(chalk.green(\"successfully create project '\" + projectName + \"'\"))\n }\n}\n"]}
@@ -38,8 +38,11 @@ module.exports = {
38
38
  if (/^@(ethersproject|solana|project-serum|nice-grpc).*$/.test(request)) {
39
39
  return callback(null, 'commonjs ' + request)
40
40
  }
41
- if (request.startsWith("@sentio/sdk")) {
42
- return callback(null, 'commonjs2 ' + request)
41
+ if (/^nice-grpc.*$/.test(request)) {
42
+ return callback(null, 'commonjs ' + request)
43
+ }
44
+ if (/^@sentio\/(sdk|runtime|base|protos).*$/.test(request)) {
45
+ return callback(null, 'commonjs ' + request)
43
46
  }
44
47
  callback()
45
48
  },
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@sentio/cli",
3
3
  "license": "Apache-2.0",
4
- "version": "1.0.5",
4
+ "private": false,
5
+ "version": "1.1.0-rc.1",
5
6
  "scripts": {
6
7
  "compile": "tsc -p . && cp src/webpack.config.js lib/",
7
8
  "build": "yarn compile",
8
- "postbuild": "../scripts/link-bin.sh",
9
+ "postbuild": "../../scripts/link-bin.sh",
9
10
  "cli": "ts-node src/cli.ts",
10
11
  "test": "jest",
11
12
  "pub": "yarn build && yarn publish --no-git-tag-version"
package/src/build.ts CHANGED
@@ -24,11 +24,11 @@ async function buildProcessorForTarget(onlyGen: boolean) {
24
24
  await codeGenEthersProcessor(path.join('abis', 'evm'))
25
25
 
26
26
  // eslint-disable-next-line @typescript-eslint/no-var-requires
27
- const solanaModule = require('@sentio/sdk/lib/solana-codegen/codegen')
27
+ const solanaModule = require('@sentio/sdk-solana/lib/codegen/codegen')
28
28
  solanaModule.codeGenSolanaProcessor(path.join('abis', 'solana'))
29
29
 
30
30
  // eslint-disable-next-line @typescript-eslint/no-var-requires
31
- const aptosModuole = require('@sentio/sdk/lib/aptos-codegen/codegen')
31
+ const aptosModuole = require('@sentio/sdk-aptos/lib/codegen/codegen')
32
32
  aptosModuole.codeGenAptosProcessor(path.join('abis', 'aptos'))
33
33
 
34
34
  if (onlyGen) {
@@ -105,7 +105,19 @@ export async function runCreate(argv: string[]) {
105
105
  cliVersion = '^' + cliVersion
106
106
  }
107
107
 
108
- packageJson.dependencies['@sentio/sdk'] = '^' + (await latestVersion('@sentio/sdk'))
108
+ const sdkVersion = '^' + (await latestVersion('@sentio/sdk'))
109
+ packageJson.dependencies['@sentio/sdk'] = sdkVersion
110
+
111
+ switch (chainType) {
112
+ case 'aptos':
113
+ packageJson.dependencies['@sentio/sdk-aptos'] = sdkVersion
114
+ break
115
+ case 'solana':
116
+ packageJson.dependencies['@sentio/sdk-solana'] = sdkVersion
117
+ break
118
+ default:
119
+ }
120
+
109
121
  packageJson.dependencies['@sentio/cli'] = cliVersion
110
122
  packageJson.name = projectName
111
123
 
@@ -38,8 +38,11 @@ module.exports = {
38
38
  if (/^@(ethersproject|solana|project-serum|nice-grpc).*$/.test(request)) {
39
39
  return callback(null, 'commonjs ' + request)
40
40
  }
41
- if (request.startsWith("@sentio/sdk")) {
42
- return callback(null, 'commonjs2 ' + request)
41
+ if (/^nice-grpc.*$/.test(request)) {
42
+ return callback(null, 'commonjs ' + request)
43
+ }
44
+ if (/^@sentio\/(sdk|runtime|base|protos).*$/.test(request)) {
45
+ return callback(null, 'commonjs ' + request)
43
46
  }
44
47
  callback()
45
48
  },
@@ -9,7 +9,8 @@
9
9
  "upload": "sentio upload"
10
10
  },
11
11
  "dependencies": {
12
- "@sentio/sdk": "^1.0.0-development"
12
+ "@sentio/sdk": "^1.0.0-development",
13
+ "@sentio/sdk-aptos": "^1.0.0-development"
13
14
  },
14
15
  "devDependencies": {
15
16
  "@types/jest": "^29.0.0",
@@ -9,7 +9,8 @@
9
9
  "upload": "sentio upload"
10
10
  },
11
11
  "dependencies": {
12
- "@sentio/sdk": "^1.0.0-development"
12
+ "@sentio/sdk": "^1.0.0-development",
13
+ "@sentio/sdk-solana": "^1.0.0-development"
13
14
  },
14
15
  "devDependencies": {
15
16
  "@types/jest": "^29.0.0",
@@ -1,4 +1,4 @@
1
- import { SPLTokenProcessor } from '@sentio/sdk/lib/builtin/solana'
1
+ import { SPLTokenProcessor } from '@sentio/sdk-solana/lib/builtin'
2
2
 
3
3
  SPLTokenProcessor.bind({
4
4
  address: 'wormDTUJ6AWPNvk59vGQbDvGJmqbDTdgWgAqcLBCgUb',
@@ -1,107 +0,0 @@
1
- .idea
2
- src/types
3
-
4
- # Logs
5
- logs
6
- *.log
7
- npm-debug.log*
8
- yarn-debug.log*
9
- yarn-error.log*
10
- lerna-debug.log*
11
-
12
- # Diagnostic reports (https://nodejs.org/api/report.html)
13
- report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
14
-
15
- # Runtime data
16
- pids
17
- *.pid
18
- *.seed
19
- *.pid.lock
20
-
21
- # Directory for instrumented libs generated by jscoverage/JSCover
22
- lib-cov
23
-
24
- # Coverage directory used by tools like istanbul
25
- coverage
26
- *.lcov
27
-
28
- # nyc test coverage
29
- .nyc_output
30
-
31
- # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
32
- .grunt
33
-
34
- # Bower dependency directory (https://bower.io/)
35
- bower_components
36
-
37
- # node-waf configuration
38
- .lock-wscript
39
-
40
- # Compiled binary addons (https://nodejs.org/api/addons.html)
41
- build/Release
42
-
43
- # Dependency directories
44
- node_modules/
45
- jspm_packages/
46
-
47
- # TypeScript v1 declaration files
48
- typings/
49
-
50
- # TypeScript cache
51
- *.tsbuildinfo
52
-
53
- # Optional npm cache directory
54
- .npm
55
-
56
- # Optional eslint cache
57
- .eslintcache
58
-
59
- # Microbundle cache
60
- .rpt2_cache/
61
- .rts2_cache_cjs/
62
- .rts2_cache_es/
63
- .rts2_cache_umd/
64
-
65
- # Optional REPL history
66
- .node_repl_history
67
-
68
- # Output of 'npm pack'
69
- *.tgz
70
-
71
- # Yarn Integrity file
72
- .yarn-integrity
73
-
74
- # dotenv environment variables file
75
- .env
76
- .env.test
77
-
78
- # parcel-bundler cache (https://parceljs.org/)
79
- .cache
80
-
81
- # Next.js build output
82
- .next
83
-
84
- # Nuxt.js build / generate output
85
- .nuxt
86
- dist
87
-
88
- # Gatsby files
89
- .cache/
90
- # Comment in the public line in if your project uses Gatsby and *not* Next.js
91
- # https://nextjs.org/blog/next-9-1#public-directory-support
92
- # public
93
-
94
- # vuepress build output
95
- .vuepress/dist
96
-
97
- # Serverless directories
98
- .serverless/
99
-
100
- # FuseBox cache
101
- .fusebox/
102
-
103
- # DynamoDB Local files
104
- .dynamodb/
105
-
106
- # TernJS port file
107
- .tern-port
@@ -1,14 +0,0 @@
1
- import { TestProcessorServer } from '@sentio/sdk/lib/testing'
2
-
3
- describe('Test Processor', () => {
4
- const service = new TestProcessorServer(() => require('./processor'))
5
-
6
- beforeAll(async () => {
7
- await service.start()
8
- })
9
-
10
- test('has config', async () => {
11
- const config = await service.getConfig({})
12
- expect(config.contractConfigs.length > 0)
13
- })
14
- })
@@ -1,107 +0,0 @@
1
- .idea
2
- src/types
3
-
4
- # Logs
5
- logs
6
- *.log
7
- npm-debug.log*
8
- yarn-debug.log*
9
- yarn-error.log*
10
- lerna-debug.log*
11
-
12
- # Diagnostic reports (https://nodejs.org/api/report.html)
13
- report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
14
-
15
- # Runtime data
16
- pids
17
- *.pid
18
- *.seed
19
- *.pid.lock
20
-
21
- # Directory for instrumented libs generated by jscoverage/JSCover
22
- lib-cov
23
-
24
- # Coverage directory used by tools like istanbul
25
- coverage
26
- *.lcov
27
-
28
- # nyc test coverage
29
- .nyc_output
30
-
31
- # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
32
- .grunt
33
-
34
- # Bower dependency directory (https://bower.io/)
35
- bower_components
36
-
37
- # node-waf configuration
38
- .lock-wscript
39
-
40
- # Compiled binary addons (https://nodejs.org/api/addons.html)
41
- build/Release
42
-
43
- # Dependency directories
44
- node_modules/
45
- jspm_packages/
46
-
47
- # TypeScript v1 declaration files
48
- typings/
49
-
50
- # TypeScript cache
51
- *.tsbuildinfo
52
-
53
- # Optional npm cache directory
54
- .npm
55
-
56
- # Optional eslint cache
57
- .eslintcache
58
-
59
- # Microbundle cache
60
- .rpt2_cache/
61
- .rts2_cache_cjs/
62
- .rts2_cache_es/
63
- .rts2_cache_umd/
64
-
65
- # Optional REPL history
66
- .node_repl_history
67
-
68
- # Output of 'npm pack'
69
- *.tgz
70
-
71
- # Yarn Integrity file
72
- .yarn-integrity
73
-
74
- # dotenv environment variables file
75
- .env
76
- .env.test
77
-
78
- # parcel-bundler cache (https://parceljs.org/)
79
- .cache
80
-
81
- # Next.js build output
82
- .next
83
-
84
- # Nuxt.js build / generate output
85
- .nuxt
86
- dist
87
-
88
- # Gatsby files
89
- .cache/
90
- # Comment in the public line in if your project uses Gatsby and *not* Next.js
91
- # https://nextjs.org/blog/next-9-1#public-directory-support
92
- # public
93
-
94
- # vuepress build output
95
- .vuepress/dist
96
-
97
- # Serverless directories
98
- .serverless/
99
-
100
- # FuseBox cache
101
- .fusebox/
102
-
103
- # DynamoDB Local files
104
- .dynamodb/
105
-
106
- # TernJS port file
107
- .tern-port
@@ -1,29 +0,0 @@
1
- import { TestProcessorServer, firstCounterValue } from '@sentio/sdk/lib/testing'
2
- import { mockTransferLog } from '@sentio/sdk/lib/builtin/erc20/test-utils'
3
- import { BigNumber } from 'ethers'
4
-
5
- describe('Test Processor', () => {
6
- const service = new TestProcessorServer(() => require('./processor'))
7
-
8
- beforeAll(async () => {
9
- await service.start()
10
- })
11
-
12
- test('has valid config', async () => {
13
- const config = await service.getConfig({})
14
- expect(config.contractConfigs.length > 0).toBeTruthy()
15
- })
16
-
17
- test('check transfer event handling', async () => {
18
- const resp = await service.testLog(
19
- mockTransferLog('0x1e4ede388cbc9f4b5c79681b7f94d36a11abebc9', {
20
- from: '0x0000000000000000000000000000000000000000',
21
- to: '0xb329e39ebefd16f40d38f07643652ce17ca5bac1',
22
- value: BigNumber.from(10n ** 18n * 10n),
23
- })
24
- )
25
-
26
- const tokenCounter = firstCounterValue(resp.result, 'token')
27
- expect(tokenCounter).toEqual(10n)
28
- })
29
- })
@@ -1,107 +0,0 @@
1
- .idea
2
- src/types
3
-
4
- # Logs
5
- logs
6
- *.log
7
- npm-debug.log*
8
- yarn-debug.log*
9
- yarn-error.log*
10
- lerna-debug.log*
11
-
12
- # Diagnostic reports (https://nodejs.org/api/report.html)
13
- report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
14
-
15
- # Runtime data
16
- pids
17
- *.pid
18
- *.seed
19
- *.pid.lock
20
-
21
- # Directory for instrumented libs generated by jscoverage/JSCover
22
- lib-cov
23
-
24
- # Coverage directory used by tools like istanbul
25
- coverage
26
- *.lcov
27
-
28
- # nyc test coverage
29
- .nyc_output
30
-
31
- # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
32
- .grunt
33
-
34
- # Bower dependency directory (https://bower.io/)
35
- bower_components
36
-
37
- # node-waf configuration
38
- .lock-wscript
39
-
40
- # Compiled binary addons (https://nodejs.org/api/addons.html)
41
- build/Release
42
-
43
- # Dependency directories
44
- node_modules/
45
- jspm_packages/
46
-
47
- # TypeScript v1 declaration files
48
- typings/
49
-
50
- # TypeScript cache
51
- *.tsbuildinfo
52
-
53
- # Optional npm cache directory
54
- .npm
55
-
56
- # Optional eslint cache
57
- .eslintcache
58
-
59
- # Microbundle cache
60
- .rpt2_cache/
61
- .rts2_cache_cjs/
62
- .rts2_cache_es/
63
- .rts2_cache_umd/
64
-
65
- # Optional REPL history
66
- .node_repl_history
67
-
68
- # Output of 'npm pack'
69
- *.tgz
70
-
71
- # Yarn Integrity file
72
- .yarn-integrity
73
-
74
- # dotenv environment variables file
75
- .env
76
- .env.test
77
-
78
- # parcel-bundler cache (https://parceljs.org/)
79
- .cache
80
-
81
- # Next.js build output
82
- .next
83
-
84
- # Nuxt.js build / generate output
85
- .nuxt
86
- dist
87
-
88
- # Gatsby files
89
- .cache/
90
- # Comment in the public line in if your project uses Gatsby and *not* Next.js
91
- # https://nextjs.org/blog/next-9-1#public-directory-support
92
- # public
93
-
94
- # vuepress build output
95
- .vuepress/dist
96
-
97
- # Serverless directories
98
- .serverless/
99
-
100
- # FuseBox cache
101
- .fusebox/
102
-
103
- # DynamoDB Local files
104
- .dynamodb/
105
-
106
- # TernJS port file
107
- .tern-port
@@ -1,14 +0,0 @@
1
- import { TestProcessorServer } from '@sentio/sdk/lib/testing'
2
-
3
- describe('Test Processor', () => {
4
- const service = new TestProcessorServer(() => require('./processor'))
5
-
6
- beforeAll(async () => {
7
- await service.start()
8
- })
9
-
10
- test('has valid config', async () => {
11
- // const config = await service.getConfig({})
12
- // expect(config.contractConfigs.length > 0).toBeTruthy()
13
- })
14
- })