Skip to content

Commit

Permalink
Add aelf.js npm dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
rosona committed Feb 25, 2019
1 parent 5da77f2 commit 10eadda
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -276,3 +276,5 @@ slnx.sqlite

launchSettings.json

yarn.lock

2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ dotnet: 2.2
dist: xenial
before_install:
- bash scripts/install_protobuf.sh
- nvm install node
- npm install -g yarn
install:
- export DOTNET_CLI_TELEMETRY_OPTOUT=1
before_script:
Expand Down
5 changes: 4 additions & 1 deletion AElf.CLI/AElf.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<TargetFramework>netcoreapp2.2</TargetFramework>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<Target Name="InstallAElfJS" AfterTargets="BeforeBuild">
<Exec Command="yarn install" />
</Target>
<Target Name="InstallChakraCore" AfterTargets="AfterBuild">
<Exec Command="bash ../scripts/install_chakracore.sh $(OutDir)" />
</Target>
Expand All @@ -19,13 +22,13 @@
<PackageReference Include="CommandLineParser" Version="2.2.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="ReadLine" Version="2.0.1" />
<PackageReference Include="AElf.JSDK" Version="0.1.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AElf.Common\AElf.Common.csproj" />
<ProjectReference Include="..\AElf.Cryptography\AElf.Cryptography.csproj" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Scripts\aelf.js" />
<EmbeddedResource Include="Scripts\helpers.js" />
<EmbeddedResource Include="Scripts\crypto.js" />
<EmbeddedResource Include="Scripts\requestor.js" />
Expand Down
10 changes: 2 additions & 8 deletions AElf.CLI/JS/JSEngine.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
Expand All @@ -11,10 +9,6 @@
using AElf.CLI.JS.IO;
using AElf.CLI.JS.Net;
using AElf.CLI.Utils;
using AElf.Common;
using AElf.JSDK;
using Alba.CsConsoleFormat;
using Alba.CsConsoleFormat.Fluent;
using ChakraCore.NET;
using ChakraCore.NET.API;
using ChakraCore.NET.Debug;
Expand Down Expand Up @@ -94,8 +88,8 @@ public JSEngine(IConsole console, BaseOption option,

private void LoadAelfJs()
{
RunScript(Assembly.LoadFrom(Assembly.GetAssembly(typeof(StaticResource)).Location)
.GetManifestResourceStream("AElf.JSDK.content.aelf.js"));
RunScript(Assembly.LoadFrom(Assembly.GetAssembly(typeof(JSEngine)).Location)
.GetManifestResourceStream("AElf.CLI.Scripts.aelf.js"));
RunScript(@"Aelf = require('aelf');");
}

Expand Down
2 changes: 1 addition & 1 deletion AElf.CLI/Scripts/aelf.js
8 changes: 8 additions & 0 deletions AElf.CLI/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"version": "1.0.0",
"name": "aelf.cli",
"private": true,
"dependencies": {
"aelf-sdk": "latest"
}
}

0 comments on commit 10eadda

Please sign in to comment.