From 8d03397293b388317299dfb0648b541a7005807d Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Thu, 14 Nov 2019 02:35:56 +1100 Subject: Make bundles fully standalone (#3325) - Bundles are fully standalone. They now include the shared loader with `deno_typescript`. - Refactor of the loader in `deno_typescript` to perform module instantiation in a more - Change of behaviour when an output file is not specified on the CLI. Previously a default name was determined and the bundle written to that file, now the bundle will be sent to `stdout`. - Refactors in the TypeScript compiler to be able to support the concept of a request type. This provides a cleaner abstraction and makes it easier to support things like single module transpiles to the userland. - Remove a "dangerous" circular dependency between `os.ts` and `deno.ts`, and define `pid` and `noColor` in a better way. - Don't bind early to `console` in `repl.ts`. - Add an integration test for generating a bundle. --- cli/tests/bundle.test.out | 18 ++++++++++++++++++ cli/tests/integration_tests.rs | 5 +++++ 2 files changed, 23 insertions(+) create mode 100644 cli/tests/bundle.test.out (limited to 'cli/tests') diff --git a/cli/tests/bundle.test.out b/cli/tests/bundle.test.out new file mode 100644 index 000000000..d6f6e8a62 --- /dev/null +++ b/cli/tests/bundle.test.out @@ -0,0 +1,18 @@ +[WILDCARD] +let define; +[WILDCARD] +let instantiate; +[WILDCARD] +(function() { +[WILDCARD] +})(); + +define("print_hello", ["require", "exports"], function (require, exports) { +[WILDCARD] +}); +define("mod1", ["require", "exports", "subdir2/mod2"], function (require, exports, mod2_ts_1) { +[WILDCARD] +}); + +instantiate(["mod1"]); + diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index fc059b1b3..b5b927172 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -391,6 +391,11 @@ itest!(async_error { output: "async_error.ts.out", }); +itest!(bundle { + args: "bundle subdir/mod1.ts", + output: "bundle.test.out", +}); + itest!(circular1 { args: "run --reload circular1.js", output: "circular1.js.out", -- cgit v1.2.3