Commit graph

175 commits

Author SHA1 Message Date
Asher Gomez 92f6188253
chore: use @std import instead of @test_util/std (#22398)
This PR:
1. Replaces `@test_util/std`-prefixed imports with `@std`.
2. Adds `@std/` import map entries to a few `deno.json` files.
2024-02-13 02:05:10 +00:00
Matt Mastracci 3d2e52ae7e
chore: continue tests/ re-org (#22396)
Split `node_compat_tests` into its own top-level test so its stdout
doesn't stomp on the remainder of the tests.
2024-02-12 17:13:14 -07:00
Nayeem Rahman 49d82e609f
feat(lsp): jsr support first pass (#22382)
This implementation heavily depends on there being a lockfile, meaning
JSR specifiers will always diagnose as uncached unless it's there. In
practice this affects cases where a `deno.json` isn't being used. Our
NPM specifier support isn't subject to this.

The reason for this is that the version constraint solving code is
currently buried in `deno_graph` and not usable from the LSP, so the
only way to reuse that logic is the solved-version map in the lockfile's
`packages.specifiers`.
2024-02-12 22:12:49 +00:00
Matt Mastracci f60720090c
chore: move test_ffi and test_nap to tests/ [WIP] (#22394)
Moving some additional NAPI and. FFI tests out of the tree root.
2024-02-12 13:46:50 -07:00
Leo Kettmeir bd1358efab
fix(console): support NO_COLOR and colors option in all scenarios (#21910)
Noticed in #21607
2024-02-12 14:35:23 +01:00
Matt Mastracci f5e46c9bf2
chore: move cli/tests/ -> tests/ (#22369)
This looks like a massive PR, but it's only a move from cli/tests ->
tests, and updates of relative paths for files.

This is the first step towards aggregate all of the integration test
files under tests/, which will lead to a set of integration tests that
can run without the CLI binary being built.

While we could leave these tests under `cli`, it would require us to
keep a more complex directory structure for the various test runners. In
addition, we have a lot of complexity to ignore various test files in
the `cli` project itself (cargo publish exclusion rules, autotests =
false, etc).

And finally, the `tests/` folder will eventually house the `test_ffi`,
`test_napi` and other testing code, reducing the size of the root repo
directory.

For easier review, the extremely large and noisy "move" is in the first
commit (with no changes -- just a move), while the remainder of the
changes to actual files is in the second commit.
2024-02-10 20:22:13 +00:00
Luka Hartwig f168597b7a
Remove //tests symlink (#3849) 2020-02-02 16:55:22 -05:00
Ryan Dahl 9cfdc60a23
Move integration tests to //cli/tests/ (#2964)
This ensures the deno executable is properly created before running the integration tests.

Also allows deno_cli to be used as a lib. Docs are now properly generated: https://docs.rs/deno_cli/0.18.4/deno_cli/

Towards #2933
Prep for #2955
2019-09-16 21:05:14 -04:00
Kitson Kelly c30decab77 Fix type directive parsing (#2954) 2019-09-15 08:58:06 -04:00
Bartek Iwańczuk 686b86edb1 feat: parallelize downloads from TS compiler (#2949) 2019-09-14 12:05:00 -04:00
Bert Belder ac68f628d2
Upgrade rust crates 2019-09-13 00:38:02 +02:00
Ryan Dahl 69e01c2374
Update README for integration tests (#2929) 2019-09-12 14:51:15 -04:00
Bartek Iwańczuk a4e1d7d2e7 fix: type directives import (#2910) 2019-09-11 06:47:34 -04:00
Bartek Iwańczuk acee1944b9 feat: Make integration tests rust unit tests (#2884)
Co-authored-by:  Bartek Iwańczuk <biwanczuk@gmail.com>
2019-09-10 11:09:54 -04:00
Bartek Iwańczuk 2a83327a21 fix: replace bad rid panics with errors (#2870) 2019-09-10 00:59:40 -04:00
Yoshiya Hinosawa f12acdb50b Update @typescript-eslint/* to v2.1.0 (#2878) 2019-09-07 12:27:18 -04:00
Kevin (Kun) "Kassimo" Qian 49ea932af8 Fix xeval chunk incorrect matching behavior (#2857) 2019-09-04 18:31:14 -04:00
Ryan Dahl d43b43ca78
Refactor snapshot build (#2825)
Instead of using core/snapshot_creator.rs, instead two crates are
introduced which allow building the snapshot during build.rs.

Rollup is removed and replaced with our own bundler. This removes
the Node build dependency. Modules in //js now use Deno-style imports
with file extensions, rather than Node style extensionless imports.

This improves incremental build time when changes are made to //js files
by about 40 seconds.
2019-09-02 17:07:11 -04:00
Ryan Dahl c370f749b2
Remove ts_library_builder, maintain lib.deno_runtime.d.ts by hand (#2827) 2019-08-30 11:11:33 -04:00
Nayeem Rahman b6a4ec7d16 Improve error stacks for async ops (#2820) 2019-08-27 11:33:39 -04:00
Ryan Dahl d8ada4d3fc Port readSync/writeSync ops to minimal
This removes dispatch_flatbuffers as it is now unused. There are still a
few places where msg_generated is used: ErrorKind and MediaType. These
will be dealt with later.
2019-08-26 14:56:42 -04:00
Bartek Iwańczuk 520f9631e0 bring back json ops (#2815) 2019-08-26 08:50:21 -04:00
Ryan Dahl 2235dd795d
Revert json ops (#2814)
* Revert "port more ops to JSON (#2809)"

This reverts commit 137f33733d.

* Revert "port ops to JSON: compiler, errors, fetch, files (#2804)"

This reverts commit 79f82cf10e.

* Revert "Port rest of os ops to JSON (#2802)"

This reverts commit 5b2baa5c99.
2019-08-24 13:20:48 -07:00
Bartek Iwańczuk 79f82cf10e port ops to JSON: compiler, errors, fetch, files (#2804) 2019-08-24 06:02:42 -07:00
Kitson Kelly 6c7d337960 Support .d.ts files (#2746)
Fixes #1432
2019-08-22 12:05:01 -04:00
Ryan Dahl bdc97b3976
Organize dispatch a bit (#2796)
Just some clean up reorganization around flatbuffer/minimal dispatch
code. This is prep for adding a JSON dispatcher.
2019-08-21 20:42:48 -04:00
Ryan Dahl 1f8b1a587c
Dynamic import should respect permissions (#2764) 2019-08-13 14:51:15 -04:00
Bartek Iwańczuk 9bd473d8ac feat: print cache location when no arg in deno info (#2752) 2019-08-11 18:43:01 -06:00
Kevin (Kun) "Kassimo" Qian 286ee1d8b6 Fix dynamic import base path problem for REPL and eval (#2757) 2019-08-09 16:33:59 -07:00
Bert Belder 6fbf2e9624
Dynamic import (#2516) 2019-08-09 01:19:45 +02:00
andy finch 56a82e72d9 Resolve worker specifiers relative to main module of host. (#2751) 2019-08-08 14:38:53 -07:00
Kevin (Kun) "Kassimo" Qian 4519f9a50d Make Deno.execPath a function (#2743)
And throws without allow-env
2019-08-06 17:05:47 -04:00
Kevin (Kun) "Kassimo" Qian ccee2f01ba Implement Blob url support for worker (#2729) 2019-08-06 09:22:11 -04:00
Kevin (Kun) "Kassimo" Qian ddee2dff14 Provide option to delete Deno namespace in worker (#2717) 2019-08-05 07:23:41 -04:00
Bartek Iwańczuk 2e1ab82321 refactor: cleanup compiler pipeline (#2686)
* remove fetch_source_file_and_maybe_compile_async and 
  replace it with State.fetch_compiled_module

* remove SourceFile.js_source()

* introduce CompiledModule which is basically the same as
  deno::SourceInfo and represents arbitrary file that has been 
  compiled to JS module

* introduce //cli/compilers module containing all compilers

* introduce JsCompiler which is a no-op compiler
  - output is the same as input, no compilation takes place
  - it is used for MediaType::JavaScript and MediaType::Unknown

* introduce JsonCompiler that wraps JSON in default export

* support JS-to-JS compilation using checkJs
2019-07-31 13:16:03 -04:00
Bartek Iwańczuk e7cee29c84 Add --current-thread flag (#2702) 2019-07-31 11:02:20 -04:00
Bartek Iwańczuk ac269beabe feat: add debug info to ModuleResolutionError (#2697) 2019-07-30 14:34:57 +00:00
Kitson Kelly 5083f5fd90 Remap stack traces of unthrown errors. (#2693) 2019-07-29 09:11:08 +00:00
Bartek Iwańczuk 729c4e9377 make importmap flag global (#2687) 2019-07-27 14:37:03 +00:00
Bartek Iwańczuk 89e6792203 cli: handle deno -v and deno --version (#2684) 2019-07-27 09:20:40 +00:00
Bartek Iwańczuk 34f212f257 fix: bring back --no-fetch flag (#2671) 2019-07-20 09:19:06 -04:00
Ryan Dahl a37bc0088f
Remove hacky normalize_path (#2660) 2019-07-18 15:01:44 -04:00
Bartek Iwańczuk 8214b686ce Refactor DenoDir (#2636)
* rename `ModuleMetaData` to `SourceFile` and remove TS specific
  functionality

* add `TsCompiler` struct encapsulating processing of TypeScript files

* move `SourceMapGetter` trait implementation to `//cli/compiler.rs`

* add low-level `DiskCache` API for general purpose caches and use it in
  `DenoDir` and `TsCompiler` for filesystem access

* don't use hash-like filenames for compiled modules, instead use
  metadata file for storing compilation hash

* add `SourceFileCache` for in-process caching of loaded files for fast
  subsequent access

* define `SourceFileFetcher` trait encapsulating loading of local and
  remote files and implement it for `DenoDir`

* define `use_cache` and `no_fetch` flags on `DenoDir` instead of using
  in fetch methods
2019-07-17 18:15:30 -04:00
Yoshiya Hinosawa 9c45499864 Support window.onload (#2643) 2019-07-16 00:19:26 -04:00
Bartek Iwańczuk 72d9045528
cli: refactor deno_dir to use Url instead of String 2019-07-08 13:07:32 +02:00
Bert Belder 9b1997b8b6
core: clearly define when module lookup is path-based vs URL-based
The rules are now as follows:

* In `import` statements, as mandated by the WHATWG specification,
  the import specifier is always treated as a URL.
  If it is a relative URL, it must start with either / or ./ or ../

* A script name passed to deno as a command line argument may be either
  an absolute URL or a local path.
  - If the name starts with a valid URI scheme followed by a colon, e.g.
    'http:', 'https:', 'file:', 'foo+bar:', it always interpreted as a
    URL (even if Deno doesn't support the indicated protocol).
  - Otherwise, the script name is interpreted as a local path. The local
    path may be relative, and operating system semantics determine how
    it is resolved. Prefixing a relative path with ./ is not required.
2019-07-08 13:07:32 +02:00
Bert Belder 32cde32e54 core: return useful error when import path has no prefix like ./ 2019-06-30 19:46:32 +02:00
Gurwinder Singh d7d3e9f9de Fix multiple error messages for a missing file (#2587) 2019-06-27 09:34:12 -04:00
Bartek Iwańczuk 70a9859adc refactor: use Path/PathBuf in deno dir (#2559) 2019-06-24 10:10:21 -07:00
Ryan Dahl f2c50fae84
Fix silent failure of WebAssembly.instantiate() (#2548)
By making WASM compilation synchronous. We'll have to do more work to
make it properly async.
2019-06-20 09:04:34 -07:00