From 5867f076d8510fa97e3bd6642bbe61960f7fd196 Mon Sep 17 00:00:00 2001 From: dcodeIO Date: Mon, 17 Apr 2017 23:54:03 +0200 Subject: [PATCH] Other: Removed debug build, made it an extension --- debug.d.ts | 2 -- debug.js | 4 ---- ext/debug/README.md | 4 ++++ src/index-debug.js => ext/debug/index.js | 7 ++----- index.d.ts | 17 ----------------- tests/other_basics-debug.js | 4 ++-- 6 files changed, 8 insertions(+), 30 deletions(-) delete mode 100644 debug.d.ts delete mode 100644 debug.js create mode 100644 ext/debug/README.md rename src/index-debug.js => ext/debug/index.js (91%) diff --git a/debug.d.ts b/debug.d.ts deleted file mode 100644 index d83e7f99c..000000000 --- a/debug.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export as namespace protobuf; -export * from "./index"; diff --git a/debug.js b/debug.js deleted file mode 100644 index abbc0cf9c..000000000 --- a/debug.js +++ /dev/null @@ -1,4 +0,0 @@ -// experimental - debug library entry point. - -"use strict"; -module.exports = require("./src/index-debug"); diff --git a/ext/debug/README.md b/ext/debug/README.md new file mode 100644 index 000000000..a48517e42 --- /dev/null +++ b/ext/debug/README.md @@ -0,0 +1,4 @@ +protobufjs/ext/debug +========================= + +Experimental debugging extension. diff --git a/src/index-debug.js b/ext/debug/index.js similarity index 91% rename from src/index-debug.js rename to ext/debug/index.js index 5d540e902..2b797664b 100644 --- a/src/index-debug.js +++ b/ext/debug/index.js @@ -1,14 +1,11 @@ -// WARNING: highly experimental. -// might eventually become a starting point for a real debug build. - "use strict"; -var protobuf = module.exports = require("./index"); +var protobuf = require("../.."); /** * Debugging utility functions. Only present in debug builds. * @namespace */ -var debug = protobuf.debug = {}; +var debug = protobuf.debug = module.exports = {}; var codegen = protobuf.util.codegen; diff --git a/index.d.ts b/index.d.ts index 982a5c819..a9f72e2f7 100644 --- a/index.d.ts +++ b/index.d.ts @@ -338,23 +338,6 @@ export interface IExtensionField extends IField { */ type FieldDecorator = (prototype: object, fieldName: string) => void; -/** Debugging utility functions. Only present in debug builds. */ -export namespace debug { - - /** - * Returns a list of unused types within the specified root. - * @param ns Namespace to search - * @returns Unused types - */ - function unusedTypes(ns: NamespaceBase): Type[]; - - /** Enables debugging extensions. */ - function enable(): void; - - /** Disables debugging extensions. */ - function disable(): void; -} - /** * A node-style callback as used by {@link load} and {@link Root#load}. * @param error Error, if any, otherwise `null` diff --git a/tests/other_basics-debug.js b/tests/other_basics-debug.js index a00ae3b4e..6863263ab 100644 --- a/tests/other_basics-debug.js +++ b/tests/other_basics-debug.js @@ -1,4 +1,4 @@ -var tape = require("tape"); +/* var tape = require("tape"); var protobuf = require("../debug"); @@ -105,4 +105,4 @@ tape.test("google.protobuf.Any type", function(test) { test.end(); }); -}); +}); */ \ No newline at end of file