Skip to content

Commit

Permalink
Merge branch 'dev-types'
Browse files Browse the repository at this point in the history
  • Loading branch information
James Criscuolo committed Jan 31, 2019
2 parents f428b94 + 489e941 commit f6be37b
Show file tree
Hide file tree
Showing 137 changed files with 14,045 additions and 13,660 deletions.
267 changes: 0 additions & 267 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -2,5 +2,5 @@ node_modules/
dist/sip*
lib/*
_SpecRunner.html
src/Grammar/dist/Grammar.js
src/Grammar/dist/*
npm-debug.log
51 changes: 42 additions & 9 deletions build/grammarGenerator.js
@@ -1,13 +1,13 @@
"use strict";

const fs = require("fs"),
pegjs = require("pegjs");
//tspegjs = require("ts-pegjs");
pegjs = require("pegjs"),
tspegjs = require("ts-pegjs");

const thisFolder = "./src/Grammar",
inputFile = thisFolder + "/src/Grammar.pegjs",
outputFolder = thisFolder + "/dist",
outputFile = outputFolder + "/Grammar.js";
outputFile = outputFolder + "/Grammar.ts";

const grammarContents = fs.readFileSync(inputFile, "utf8");

Expand Down Expand Up @@ -49,15 +49,48 @@ const parser = pegjs.generate(grammarContents, {
"Referred_By"
],
output: "source",
format: "umd",
exportVar: "SIP.Grammar",
optimize: "size",
/* TODO - we want this eventually, but right now it produces ts that makes tsc unhappy
// optimize: "size",
plugins: [tspegjs],
"tspegjs": {
"noTslint": false,
"tslintIgnores": "interface-name, trailing-comma, object-literal-sort-keys, max-line-length, only-arrow-functions, one-variable-per-declaration, no-consecutive-blank-lines, align, radix, quotemark, semicolon, object-literal-shorthand, variable-name, no-var-keyword, whitespace, curly, prefer-const, object-literal-key-quotes, no-string-literal, one-line, no-unused-expression, space-before-function-paren, arrow-return-shorthand",
"customHeader": "import { NameAddrHeader } from \"../../NameAddrHeader\";\nimport { URI } from \"../../URI\";"
},
"returnTypes": {
Contact: "URI | NameAddrHeader",
Name_Addr_Header: "NameAddrHeader",
Record_Route: "NameAddrHeader",
Request_Response: "string",
SIP_URI: "URI",
Subscription_State: "string",
Supported: "Array<string>",
Require: "Array<string>",
Via: "string",
absoluteURI: "string",
Call_ID: "string",
Content_Disposition: "string",
Content_Length: "number",
Content_Type: "string",
CSeq: "number",
displayName: "string",
Event: "string",
From: "string",
host: "string",
Max_Forwards: "number",
Min_SE: "number",
Proxy_Authenticate: "string",
quoted_string: "string",
Refer_To: "string",
Replaces: "string",
Session_Expires: "number",
stun_URI: "string",
To: "string",
turn_URI: "string",
uuid: "string",
WWW_Authenticate: "string",
challenge: "string",
sipfrag: "string",
Referred_By: "string"
}
*/
});

if (!fs.existsSync(outputFolder)){
Expand Down

0 comments on commit f6be37b

Please sign in to comment.