diff --git a/notNeededPackages.json b/notNeededPackages.json index cca6488903..6c4e1ce887 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -144,6 +144,12 @@ "sourceRepoURL": "https://github.com/Azure/azure-mobile-apps-node/", "asOfVersion": "3.0.0" }, + { + "libraryName": "@babel/parser", + "typingsPackageName": "babel__parser", + "sourceRepoURL": "https://github.com/babel/babel", + "asOfVersion": "7.1.0" + }, { "libraryName": "BabylonJS", "typingsPackageName": "babylonjs", diff --git a/types/babel__core/index.d.ts b/types/babel__core/index.d.ts index 277228341b..85a89392af 100644 --- a/types/babel__core/index.d.ts +++ b/types/babel__core/index.d.ts @@ -4,16 +4,16 @@ // Marvin Hagemeister // Melvin Groenhoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 2.9 import { GeneratorOptions } from "@babel/generator"; import traverse, { Visitor, NodePath } from "@babel/traverse"; import template from "@babel/template"; import * as t from "@babel/types"; -import { ParseOptions } from "@babel/parser"; +import { ParserOptions } from "@babel/parser"; export { - ParseOptions, + ParserOptions, GeneratorOptions, t as types, template, @@ -217,7 +217,7 @@ export interface TransformOptions { * * Default: `{}` */ - parserOpts?: ParseOptions | null; + parserOpts?: ParserOptions | null; /** * List of plugins to load and use diff --git a/types/babel__core/package.json b/types/babel__core/package.json index c2ca8a8f9b..582285d229 100644 --- a/types/babel__core/package.json +++ b/types/babel__core/package.json @@ -1,6 +1,7 @@ { "private": true, "dependencies": { - "@babel/types": "^7.0.0-beta.54" + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" } } diff --git a/types/babel__core/tsconfig.json b/types/babel__core/tsconfig.json index 2f96e019cb..22eb208383 100644 --- a/types/babel__core/tsconfig.json +++ b/types/babel__core/tsconfig.json @@ -22,9 +22,6 @@ "@babel/generator": [ "babel__generator" ], - "@babel/parser": [ - "babel__parser" - ], "@babel/template": [ "babel__template" ], diff --git a/types/babel__generator/babel__generator-tests.ts b/types/babel__generator/babel__generator-tests.ts index 90a668ad55..728638c868 100644 --- a/types/babel__generator/babel__generator-tests.ts +++ b/types/babel__generator/babel__generator-tests.ts @@ -1,9 +1,9 @@ // Example from https://github.com/babel/babel/tree/master/packages/babel-generator import generate from "@babel/generator"; -import { parse } from "@babel/parser"; +import * as t from "@babel/types"; const code = "class Example {}"; -const ast = parse(code); +declare const ast: t.Node; ast.type; ast.loc!.start; diff --git a/types/babel__generator/index.d.ts b/types/babel__generator/index.d.ts index 03fcf2765a..9b6a9fbc1c 100644 --- a/types/babel__generator/index.d.ts +++ b/types/babel__generator/index.d.ts @@ -4,7 +4,7 @@ // Johnny Estilles // Melvin Groenhoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 2.9 import * as t from "@babel/types"; diff --git a/types/babel__generator/package.json b/types/babel__generator/package.json index c2ca8a8f9b..2442a952db 100644 --- a/types/babel__generator/package.json +++ b/types/babel__generator/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "@babel/types": "^7.0.0-beta.54" + "@babel/types": "^7.0.0" } } diff --git a/types/babel__generator/tsconfig.json b/types/babel__generator/tsconfig.json index be65e3da1f..01acda5d38 100644 --- a/types/babel__generator/tsconfig.json +++ b/types/babel__generator/tsconfig.json @@ -18,9 +18,6 @@ "paths": { "@babel/generator": [ "babel__generator" - ], - "@babel/parser": [ - "babel__parser" ] } }, diff --git a/types/babel__parser/babel__parser-tests.ts b/types/babel__parser/babel__parser-tests.ts deleted file mode 100644 index 1c9873e5e8..0000000000 --- a/types/babel__parser/babel__parser-tests.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { parse, parseExpression } from "@babel/parser"; - -declare function assert(expr: boolean): void; - -const code = `function square(n) { - return n * n; -}`; - -const node = parse(code); -assert(node.type === "File"); -assert(node.start === 0); -assert(node.end === 38); -assert(!!node.loc && node.loc.start > node.loc.end); - -parse(code, { - sourceType: "module", // default: "script" - plugins: ["jsx"] // default: [] -}); diff --git a/types/babel__parser/index.d.ts b/types/babel__parser/index.d.ts deleted file mode 100644 index bf383ffa0c..0000000000 --- a/types/babel__parser/index.d.ts +++ /dev/null @@ -1,107 +0,0 @@ -// Type definitions for @babel/parser 7.0 -// Project: https://github.com/babel/babel/tree/master/packages/babel-parser -// Definitions by: Troy Gerwien -// Marvin Hagemeister -// Melvin Groenhoff -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 - -import { File, Expression } from "@babel/types"; - -export function parse(code: string, opts?: ParseOptions): File; - -export function parseExpression(input: string, options?: ParseOptions): Expression; - -export interface ParseOptions { - /** - * By default, import and export declarations can only appear at a program's top level. - * Setting this option to true allows them anywhere where a statement is allowed. - */ - allowImportExportEverywhere?: boolean; - - /** - * By default, await use is not allowed outside of an async function. Set this to true to accept such code. - */ - allowAwaitOutsideFunction?: boolean; - - /** - * By default, a return statement at the top level raises an error. Set this to true to accept such code. - */ - allowReturnOutsideFunction?: boolean; - - allowSuperOutsideMethod?: boolean; - - /** - * Indicate the mode the code should be parsed in. Can be one of "script", "module", or "unambiguous". - * Defaults to "script". "unambiguous" will make @babel/parser attempt to guess, based on the presence of ES6 import or export - * statements. Files with ES6 imports and exports are considered "module" and are otherwise "script". - */ - sourceType?: "script" | "module" | "unambiguous"; - - /** - * Correlate output AST nodes with their source filename. Useful when - * generating code and source maps from the ASTs of multiple input files. - */ - sourceFilename?: string; - - /** - * By default, the first line of code parsed is treated as line 1. You can provide a line number to alternatively start with. Useful - * for integration with other source tools. - */ - startLine?: number; - - /** - * Array containing the plugins that you want to enable. - */ - plugins?: PluginList; - - strictMode?: boolean; - - /** - * Adds a `ranges` property to each node: `[node.start, node.end]` - */ - ranges?: boolean; - - /** - * Adds all parsed tokens to a `tokens` property on the `File` node - */ - tokens?: boolean; -} - -export type PluginList = Array; - -export type PluginName = - "asyncGenerators" | - "bigInt" | - "classPrivateMethods" | - "classPrivateProperties" | - "classProperties" | - "decorators" | - "doExpressions" | - "dynamicImport" | - "estree" | - "exportDefaultFrom" | - "exportNamespaceFrom" | - "flow" | - "flowComments" | - "functionBind" | - "functionSent" | - "importMeta" | - "jsx" | - "nullishCoalescingOperator" | - "numericSeparator" | - "objectRestSpread" | - "optionalCatchBinding" | - "optionalChaining" | - "pipelineOperator" | - "throwExpressions" | - "typescript"; - -export interface PluginOptions { - decorators?: { - decoratorsBeforeExport?: boolean; - }; - flow?: { - all?: boolean; - }; -} diff --git a/types/babel__parser/package.json b/types/babel__parser/package.json deleted file mode 100644 index c2ca8a8f9b..0000000000 --- a/types/babel__parser/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "dependencies": { - "@babel/types": "^7.0.0-beta.54" - } -} diff --git a/types/babel__parser/tsconfig.json b/types/babel__parser/tsconfig.json deleted file mode 100644 index 53fd02ec18..0000000000 --- a/types/babel__parser/tsconfig.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true, - "paths": { - "@babel/parser": [ - "babel__parser" - ] - } - }, - "files": [ - "index.d.ts", - "babel__parser-tests.ts" - ] -} diff --git a/types/babel__parser/tslint.json b/types/babel__parser/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/babel__parser/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } diff --git a/types/babel__template/index.d.ts b/types/babel__template/index.d.ts index 5f3bc18bc3..8750e52d8e 100644 --- a/types/babel__template/index.d.ts +++ b/types/babel__template/index.d.ts @@ -4,12 +4,12 @@ // Marvin Hagemeister // Melvin Groenhoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 2.9 -import { ParseOptions } from "@babel/parser"; +import { ParserOptions } from "@babel/parser"; import { Expression, File, Program, Statement } from "@babel/types"; -export interface TemplateBuilderOptions extends ParseOptions { +export interface TemplateBuilderOptions extends ParserOptions { /** * A set of placeholder names to automatically accept. Items in this list do not need to match the given placeholder pattern. */ diff --git a/types/babel__template/package.json b/types/babel__template/package.json index c2ca8a8f9b..582285d229 100644 --- a/types/babel__template/package.json +++ b/types/babel__template/package.json @@ -1,6 +1,7 @@ { "private": true, "dependencies": { - "@babel/types": "^7.0.0-beta.54" + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" } } diff --git a/types/babel__template/tsconfig.json b/types/babel__template/tsconfig.json index 386236c02f..50fce77ad8 100644 --- a/types/babel__template/tsconfig.json +++ b/types/babel__template/tsconfig.json @@ -20,9 +20,6 @@ "@babel/generator": [ "babel__generator" ], - "@babel/parser": [ - "babel__parser" - ], "@babel/template": [ "babel__template" ] diff --git a/types/babel__traverse/babel__traverse-tests.ts b/types/babel__traverse/babel__traverse-tests.ts index 2fc7b07a8a..5b4fbbef5f 100644 --- a/types/babel__traverse/babel__traverse-tests.ts +++ b/types/babel__traverse/babel__traverse-tests.ts @@ -1,4 +1,3 @@ -import { parse } from "@babel/parser"; import traverse, { Visitor } from "@babel/traverse"; import * as t from "@babel/types"; @@ -21,11 +20,7 @@ const MyVisitor2: Visitor = { }; // Example from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babel-traverse -const code = `function square(n) { - return n * n; -}`; - -const ast = parse(code); +declare const ast: t.Node; traverse(ast, { enter(path) { diff --git a/types/babel__traverse/index.d.ts b/types/babel__traverse/index.d.ts index 475ca9fb14..465a60464f 100644 --- a/types/babel__traverse/index.d.ts +++ b/types/babel__traverse/index.d.ts @@ -5,7 +5,7 @@ // Ryan Petrich // Melvin Groenhoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 2.9 import * as t from "@babel/types"; diff --git a/types/babel__traverse/package.json b/types/babel__traverse/package.json index c2ca8a8f9b..2442a952db 100644 --- a/types/babel__traverse/package.json +++ b/types/babel__traverse/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "@babel/types": "^7.0.0-beta.54" + "@babel/types": "^7.0.0" } } diff --git a/types/babel__traverse/tsconfig.json b/types/babel__traverse/tsconfig.json index 898675d222..b6c30190af 100644 --- a/types/babel__traverse/tsconfig.json +++ b/types/babel__traverse/tsconfig.json @@ -17,9 +17,6 @@ "noEmit": true, "forceConsistentCasingInFileNames": true, "paths": { - "@babel/parser": [ - "babel__parser" - ], "@babel/traverse": [ "babel__traverse" ]