Permalink
Browse files

JS project using a Bridge module.

  • Loading branch information...
AndreyChechel committed Feb 10, 2019
1 parent 9eda695 commit 82c9929244655f29eaec246f0e366c5f07c9beea
@@ -1,4 +1,5 @@
using System;
using Bridge;
using TSProjDemo.Bridge.Internal;
using TSProjDemo.Bridge.Internal.Parsing;

@@ -1,6 +1,6 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Bridge;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
@@ -33,4 +33,7 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

// Compile the project as a CommonJS module.
[assembly: Module(ModuleType.CommonJS, "MathModule")]
@@ -35,7 +35,7 @@

// Generate TypeScript Definition (.d.ts) files.
// Default is false.
"generateTypeScript": true,
"generateTypeScript": false,

// Delete everything from the output folder
// Default is false
@@ -1,24 +1,22 @@
{
"name": "tsprojdemo",
"name": "jsmoduledemo",
"version": "1.0.0",
"description": "TypeScript demo project using Bridge output.",
"description": "JavaScript demo project using a Bridge module.",
"main": "",
"author": "Object.NET, Inc. <hello@object.net>",
"private": true,
"scripts": {
"start": "tsc && cls && node ./dist/app.js",
"build": "tsc",
"start": "cls && node ./src/app.js",
"start-cli": "yarn clear-bin && yarn build-cli && yarn start",
"build-cli": "bridge build -f \"../TSProjDemo.Bridge\" -c \"Debug\" -P \"AnyCPU\" -r",
"build-cli":
"bridge build -f \"../TSProjDemo.Bridge\" -c \"Debug\" -P \"AnyCPU\" -r",
"clear-bin": "RD /S /Q \"../TSProjDemo.Bridge/bin\""
},
"dependencies": {
"@types/node": "^10.0.8",
"readline-sync": "^1.4.9"
},
"devDependencies": {
"@types/readline-sync": "^1.4.3",
"prettier": "^1.12.1",
"typescript": "^2.8.3"
"prettier": "^1.12.1"
}
}
@@ -0,0 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

const mathDemo_1 = require("./mathDemo");

// Run demo:
const demo = new mathDemo_1.MathDemo();
demo.Run();

This file was deleted.

Oops, something went wrong.
@@ -1,9 +1,18 @@
///<reference path="../dist/bridge/TSProjDemo.Bridge.d.ts" />
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

import * as rl from "readline-sync";
// Bridge needs to be loaded explicitly, before
// loading any module generated by Bridge.
require("../dist/bridge/bridge");

export class MathDemo {
Run(): void {
// Load MathModule generated by Bridge.
const mathModule = require("../dist/bridge/TSProjDemo.Bridge").MathModule;

// Load other modules.
const rl = require("readline-sync");

class MathDemo {
Run() {
console.log("*** Math Expression Evaluaton Demo ***");
console.log(" (enter an empty string to exit)");
console.log("");
@@ -12,9 +21,9 @@ export class MathDemo {
console.log("");

// Create an instance of Evaluator:
const evaluator = new TSProjDemo.Bridge.Evaluator();
const evaluator = new mathModule.TSProjDemo.Bridge.Evaluator();

let expr: string;
let expr;
while ((expr = rl.question("Math Expression: ")).length > 0) {
try {
// Evaluate:
@@ -23,8 +32,9 @@ export class MathDemo {
} catch (err) {
console.log("[Error]: " + err.message);
}

console.log("");
}
}
}

exports.MathDemo = MathDemo;

This file was deleted.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 82c9929

Please sign in to comment.