Code Monkey home page Code Monkey logo

trex's Introduction

trex's People

Contributors

ahuigo avatar buttercubz avatar dragonizedpizza avatar einarmagnus avatar ghaerdi avatar jeff-hykin avatar jollytoad avatar kidonng avatar nberlette avatar riviergrullon avatar tranzystorekk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trex's Issues

Trex not installing dependencies from import_map.json

Describe the bug
After running trex install it does not cache the following dependencies:

{
  "imports": {
    "./": "./",
    "/": "./",
    "dayjs": "https://cdn.skypack.dev/[email protected]?dts",
    "dayjs/plugin/": "https://cdn.skypack.dev/[email protected]/plugin/",
    "flags/": "https://deno.land/[email protected]/flags/",
    "fs/": "https://deno.land/[email protected]/fs/",
    "neverthrow": "https://cdn.skypack.dev/[email protected]?dts",
    "path/": "https://deno.land/[email protected]/path/"
  }
}

To Reproduce
Steps to reproduce the behavior:

  1. Execute trex install > info.txt with an import_map.json following the structure above
  2. See this message in the first line of the file "import_map.json file not found"

Expected behavior
Should download and cache the dependencies from the import_map.json file

Screenshots
image

Desktop (please complete the following information):

  • OS: Fedora 33 with KDE

Thank you!

'trex' not found

Describe the bug
I ran the command in the install section of the documentation:

deno install -A --unstable -n trex --no-check https://deno.land/x/trex/cli.ts

But when I run trex, I get a message 'trex' not found, did you mean:...

To Reproduce
Steps to reproduce the behavior:

  1. Install Trex with deno install -A --unstable -n trex --no-check https://deno.land/x/trex/cli.ts
  2. Close terminal
  3. Reopen terminal and run trex
  4. See error

Desktop:

  • OS: Ubuntu 20, Windows 10

broken modules.

with deno 1.2.0 update some packages will be broken due to changes in lib std.

the moment Trex tries to install packages that are broken they will throw errors, the packages have to be repaired by their maintainers.

trex delete doesnt delete all the packages in import_map.json

Describe the bug

When i run from powershell trex delete doesnt delete the package from import_map.json file

To Reproduce Steps to reproduce the behavior:

  1. Run in powershell trex delete some_package

Screenshots
bug

Desktop

  • OS: Windows 10
  • Deno version: 1.12.1
  • Trex Version 1.29.4

Some times works but with some specific packages dont work

feat: Command run

This will get some functions like create a custom commands to run scripts

and will setup your IDE for a deno project.

Uncaught (in promise) TypeError: Cannot read property 'replace' of undefined

Describe the bug
trex run test.ts , when my program throws an error , Trex will throw another error in the meantime Uncaught (in promise) TypeError: Cannot read property 'replace' of undefined

To Reproduce

test.ts :

throw Error("error");

run.json

{
  "scripts": {
    "err": "deno run test.ts"
  }
}

executive command:
trex run err

trex throw another error infomation error: Uncaught (in promise) TypeError: Cannot read property 'replace' of undefined

Check file:///D:/Project/deno-test/test.ts
error: Uncaught Error: error
throw Error("error");
      ^
    at file:///D:/Project/deno-test/test.ts:1:7
error: Uncaught (in promise) TypeError: Cannot read property 'replace' of undefined
    ? `${code.open}${str.replace(code.regexp, code.open)}${code.close}`
                         ^
    at run (https://deno.land/[email protected]/fmt/colors.ts:69:26)
    at Module.yellow (https://deno.land/[email protected]/fmt/colors.ts:166:10)
    at Thread (https://deno.land/x/[email protected]/commands/run.ts:149:24)
    at async Run (https://deno.land/x/[email protected]/commands/run.ts:211:11)
    at async Main (https://deno.land/x/[email protected]/cli.ts:191:6)
    at async https://deno.land/x/[email protected]/cli.ts:286:24

run deno run test.ts only one error

Expected behavior

i hope it will be the same result like running command as deno run test.ts

Not available in VSCode's terminal

Describe the bug
Not available in VSCode's terminal, but everything is fine in Windows Terminal.

To Reproduce
Steps to reproduce the behavior:

  1. Open VSCode and go to Terminal
  2. Enter any of the commands under trex
  3. See error
error: Uncaught (in promise) TypeError: Path must be a string. Received undefined
    throw new TypeError(
          ^
    at assertPath (https://deno.land/[email protected]/path/_util.ts:18:11)
    at join (https://deno.land/[email protected]/path/win32.ts:333:5)
    at JsonStorage (https://deno.land/x/[email protected]/utils/storage.ts:41:9)
    at https://deno.land/x/[email protected]/handlers/handler_storage.ts:11:21

Expected behavior
Everything is fine, no errors are thrown

Screenshots

bug

Desktop (please complete the following information):

  • OS: Windows
  • Trex: 1.8.0
  • Deno: 1.12.2
  • VSCode: 1.59.1

Additional context
Add any other context about the problem here.

Provide a Unique Selling Proposition for trex comparing it with Deno's new task runner

since deno 1.20 introduced an integrated task runner (https://deno.com/blog/v1.20#new-subcommand-deno-task), it seems interesting to point out the benefits of using trex instead of deno task...

I'm not that much into the details of trex & deno task yet - so I could not directly point this out in the readme via pull request or so.

As an example use case it might be worth comparing how https://deno.land/x/snel would look like with deno task instead of using trex.

[FEATURE REQUEST] run.yaml

In addition to having run.json, please support run.yaml. YAML is shorter and easier to write, but most of all, you can have comments. This is essentially a 1- or 2-line change inside run.ts.

Love the idea of TRex!!!

PS: completely unrelated, any thoughts of naming the imports command as trix -- shorter command, i is for import, unfortunately, it's not dinosaur-themed.

Bad resource ID using the postinstall script

Describe the bug

Throws a Bad resource ID after a package installation when the postinstall script is defined in the run file and the postinstall script doesn't run.

To Reproduce

  1. Create a run.json file and define a postinstall script
  2. Install a package

Expected behavior

Should run the postinstall script after an installation without throwing errors.

Screenshots

error: Uncaught (in promise) "Bad resource ID"

Desktop (please complete the following information):

  • OS: ArcoLinux VM
  • Deno version: v1.23.1
  • Trex Version v1.11.0 current dev branch with this last commit 4c6fae0

Additional context

The code works well until below this comment, in the line 133 throws the error: 4c6fae0

Feature request – Allow specifying a custom output file name for the import map (e.g. import-map.json)

Is your feature request related to a problem? Please describe.

When I first started out with Deno I had always named the import map import-map.json. The deno CLI allows us to pass a --import-map= flag to specify our import map, and it doesn't seem like they default to import_map.json so it would be nice if Trex also allowed this to be configurable.


Describe the solution you'd like

I think it would be nice if we could have a flag to specify the output path like -o ./import-map.json or -o imports.json etc


Describe alternatives you've considered

N/A


Additional context

N/A

Will Trex avoid the shortcomings of npm?

See here: https://youtu.be/M3BM9TB-8yA?t=584

Ryan Dahl is the creator of Node. Two years ago he presented his regrets about it. He regretted how the package.json "allowed the concept of a 'module' to mean a directory of files" and created a centralized repository with not much clarity on where the dependencies live. JS on the web usually doesn't follow this pattern. Package.json also became bloated in his eyes.

Does Trex avoid these shortcomings?

It does seem like Trex has some centralization like the package.json (pro and con of extracting imports into one place)... but also has the same specificity of deno for imports.

@RivierGrullon @buttercubz

  • Fellow JS developer

Ability to pin dependencies to latest version without knowing the specific version number

Is your feature request related to a problem? Please describe.
When installing dependencies, similar to npm/yarn/pnpm, one might know the name of the dependency they want to install but not what its latest version is, but want to make sure that the version is pinned so that when other developers/CI install the dependencies they get the same version. Lockfiles in Deno seem more about ensuring the downloaded files are accurate, but not about pinning to particular versions without previously knowing them.

Describe the solution you'd like

Currently when running:

$ trex install --map fs

You'll get:

{
  "imports": {
    "fs/": "https://deno.land/std/fs/"
  }
}

What could be nice is potentially a new flag for pinning installed deps to the exact latest version:

# not sure about the name of this flag:
$ trex install --map --exact fs

# underneath the hood, the above command would effectively run:
$ trex install --map [email protected]
{
  "imports": {
    "fs/": "https://deno.land/[email protected]/fs/"
  }
}

This way you get the benefit of not having the dependencies changing between installs, if you care about that, and developers don't need to know the version prior to installing them.

Describe alternatives you've considered
The alternative would be to go on places like deno.land to lookup the versions of each dependency you want to install and manually enter them into the trex CLI when installing (e.g. trex install --map [email protected]).

The property `deno.import_map` is not recognized anymore on VS Code's Deno extesion.

Describe the bug
The property import_map on VS Code Deno extension is now importMap. Trex is creating it wrongly as of today.

To Reproduce
Steps to reproduce the behavior:

  1. Execute trex setup --vscode
  2. Check that it created .vscode/settings.json with deno.import_map property.

Expected behavior
The deno.import_map property should be deno.importMap.

Desktop (please complete the following information):

  • OS: Pop_OS! 20.10

Can't install modules using trex

Describe the bug
install any module from deno.land/x or nest.land it's failling 'cuz deno delete the database.json.

We're working on that

NotFound: No such file or directory

Describe the bug A clear and concise description of what the bug is.

When running trex install --map fs with my own entries in import_map.json, an error is produced saying NotFound: No such file or directory.

To Reproduce Steps to reproduce the behavior:

trex install --map fs results in error saying

time to installation: 2.8s
error: Uncaught (in promise) "NotFound: No such file or directory (os error 2)"

After some more testing, I found out that its import_map - when I run it with an import_map which doesn't have my own entries within it, no such error is produced.

import_map.json

Expected behavior A clear and concise description of what you expected to
happen.

To install without an error.

Screenshots If applicable, add screenshots to help explain your problem.

TrexTest
(trex also consumes extra lines when running trex install)

Desktop (please complete the following information):

  • OS: Arch Linux
  • Deno version: 1.29.2
  • Trex Version:
    image
    some version bug? it says I upgraded to 1.12.0 when using trex upgrade --canary but trex --version outputs 1.11.0.

Additional context Add any other context about the problem here.

Add NPM support, please

Is your feature request related to a problem? Please describe. A clear and
concise description of what the problem is. Ex. I'm always frustrated when [...]
Given Deno now supports installing packages from NPM, https://deno.land/[email protected]/node, it would be nice if Trex supported this too.

Describe the solution you'd like A clear and concise description of what you
want to happen.
Please support npm protocol as a source for packages, parse npm:hello...

Describe alternatives you've considered A clear and concise description of
any alternative solutions or features you've considered.
installing myself,

Additional context Add any other context or screenshots about the feature
request here.
Would allow porting tools such as storybook that depend on NPM.

Make `--map` the default behaviour

It's frustrating to have to type this flag every time I want to add a package when it's required 85% of the time.

It would be nice if the behavior was the default and the user only needs to add things like --nest & --pkg when they're required.

Some other options:

  • The option to globally set the default package provider (flags would then only be needed for the non-default)
  • Set a default provider in a .trexrc file or something similar for local config.

Trex run scripts crash within GitHub Actions

Describe the bug

When calling trex run [...] in GitHub Actions, they throw an error and abort with error: Uncaught (in promise) Permission denied (os error 13).

To Reproduce

  1. Create a GitHub Actions workflow file as follows.
name: CI - Linting - Backend

on:
  pull_request:

jobs:
  lint:
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2
      - uses: denoland/setup-deno@v1
        with:
          deno-version: v1.x

      - name: Install Trex
        run: deno install -A --unstable --import-map=https://deno.land/x/trex/import_map.json -n trex --no-check https://deno.land/x/trex/cli.ts

      - name: Format the backend
        run: cd backend/ && trex run fmt

      - name: Lint the backend
        run: cd backend/ && trex run lint

      - name: Test the backend
        run: cd backend/ && trex run test
  1. The scripts were created in the run.json as follows.
{
  "scripts": {
    "lint": "deno lint --config deno.json",
    "fmt": "deno fmt --config deno.json",
    "test": "deno test --config deno.json --import-map=../import_map.json",
  },
  "files": [
    "./src"
  ]
}
  1. The following error will occur and stop the GitHub Actions.
Run cd backend/ && trex run fmt
  cd backend/ && trex run fmt
  shell: /usr/bin/bash -e {0}
error: Uncaught (in promise) Permission denied (os error 13)
Error: Process completed with exit code 1.

Expected behavior

The GitHub Actions should run the Trex scripts without any problems and should not throw any error and abort.

Screenshots

There are no screenshots available for this problem.

Desktop (please complete the following information):

Additional context

Maybe the problem is caused by the exec deno run --allow-all --quiet --no-check --unstable --import-map 'https://deno.land/x/trex/import_map.json' 'https://deno.land/x/trex/cli.ts' "$@" statement in the trex file in ~/.deno/bin/. This Stack Overflow post describes the problem with GitHub Actions and exec.

Trex check cannot handle local alias

I have an alias in my import map:

{
  "imports": {
    "@common/": "../common/",
    "std/": "https://deno.land/[email protected]/"
  }
}

When I run trex check it fails with:

error: Uncaught (in promise) TypeError: Invalid URL
const toURL = (url: string) => new URL(url);
                               ^
    at Object.opSync (deno:core/01_core.js:142:12)
    at opUrlParse (deno:ext/url/00_url.js:47:27)
    at new URL (deno:ext/url/00_url.js:320:20)
    at toURL (https://deno.land/x/[email protected]/handlers/handler_check.ts:144:32)
    at isDenoLand (https://deno.land/x/[email protected]/handlers/handler_check.ts:157:24)
    at checkDepsUpdates (https://deno.land/x/[email protected]/handlers/handler_check.ts:44:9)
    at async Main (https://deno.land/x/[email protected]/cli.ts:274:7)
    at async https://deno.land/x/[email protected]/cli.ts:299:3

Instead it should just ignore the local mappings.

Desktop:

  • OS: Arch Linux
  • Deno version: 1.16.1
  • Trex Version: 1.10.0

Add the unmap command to convert the import in the code to the actual URL address

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

main.ts

#!/usr/bin/env dx
import { $, $a, cd, echo, env, fs, glob, nothrow, os, printf, pwd, question } from 'deno_dx'
import { blue, green, red, yellow } from 'fmt/colors.ts'

import_map.json

{
  "imports": {
    "deno_dx": "https://deno.land/x/[email protected]/mod.ts",
    "fmt/": "https://deno.land/[email protected]/fmt/"
  }
}

when i use the unmap command

trex unmap

the main.ts should be

#!/usr/bin/env dx
import { $, $a, cd, echo, env, fs, glob, nothrow, os, printf, pwd, question } from 'https://deno.land/x/[email protected]/mod.ts'
import { blue, green, red, yellow } from 'https://deno.land/[email protected]/fmt/colors'

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

https://github.com/facebook/jscodeshift

Additional context
Add any other context or screenshots about the feature request here.

Deno fails to install Trex v1.9.0

Running (Copy pasted from the v1.9.0 README) on a fresh repo:

deno install -A --unstable --import-map=https://deno.land/x/trex/import_map.json -n trex --no-check https://deno.land/x/trex/cli.ts

With the latest update to v1.9.0, trex now imports:

"wait": "http://denopkg.com/crewdevio/tools@main/wait/mod.ts"

Due to being a HTTP url, deno refuses to install Trex.

error: Modules imported via https are not allowed to import http modules.
  Importing: http://denopkg.com/crewdevio/tools@main/wait/mod.ts
    at https://deno.land/x/[email protected]/cli.ts:33:0

possible error updating trex to version v1.2.2

denoland/deno#7455

with deno 1.4 update the way installable scripts are generated change, before a trex.cmd file was generated with the following:

% generated by deno install %
@deno.exe "run" "--allow-read" "--allow-write" "--allow-net" "--allow-env" "--allow-run" "--allow-plugin" "--allow-hrtime" "--unstable" "https://deno.land/x/[email protected]/cli.ts" %*

this points directly to the url of the cli

now, deno install creates a trex.js file this is a bundler of the whole cli and the file points directly to this bundler but these are being generated with errors.

% generated by deno install %
@deno.exe "run" "--allow-read" "--allow-write" "--allow-net" "--allow-env" "--allow-run" "--allow-plugin" "--allow-hrtime" "--unstable" "C:\Users\****\.deno\bin\trex.js" %*

If after installation or update trex does not work, replace the absolute path of the bundler file with the URL of the latest version of trex.

url of the latest version: https://deno.land/x/[email protected]/cli.ts

Can't install deno std modules with a custom name

Describe the bug
Trex won't assign a correct mapping from std even if a name is supplied

To Reproduce
trex install --map fs=https://deno.land/[email protected]/fs
Now the import_map.json has an entry as such:
"": "https://deno.land/[email protected]/fs/mod.ts"

Expected behavior
import_map.json contains an "fs": "https://deno.land/[email protected]/fs/mod.ts"

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • Ubuntu
  • Deno
  • deno 1.3.0
  • v8 8.6.334
  • typescript 3.9.7

Additional context
Add any other context about the problem here.
Log when running above command:

cache package... 

package not found.
cache package... 

time to installation: 1.7s
Package list: 
    |-  
    |-  webview
Happy Coding

use versioned urls to avoid breaking trex

since trex imports works fine, for the next version migrate to the imports system to handle trex dependencies with versioned urls,
with this we prevent std version releases from breaking trex

Install from jspm

Is your feature request related to a problem? Please describe.
It should be easier to install npm packages with Trex.

Describe the solution you'd like
A new install flag --npm (or something comparable) for installing from jspm.dev

Describe alternatives you've considered
Manual install with full URL or from a repository.

[FEATURE]: Set nest.land as package registry

Hi! I've had my eye on Trex for quite awhile now, and I think it's a really cool project!

I'm an author of nest.land - An immutable, blockchain powered package registry for Deno. I was wondering if you would be interested in adding Trex to our registry? I think the nest.land ecosystem would benefit greatly from this, and I also think that Trex would benefit because the Trex code would be permanently accessible from the web.

Here is a link to our documentation if you'd be interested in adding it: https://nest.land/docs

Let me know if you have any questions!

Tate

Release changes to egg.json

Trex cannot be installed from nest.land until a new version is published there that includes the cli.ts file.

V2 Roadmap

Should have

  • Remove script runner. Maybe keep installation lifecycle.
  • Remove integrity checking,
  • Remove --watch flag.
  • Install from standard library first when using --mod flag, if can't find the name in the standard library then check in third-party libraries.
  • Add a way to install a third-party library with the same name as the standard.
  • Make --mod as default by using install subcommand.
  • Use deno.json(c) file as default importMap.

Maybe

  • Subcommand to parse npm scripts to deno tasks.
  • Subcommand to parse npm depedencies to deno importMap.

Probably before v2

  • Support to npm: packages.
  • Support to node: packages.
  • Support to deno.json(c) importMap.

Trex not found path

Describe the bug
A clear and concise description of what the bug is.

I tried to install trex with the command in the README.
The command worked perfectly and the message is βœ… Successfully installed trex.
I tried to run trex and I get this error (in the screenshot)

To Reproduce
Steps to reproduce the behavior:

  1. Install trex.
  2. Run trex.
  3. See error.

Expected behavior
A clear and concise description of what you expected to happen.

Trex is supposed to show me the help pannel.

Screenshots
If applicable, add screenshots to help explain your problem.
Trex-err
Desktop (please complete the following information):

  • OS: Windows
  • Browser FireFox
  • Version 1909

use lowercase "t" and rename to "trex"

Is your feature request related to a problem? Please describe.
Almost all commands run in terminal are all composed of small letters, Trex with uppercase "t" would be difficult to type

Describe the solution you'd like
Rename "Trex" to "trex"

Describe alternatives you've considered
Type uppercase "t" in Trex by pressing shift every time

install error with deno-1.6.2

when run deno install -A --unstable -n trex https://deno.land/x/trex/cli.ts
got:

Download https://denopkg.com/crewdevio/Trex@proxy/proxy/files/fmt.ts
Download https://raw.githubusercontent.com/crewdevio/Trex/proxy/proxy/proxy.ts
Download https://denopkg.com/crewdevio/Trex@proxy/proxy/files/encoding.ts
Download https://raw.githubusercontent.com/crewdevio/Trex/proxy/proxy/files/encoding.ts
Download https://raw.githubusercontent.com/crewdevio/Trex/proxy/proxy/files/fmt.ts
Check https://deno.land/x/trex/cli.ts
error: TS2498 [ERROR]: Module '"deno:///none.d.ts"' uses 'export =' and cannot be used with 'export *'.
export * from "https://denopkg.com/crewdevio/Trex@proxy/proxy/files/fmt.ts";
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://deno.land/x/[email protected]/imports/fmt.ts:1:15

TS2305 [ERROR]: Module '"https://deno.land/x/[email protected]/imports/fmt.ts"' has no exported member 'colors'.
import { colors } from "../imports/fmt.ts";
         ~~~~~~
    at https://deno.land/x/[email protected]/tools/did_you_mean.ts:9:10

TS2305 [ERROR]: Module '"https://deno.land/x/[email protected]/imports/fmt.ts"' has no exported member 'colors'.
import { colors } from "../imports/fmt.ts";
         ~~~~~~
    at https://deno.land/x/[email protected]/utils/info.ts:9:10

TS2305 [ERROR]: Module '"https://deno.land/x/[email protected]/imports/fmt.ts"' has no exported member 'colors'.
import { colors } from "../imports/fmt.ts";
         ~~~~~~
    at https://deno.land/x/[email protected]/utils/logs.ts:12:10

TS2498 [ERROR]: Module '"deno:///none.d.ts"' uses 'export =' and cannot be used with 'export *'.
export * from "https://raw.githubusercontent.com/crewdevio/Trex/proxy/proxy/proxy.ts";
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://deno.land/x/[email protected]/imports/proxy.ts:1:15

TS2305 [ERROR]: Module '"https://deno.land/x/[email protected]/imports/proxy.ts"' has no exported member 'needProxy'.
import { needProxy, Proxy } from "../imports/proxy.ts";
         ~~~~~~~~~
    at https://deno.land/x/[email protected]/tools/logs.ts:11:10

TS2305 [ERROR]: Module '"https://deno.land/x/[email protected]/imports/proxy.ts"' has no exported member 'Proxy'.
import { needProxy, Proxy } from "../imports/proxy.ts";
                    ~~~~~
    at https://deno.land/x/[email protected]/tools/logs.ts:11:21

TS2305 [ERROR]: Module '"https://deno.land/x/[email protected]/imports/fmt.ts"' has no exported member 'colors'.
import { colors } from "../imports/fmt.ts";
         ~~~~~~
    at https://deno.land/x/[email protected]/tools/logs.ts:14:10

TS2305 [ERROR]: Module '"https://deno.land/x/[email protected]/imports/fmt.ts"' has no exported member 'colors'.
import { colors } from "../imports/fmt.ts";
         ~~~~~~
    at https://deno.land/x/[email protected]/handlers/handle_files.ts:13:10

TS2305 [ERROR]: Module '"https://deno.land/x/[email protected]/imports/proxy.ts"' has no exported member 'needProxy'.
import { needProxy, Proxy } from "../imports/proxy.ts";
         ~~~~~~~~~
    at https://deno.land/x/[email protected]/handlers/handle_third_party_package.ts:10:10

TS2305 [ERROR]: Module '"https://deno.land/x/[email protected]/imports/proxy.ts"' has no exported member 'Proxy'.
import { needProxy, Proxy } from "../imports/proxy.ts";
                    ~~~~~
    at https://deno.land/x/[email protected]/handlers/handle_third_party_package.ts:10:21

TS2305 [ERROR]: Module '"https://deno.land/x/[email protected]/imports/proxy.ts"' has no exported member 'needProxy'.
import { needProxy, Proxy } from "../imports/proxy.ts";
         ~~~~~~~~~
    at https://deno.land/x/[email protected]/handlers/handle_cache.ts:9:10

TS2305 [ERROR]: Module '"https://deno.land/x/[email protected]/imports/proxy.ts"' has no exported member 'Proxy'.
import { needProxy, Proxy } from "../imports/proxy.ts";
                    ~~~~~
    at https://deno.land/x/[email protected]/handlers/handle_cache.ts:9:21

TS2305 [ERROR]: Module '"https://deno.land/x/[email protected]/imports/fmt.ts"' has no exported member 'colors'.
import { colors } from "../imports/fmt.ts";
         ~~~~~~
    at https://deno.land/x/[email protected]/handlers/handle_cache.ts:12:10

TS2305 [ERROR]: Module '"https://deno.land/x/[email protected]/imports/fmt.ts"' has no exported member 'colors'.
import { colors } from "../imports/fmt.ts";
         ~~~~~~
    at https://deno.land/x/[email protected]/handlers/handle_packages.ts:20:10

TS2305 [ERROR]: Module '"https://deno.land/x/[email protected]/imports/fmt.ts"' has no exported member 'colors'.
import { colors } from "../imports/fmt.ts";
         ~~~~~~
    at https://deno.land/x/[email protected]/handlers/delete_package.ts:12:10

TS2305 [ERROR]: Module '"https://deno.land/x/[email protected]/imports/proxy.ts"' has no exported member 'Proxy'.
import { Proxy, needProxy } from "../imports/proxy.ts";
         ~~~~~
    at https://deno.land/x/[email protected]/handlers/purge_package.ts:10:10

TS2305 [ERROR]: Module '"https://deno.land/x/[email protected]/imports/proxy.ts"' has no exported member 'needProxy'.
import { Proxy, needProxy } from "../imports/proxy.ts";
                ~~~~~~~~~
    at https://deno.land/x/[email protected]/handlers/purge_package.ts:10:17

TS2305 [ERROR]: Module '"https://deno.land/x/[email protected]/imports/fmt.ts"' has no exported member 'colors'.
import { colors } from "../imports/fmt.ts";
         ~~~~~~
    at https://deno.land/x/[email protected]/handlers/purge_package.ts:14:10

TS2498 [ERROR]: Module '"deno:///none.d.ts"' uses 'export =' and cannot be used with 'export *'.
export * from "https://denopkg.com/crewdevio/Trex@proxy/proxy/files/encoding.ts";
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://deno.land/x/[email protected]/imports/encoding.ts:1:15

TS2305 [ERROR]: Module '"https://deno.land/x/[email protected]/imports/encoding.ts"' has no exported member 'yaml'.
import { yaml } from "../imports/encoding.ts";
         ~~~~
    at https://deno.land/x/[email protected]/tools/parseToyaml.ts:9:10

TS2305 [ERROR]: Module '"https://deno.land/x/[email protected]/imports/fmt.ts"' has no exported member 'colors'.
import { colors } from "../imports/fmt.ts";
         ~~~~~~
    at https://deno.land/x/[email protected]/commands/run.ts:12:10

TS2305 [ERROR]: Module '"https://deno.land/x/[email protected]/imports/fmt.ts"' has no exported member 'colors'.
import { colors } from "../imports/fmt.ts";
         ~~~~~~
    at https://deno.land/x/[email protected]/tools/setup_ide.ts:12:10

Found 23 errors.
              

A command to cache all dependencies

Is your feature request related to a problem? Please describe.
Typings while coding in a new environment aren't provided due to the module not being installed, and there is no command to cache them.

Describe the solution you'd like
trex cache - caches (installs) http urls in import_map.json

Describe alternatives you've considered

Additional context

does not install if absolute path mappings are specified in import_map.json

Starting with a import_map.json that has mappings for absolute paths

{
  "imports": {
    "/": "./",
    "./": "./",
  }
}
trex --custom react=https://esm.sh/[email protected]

results in an error:

error: Uncaught (in promise) PermissionDenied: Access is denied. (os error 5)
    const buffer = await Deno.readFile(path);
                ^
    at deno:core/core.js:86:46
    at unwrapOpResult (deno:core/core.js:106:13)
    at async open (deno:runtime/js/40_files.js:46:17)
    at async Object.readFile (deno:runtime/js/40_read_file.js:20:18)
    at async readURLContent (https://deno.land/x/[email protected]/handlers/handle_files.ts:96:17)
    at async generateHash (https://deno.land/x/[email protected]/handlers/handle_files.ts:107:14)
    at async createPackage (https://deno.land/x/[email protected]/handlers/handle_files.ts:59:52)

Removing the absolute maps solves the problem.

Imports should never be used to import types error

Describe the bug
I tried to download the trex@imports version and Deno gave me a ton of errors regarding the importing of types. It says that it should import types with import type instead of import

To Reproduce
Steps to reproduce the behavior:

  1. Run deno install -A --unstable -n trex https://denopkg.com/crewdevio/Trex@imports/cli.ts

Expected behavior
I expected it to download trex

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Chrome
  • Version: 10

Additional context
This is probably an easy fix and I will try to do it myself.

run` trex i --map oak` failed ?

Describe the bug A clear and concise description of what the bug is.
run trex i --map oak failed ?
To Reproduce Steps to reproduce the behavior:

trex i --map oak
error: Uncaught (in promise) "\n\x1b[31m=>\x1b[39m \x1b[33moak\x1b[39m is not a third party module\n\x1b[32minstall using custom install\x1b[39m\n"

Expected behavior A clear and concise description of what you expected to
happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Microsoft Windows [Version 10.0.22621.1702]
  • Deno version: deno 1.33.1 (release, x86_64-pc-windows-msvc)
  • Trex Version :trex: v1.12.1

Additional context Add any other context about the problem here.

all trex commands ruins

All deno commands ruins with:

`error: Uncaught (in promise) NotFound: No such file or directory (os error 2), mkdir '/home/gohryt/.deno/trex_storage/'
if (!(await exists(storagePath))) await mkdir(storagePath);
^
at async mkdir (deno:runtime/js/30_fs.js:109:5)
at async JsonStorage (https://deno.land/x/[email protected]/utils/storage.ts:44:37)
at async https://deno.land/x/[email protected]/handlers/handler_storage.ts:11:15

  • OS: Fedora 35
  • Deno version: 1.19
  • Trex version: latest

Missing cli.ts file in egg.ts

Describe the bug
Seems the Trex.ts file hasn't been renamed to cli.ts in the egg.ts. It's missing in nest.land and thus cannot be installed.

To Reproduce
Steps to reproduce the behavior:

  1. Install Trex from nest.land.

Expected behavior
Trex should be installed successfully

Observed behavior
Installation fails with a "404 not found" error

Watch flag in run command

Is your feature request related to a problem? Please describe.
I'm trying to pass the --watch flag to my script but is stripped by Trex and being used as rsap

Describe the solution you'd like
Follow the deno arguments schema as:

trex run --watch myScriptName

So the --watch only affects the run command and not the args of my script

Describe alternatives you've considered
trex run myScriptName -- --watch

Additional context
image

This tool is really awesome, thank you for developing this 😁 hope this be reviewed and accepted by your side.

Cheers.

Pruning unused imports

Is your feature request related to a problem? Please describe.
User can clean up their import map by removing unused imports. I'm not sure if it's necessary since it's just an import map, but it would be quite useful for those who wants to figure out which packages are used, for example.

Describe the solution you'd like
Provide a way to optimize import map using a command like trex prune
A clear and concise description of what you want to happen.

Additional context
I'm wondering how many needs are there for this kind of functionality.
I am worried that the traversal may be way too complex and time-consuming task, compared to other commands.

By the way, thanks your effort in developing Trex πŸ˜ƒ

Running 'imports upgrade' gives syntax error

Running 'imports upgrade' gives syntax error.

Logs:

Ξ» imports upgrade
Check https://denopkg.com/crewdevio/Trex@imports/cli.ts
error: Uncaught (in promise) SyntaxError: Unexpected token I in JSON at position 0
    at JSON.parse (<anonymous>)
    at Response.json (deno:op_crates/fetch/26_fetch.js:843:19)
    at async updateTrex (https://raw.githubusercontent.com/crewdevio/Trex/imports/utils/logs.ts:28:24)
    at async mainCli (https://raw.githubusercontent.com/crewdevio/Trex/imports/cli.ts:119:5)
    at async https://raw.githubusercontent.com/crewdevio/Trex/imports/cli.ts:170:3

trex check incorrect latest version

import_map.json

{
  "imports": {
    "fs/": "https://deno.land/[email protected]/fs/"
  }
}
❯ trex check
this is a deno.land/std package:

The package "fs" is outdate: current = 0.125.0; latest = 0.123.0;

[quick fix]: trex i -m [email protected]

To Reproduce Steps to reproduce the behavior:

  1. Use the import map file as above.
  2. execute trex check

Expected behavior
Not suggest an update command

System:

  • OS: Arch Linux 5.16.8
  • Deno version: 1.18.2
  • Trex Version 1.10.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.