crewdevio / trex Goto Github PK
View Code? Open in Web Editor NEWPackage Manager for deno π¦
Home Page: https://crewdevio.mod.land/projects/Trex
License: MIT License
Package Manager for deno π¦
Home Page: https://crewdevio.mod.land/projects/Trex
License: MIT License
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:
trex install > info.txt
with an import_map.json following the structure above"import_map.json file not found"
Expected behavior
Should download and cache the dependencies from the import_map.json file
Desktop (please complete the following information):
Thank you!
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:
deno install -A --unstable -n trex --no-check https://deno.land/x/trex/cli.ts
trex
Desktop:
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.
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:
trex delete some_package
Desktop
Some times works but with some specific packages dont work
This will get some functions like create a custom commands to run scripts
and will setup your IDE for a deno project.
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
Describe the bug
Not available in VSCode's terminal, but everything is fine in Windows Terminal.
To Reproduce
Steps to reproduce the behavior:
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
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
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.
add short commands to use cli
this
trex install --map [email protected]
to this
trex i -m [email protected]
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.
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
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):
Additional context
The code works well until below this comment, in the line 133 throws the error: 4c6fae0
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
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.
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]
).
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:
trex setup --vscode
.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):
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
remove synchronous functions like existSync
and readJsonSync
so that the eventLoop can't be blocked
trex --custom ts-json-schema-generator=https://esm.sh/ts-json-schema-generator?target=deno
is converted to
{
"imports": {
"ts-json-schema-generator": "https://esm.sh/ts-json-schema-generator?target"
}
}
Note the stripping of the URL parameter value.
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.
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.
(trex also consumes extra lines when running trex install
)
Desktop (please complete the following information):
Additional context Add any other context about the problem here.
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.
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:
.trexrc
file or something similar for local config.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
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
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"
]
}
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):
v1.19.0
v1.10.0
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
.
Hello,
I want to install the std/dotenv
module, but there is a third party module with the same name (dotenv
) and Trex always installs it instead of the standard library. How do I tell Trex that I want to install the standard library ?
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:
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.
with the stabilization of the import maps added to the fact that in the next few days it will be possible to use remote import maps, which will make this version unnecessary, since trex, like other tools, will be migrated to using import maps to handle dependencies.
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
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
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):
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
some packages cannot be installed using the --pkg command as they use another main branch name.
example:
trex i --pkg oakserver/oak/mod.ts oak
since oak uses main branch main
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
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.
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
Trex cannot be installed from nest.land until a new version is published there that includes the cli.ts
file.
--watch
flag.--mod
flag, if can't find the name in the standard library then check in third-party libraries.--mod
as default by using install
subcommand.deno.json(c)
file as default importMap.npm:
packages.node:
packages.deno.json(c)
importMap.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:
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.
Desktop (please complete the following information):
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
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.
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
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.
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:
deno install -A --unstable -n trex https://denopkg.com/crewdevio/Trex@imports/cli.ts
Expected behavior
I expected it to download trex
Desktop (please complete the following information):
Additional context
This is probably an easy fix and I will try to do it myself.
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):
Additional context Add any other context about the problem here.
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
This will make trex much more similar to the npm.
Or this may cause problem due to the deno plugin's config?
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:
Expected behavior
Trex should be installed successfully
Observed behavior
Installation fails with a "404 not found" error
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
This tool is really awesome, thank you for developing this π hope this be reviewed and accepted by your side.
Cheers.
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.
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
version 0.59.0
of the std
library comes out as the latest version.
{
"imports": {
"fs/": "https://deno.land/[email protected]/fs/"
}
}
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:
trex check
Expected behavior
Not suggest an update command
System:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.