Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish esprima js files #1973

Open
wants to merge 1 commit into
base: 4.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
coverage
lib
lib.es2015
node_modules
test/dist
src/*.js
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"version": "4.0.1",
"files": [
"bin",
"dist/esprima.js"
"dist/esprima.js",
"lib",
"lib.es2015"
],
"engines": {
"node": ">=4"
Expand Down Expand Up @@ -93,9 +95,10 @@
"analyze-coverage": "istanbul cover test/unit-tests.js",
"check-coverage": "istanbul check-coverage --statement 100 --branch 100 --function 100",
"dynamic-analysis": "npm run analyze-coverage && npm run check-coverage",
"compile": "tsc -p src/ && webpack && node tools/fixupbundle.js",
"compile": "tsc -p src/ --outDir lib && webpack && node tools/fixupbundle.js",
"compile.es2015": "tsc -p src/ --outDir lib.es2015 -t ES2015 -m ES2015 -d",
"test": "npm run compile && npm run all-tests && npm run static-analysis && npm run dynamic-analysis",
"prepublish": "npm run compile",
"prepublish": "npm run compile && npm run compile.es2015",
"profile": "node --prof test/profile.js && mv isolate*.log v8.log && node-tick-processor",
"benchmark-parser": "node -expose_gc test/benchmark-parser.js",
"benchmark-tokenizer": "node --expose_gc test/benchmark-tokenizer.js",
Expand Down
6 changes: 3 additions & 3 deletions src/comment-handler.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { SourceLocation } from './scanner';
import { Syntax } from './syntax';

interface Comment {
export interface Comment {
type: string;
value: string;
range?: [number, number];
loc?: SourceLocation;
}

interface Entry {
export interface Entry {
comment: Comment;
start: number;
}

interface NodeInfo {
export interface NodeInfo {
node: any;
start: number;
}
Expand Down
2 changes: 1 addition & 1 deletion src/error-handler.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* tslint:disable:max-classes-per-file */

declare class Error {
export declare class Error {
public name: string;
public message: string;
public index: number;
Expand Down
6 changes: 3 additions & 3 deletions src/jsx-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ import { Marker, Parser } from './parser';
import { Token, TokenName } from './token';
import { XHTMLEntities } from './xhtml-entities';

interface MetaJSXElement {
export interface MetaJSXElement {
node: Marker;
opening: JSXNode.JSXOpeningElement;
closing: JSXNode.JSXClosingElement | null;
children: JSXNode.JSXChild[];
}

const enum JSXToken {
export const enum JSXToken {
Identifier = 100,
Text
}

interface RawJSXToken {
export interface RawJSXToken {
type: Token | JSXToken;
value: string;
lineNumber: number;
Expand Down
2 changes: 1 addition & 1 deletion src/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ export class TaggedTemplateExpression {
}
}

interface TemplateElementValue {
export interface TemplateElementValue {
cooked: string;
raw: string;
}
Expand Down
12 changes: 6 additions & 6 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Comment, RawToken, Scanner, SourceLocation } from './scanner';
import { Syntax } from './syntax';
import { Token, TokenName } from './token';

interface Config {
export interface Config {
range: boolean;
loc: boolean;
source: string | null;
Expand All @@ -15,7 +15,7 @@ interface Config {
tolerant: boolean;
}

interface Context {
export interface Context {
isModule: boolean;
allowIn: boolean;
allowStrictDirective: boolean;
Expand All @@ -37,19 +37,19 @@ export interface Marker {
column: number;
}

const ArrowParameterPlaceHolder = 'ArrowParameterPlaceHolder';
export const ArrowParameterPlaceHolder = 'ArrowParameterPlaceHolder';

interface ArrowParameterPlaceHolderNode {
export interface ArrowParameterPlaceHolderNode {
type: string;
params: Node.Expression[];
async: boolean;
}

interface DeclarationOptions {
export interface DeclarationOptions {
inFor: boolean;
}

interface TokenEntry {
export interface TokenEntry {
type: string;
value: string;
regex?: {
Expand Down
2 changes: 1 addition & 1 deletion src/scanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export interface RawToken {
end: number;
}

interface ScannerState {
export interface ScannerState {
index: number;
lineNumber: number;
lineStart: number;
Expand Down
12 changes: 6 additions & 6 deletions src/tokenizer.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ErrorHandler } from './error-handler';
import { Error, ErrorHandler } from './error-handler';
import { Comment, Scanner, SourceLocation } from './scanner';
import { Token, TokenName } from './token';

type ReaderEntry = string | null;
export type ReaderEntry = string | null;

interface BufferEntry {
export interface BufferEntry {
type: string;
value: string;
regex?: {
Expand All @@ -15,7 +15,7 @@ interface BufferEntry {
loc?: SourceLocation;
}

class Reader {
export class Reader {
readonly values: ReaderEntry[];
curly: number;
paren: number;
Expand Down Expand Up @@ -93,7 +93,7 @@ class Reader {

/* tslint:disable:max-classes-per-file */

interface Config {
export interface Config {
tolerant?: boolean;
comment?: boolean;
range?: boolean;
Expand Down Expand Up @@ -121,7 +121,7 @@ export class Tokenizer {
this.reader = new Reader();
}

errors() {
errors(): Error[] {
return this.errorHandler.errors;
}

Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
entry: __dirname + "/src/esprima.js",
entry: __dirname + "/lib/esprima.js",
output: {
path: __dirname + "/dist",
filename: "esprima.js",
Expand Down