Giter VIP home page Giter VIP logo

deno-udd's Introduction

Update Deno Dependencies

Run this script to update your dependency urls to their latest published versions. Optionally run --test(s) to ensure that each dependency update is non-breaking.

deno-udd

ci-status

Note: udd is fundamentally different from something like npm or yarn. Other tools do a "distributed update" i.e. every user updates independently (and potentially to untested versions/configurations of dependencies). With udd precisely one person updates (a maintainer), and they can ensure that the new dependencies pass the test suite before commiting/releasing a new version. With udd every user has a fixed version of the dependencies.

Semantic versioning fragments are purely a convenience for the maintainer, and do not affect users.

Installation

Use deno install to install or update udd:

deno install -rf --allow-read=. --allow-write=. --allow-net https://deno.land/x/udd/main.ts

You may need to include the deno bin directory in your PATH.

Usage

For example, to update url imports inside deps.ts run:

udd deps.ts

To update all the ts files in your directory:

udd *.ts

To ensure that deno test is successful when updating each dependency:

udd deps.ts --test="deno test"

Scheduled github action

You might like to use a github action to execute udd each day, check whether there are dependency updates, and - if there are - create a pull request to your repository.

As an example see the .github/workflows/udd.yml file in the udd repository.

Thanks to Eliaz Bobadilla for the initial action implementation.

Semantic versioning

If you append a fragment #${token}${version} to your urls you can manage their update behavior:

Token Name udd updates to the latest version such that
^ Compatible major version is the same (if major=0 then same minor version)
~ Approximately major and minor version are the same (or both major=0)
< Less than less than the provided version
= Equal it's exactly this version

The version argument is optional for ^, ~ and = (the version passed is the version in the url).

Examples

-export { Application } from "https://deno.land/x/[email protected]/mod.ts#^";
+export { Application } from "https://deno.land/x/[email protected]/mod.ts#^";  // 3.x.y is not chosen

-export { decode } from "https://deno.land/[email protected]/strings/decode.ts#=";
+export { decode } from "https://deno.land/[email protected]/strings/decode.ts#=";  // no change

-export { Application } from "https://deno.land/x/[email protected]/mod.ts#<0.2.0";
+export { Application } from "https://deno.land/x/[email protected]/mod.ts#<0.2.0";  // 0.2.x is not chosen

-export { encode } from "https://deno.land/[email protected]/strings/encode.ts#~";
+export { encode } from "https://deno.land/[email protected]/strings/encode.ts#~";  // update to latest compatible

udd-in-action

Supported domains

udd supports the following registry domains:

Create an issue to request additional registries.


Logo by Drake Sauer.

deno-udd's People

Contributors

4513echo avatar hayd avatar kawarimidoll avatar masnagam avatar ngruychev avatar oscarotero avatar rclarey avatar sigmasd avatar takker99 avatar ultirequiem avatar web-flow avatar xeevis 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

deno-udd's Issues

Ignore some deps

Is there a way to ignore a dep that I don't want to update.

there are some packages that use some versions that some functions no longer exist in new versions include your own deps like encode and decode from deps.ts

It would like this a way to ignore

//udd-ignore
export { decode, encode } from "https://deno.land/[email protected]/encoding/utf8.ts";

Not working correctly with `npm` specifier

I tried updating npm imports with udd using an old version of fuse.js

Expected Behaviour: update fuse.js from 6.6.0 to 6.6.2

Import map

{
  "imports": {
    "fuse": "npm:fuse.js@~6.6.0"
  }
}

udd output

/Path/to/imports.json
[1/1] Looking for releases: npm:fuse.js@~6.6.0"
        }
}
[1/1] Skip updating: npm:[email protected]"
        }
}
#~
Already latest version:
npm:fuse.js@~6.6.0"
        }
}
 == ~6.6.0"
        }
}

mod.ts

import Fuse from "npm:fuse.js@~6.6.0"

console.log(Fuse)

udd output

/Path/to/mod.ts
[1/1] Looking for releases: npm:fuse.js@~6.6.0"

console.log(Fuse)
[1/1] Skip updating: npm:[email protected]"

console.log(Fuse)
#~
Already latest version:
npm:fuse.js@~6.6.0"

console.log(Fuse)
 == ~6.6.0"

console.log(Fuse)

Mistakenly downgrade the deno standard library from 0.189.0 to 0.177.1? Why not compare the size of the version number?

Run deno run -A https://deno.land/x/udd/main.ts deps.ts *.ts '*/*.ts'  '*.json'
  deno run -A https://deno.land/x/udd/main.ts deps.ts *.ts '*/*.ts'  '*.json'
  shell: /usr/bin/bash -e {0}
Download https://deno.land/x/udd/main.ts
Warning Implicitly using latest version (0.8.2) for https://deno.land/x/udd/main.ts
Download https://deno.land/x/[email protected]/main.ts
Download https://deno.land/x/[email protected]/deps.ts
Download https://deno.land/x/[email protected]/mod.ts
Download https://deno.land/x/[email protected]/registry.ts
Download https://deno.land/std@0.[1](https://github.com/masx200/deno-http-middleware/actions/runs/5100475204/jobs/9168776153#step:5:1)66.0/flags/mod.ts
Download https://deno.land/[email protected]/fs/mod.ts
Download https://deno.land/[email protected]/fmt/colors.ts
Download https://deno.land/x/[email protected].[2](https://github.com/masx200/deno-http-middleware/actions/runs/5100475204/jobs/9168776153#step:5:2)/progress.ts
Download https://deno.land/x/[email protected]/search.ts
Download https://deno.land/x/[email protected]/semver.ts
Download https://deno.land/[email protected]/_util/asserts.ts
Download https://deno.land/[email protected]/fs/empty_dir.ts
Download https://deno.land/[email protected]/fs/ensure_dir.ts
Download https://deno.land/[email protected]/fs/ensure_file.ts
Download https://deno.land/[email protected]/fs/ensure_link.ts
Download https://deno.land/[email protected]/fs/ensure_symlink.ts
Download https://deno.land/[email protected]/fs/exists.ts
Download https://deno.land/[email protected]/fs/expand_glob.ts
Download https://deno.land/[email protected]/fs/move.ts
Download https://deno.land/[email protected]/fs/copy.ts
Download https://deno.land/[email protected]/fs/walk.ts
Download https://deno.land/[email protected]/fs/eol.ts
Download https://deno.land/[email protected]/path/mod.ts
Download https://deno.land/[email protected]/fs/_util.ts
Download https://deno.land/[email protected]/_util/os.ts
Download https://deno.land/[email protected]/path/win[3](https://github.com/masx200/deno-http-middleware/actions/runs/5100475204/jobs/9168776153#step:5:3)2.ts
Download https://deno.land/[email protected]/path/posix.ts
Download https://deno.land/[email protected]/path/common.ts
Download https://deno.land/[email protected]/path/separator.ts
Download https://deno.land/[email protected]/path/_interface.ts
Download https://deno.land/[email protected]/path/glob.ts
Download https://deno.land/[email protected]/path/_constants.ts
Download https://deno.land/[email protected]/path/_util.ts
/home/runner/work/deno-http-middleware/deno-http-middleware/deps.ts
[1/9] Looking for releases: https://deno.land/[email protected]/testing/asserts.ts[1/9] Attempting update: https://deno.land/[email protected]/testing/asserts.ts -> 0.177.1[1/9] Update successful: https://deno.land/[email protected]/testing/asserts.ts -> 0.177.1[2/9] Looking for releases: https://deno.land/[email protected]/encoding/hex.ts[2/9] Attempting update: https://deno.land/[email protected]/encoding/hex.ts -> 0.177.1[2/9] Update successful: https://deno.land/[email protected]/encoding/hex.ts -> 0.177.1[3/9] Looking for releases: https://deno.land/[email protected]/testing/asserts.ts[3/9] Attempting update: https://deno.land/[email protected]/testing/asserts.ts -> 0.177.1[3/9] Update successful: https://deno.land/[email protected]/testing/asserts.ts -> 0.177.1[[4](https://github.com/masx200/deno-http-middleware/actions/runs/5100475204/jobs/9168776153#step:5:5)/9] Looking for releases: https://deno.land/x/[email protected]/mod.ts[4/9] Using latest: https://deno.land/x/[email protected]/mod.ts[[5](https://github.com/masx200/deno-http-middleware/actions/runs/5100475204/jobs/9168776153#step:5:6)/9] Looking for releases: https://deno.land/[email protected]/http/http_status.ts[5/9] Attempting update: https://deno.land/[email protected]/http/http_status.ts -> 0.177.1[5/9] Update successful: https://deno.land/[email protected]/http/http_status.ts -> 0.177.1[[6](https://github.com/masx200/deno-http-middleware/actions/runs/5100475204/jobs/9168776153#step:5:7)/9] Looking for releases: https://cdn.skypack.dev/[email protected]/isPlainObject?dts[6/9] Using latest: https://cdn.skypack.dev/[email protected]/isPlainObject?dts[7/9] Looking for releases: https://cdn.skypack.dev/[email protected]?dts[7/9] Skip updating: https://cdn.skypack.dev/[email protected]?dts[8/9] Looking for releases: https://esm.sh/@hattip/[email protected][8/9] Using latest: https://esm.sh/@hattip/[email protected][9/9] Looking for releases: https://esm.sh/@hattip/[email protected][9/9] Using latest: https://esm.sh/@hattip/[email protected]
/home/runner/work/deno-http-middleware/deno-http-middleware/deps.ts
[1/9] Looking for releases: https://deno.land/[email protected]/testing/asserts.ts[1/9] Using latest: https://deno.land/[email protected]/testing/asserts.ts[2/9] Looking for releases: https://deno.land/[email protected]/encoding/hex.ts[2/9] Using latest: https://deno.land/[email protected]/encoding/hex.ts[3/9] Looking for releases: https://deno.land/[email protected]/testing/asserts.ts[3/9] Using latest: https://deno.land/[email protected]/testing/asserts.ts[4/9] Looking for releases: https://deno.land/x/[email protected]/mod.ts[4/9] Using latest: https://deno.land/x/[email protected]/mod.ts[5/9] Looking for releases: https://deno.land/[email protected]/http/http_status.ts[5/9] Using latest: https://deno.land/[email protected]/http/http_status.ts[6/9] Looking for releases: https://cdn.skypack.dev/[email protected]/isPlainObject?dts[6/9] Using latest: https://cdn.skypack.dev/[email protected]/isPlainObject?dts[7/9] Looking for releases: https://cdn.skypack.dev/[email protected]?dts[7/9] Skip updating: https://cdn.skypack.dev/[email protected]?dts[8/9] Looking for releases: https://esm.sh/@hattip/[email protected][8/9] Using latest: https://esm.sh/@hattip/[email protected][9/9] Looking for releases: https://esm.sh/@hattip/[email protected][9/9] Using latest: https://esm.sh/@hattip/[email protected]
/home/runner/work/deno-http-middleware/deno-http-middleware/middleware.ts

/home/runner/work/deno-http-middleware/deno-http-middleware/mod.ts

/home/runner/work/deno-http-middleware/deno-http-middleware/body/bodyToBlob.ts

/home/runner/work/deno-http-middleware/deno-http-middleware/body/bodyToBuffer.ts

/home/runner/work/deno-http-middleware/deno-http-middleware/src/response_builder.ts

/home/runner/work/deno-http-middleware/deno-http-middleware/src/test.ts
[1/1] Looking for releases: https://deno.land/[email protected]/testing/asserts.ts[1/1] Attempting update: https://deno.land/[email protected]/testing/asserts.ts -> 0.177.1[1/1] Update successful: https://deno.land/[email protected]/testing/asserts.ts -> 0.177.1
/home/runner/work/deno-http-middleware/deno-http-middleware/test/error_notfound.test.ts

/home/runner/work/deno-http-middleware/deno-http-middleware/test/etag-conditional_get.test.ts

/home/runner/work/deno-http-middleware/deno-http-middleware/test/etag-hash.test.ts

/home/runner/work/deno-http-middleware/deno-http-middleware/test/hello-world-logger-cors_all_get-sequence.test.ts

/home/runner/work/deno-http-middleware/deno-http-middleware/test/json_builder-logger.test.ts

/home/runner/work/deno-http-middleware/deno-http-middleware/test/koa-like-hello-world-logger-sequence.test.ts

/home/runner/work/deno-http-middleware/deno-http-middleware/test/method_override.test.ts

/home/runner/work/deno-http-middleware/deno-http-middleware/test/remote-response-mutable-headers-stream-etag.test.ts

/home/runner/work/deno-http-middleware/deno-http-middleware/test/request_to_options.test.ts

/home/runner/work/deno-http-middleware/deno-http-middleware/test/stream-etag.test.ts

/home/runner/work/deno-http-middleware/deno-http-middleware/utils/ReadableStreamSmallerThanLimitToBuffer.ts

/home/runner/work/deno-http-middleware/deno-http-middleware/utils/concatArrayBuffer.ts

/home/runner/work/deno-http-middleware/deno-http-middleware/deno.json
[1/1] Looking for releases: https://deno.land/x/[email protected]/main.ts [1/1] Using latest: https://deno.land/x/[email protected]/main.ts 
/home/runner/work/deno-http-middleware/deno-http-middleware/import_map.json

Already latest version:
https://deno.land/x/[email protected]/mod.ts == 1.0.6
https://cdn.skypack.dev/[email protected][7](https://github.com/masx200/deno-http-middleware/actions/runs/5100475204/jobs/9168776153#step:5:8).21/isPlainObject?dts == 4.17.21
https://cdn.skypack.dev/[email protected]?dts == 0.5.2?dts
https://esm.sh/@hattip/[email protected] == 0.0.34
https://esm.sh/@hattip/[email protected] == 0.0.34
https://deno.land/[email protected]/testing/asserts.ts == 0.177.1
https://deno.land/[email protected]/encoding/hex.ts == 0.177.1
https://deno.land/[email protected]/testing/asserts.ts == 0.177.1
https://deno.land/x/[email protected]/mod.ts == 1.0.6
https://deno.land/[email protected]/http/http_status.ts == 0.177.1
https://cdn.skypack.dev/[email protected]/isPlainObject?dts == 4.17.21
https://cdn.skypack.dev/[email protected]?dts == 0.5.2?dts
https://esm.sh/@hattip/[email protected] == 0.0.34
https://esm.sh/@hattip/[email protected] == 0.0.34
https://deno.land/x/udd@0.[8](https://github.com/masx200/deno-http-middleware/actions/runs/5100475204/jobs/9168776153#step:5:9).2/main.ts  == 0.8.2

Successfully updated:
https://deno.land/[email protected][9](https://github.com/masx200/deno-http-middleware/actions/runs/5100475204/jobs/9168776153#step:5:10).0/testing/asserts.ts 0.189.0 -> 0.[17](https://github.com/masx200/deno-http-middleware/actions/runs/5100475204/jobs/9168776153#step:5:18)7.1
https://deno.land/std@0.[18](https://github.com/masx200/deno-http-middleware/actions/runs/5100475204/jobs/9168776153#step:5:19)9.0/encoding/hex.ts 0.189.0 -> 0.177.1
https://deno.land/[email protected]/testing/asserts.ts 0.189.0 -> 0.177.1
https://deno.land/[email protected]/http/http_status.ts 0.189.0 -> 0.177.1
https://deno.land/[email protected]/testing/asserts.ts 0.189.0 -> 0.177.1

Add --exclude or --ignore flag

This would allow users to easily ignore certain file patterns, such as udd *.ts *.md --ignore README.md once glob support is added.

Warning using std versions prefixed with "v"

Hi.
I see this tool prefixes the deno std packages version with a "v", so for example, this:

import { dirname } from "https://deno.land/[email protected]/path/mod.ts";

is converted to this:

import { dirname } from "https://deno.land/[email protected]/path/mod.ts";

After the update, I'm getting the following error:

Warning std versions prefixed with 'v' will be deprecated on October 1st 2020. Please change your import to https://deno.land/[email protected]/path/mod.ts (at https://deno.land/[email protected]/path/mod.ts)

I suggest to change this before it's deprecated.

generalized format for package updates [Enhancement]

I guess one of the core concepts of deno is being decentralized, and being restricted to

https://deno.land/std
https://deno.land/x
https://denopkg.com
https://dev.jspm.io
https://cdn.pika.dev
https://unpkg.com

Isn't good, cause people might want to use other domains - or perhaps their own domain,
so like what could help would be a generalized update check format, i.e. if something like,

https://deno.land/std@versions could return all the versions in a json format, i.e.

returning something like

{
    "versions": ["0.0.1", "1.0.0", "1.0.1", "1.1.0", "2.0", "2.6.9"],
    "deprecated": ["1.*"],
    "fatal-risk-of-use": ["<1.0.0"],
    "dog-person-wrote-code": false,
    "cat-person-wrote-code": true
}

Use recent deno-version in ci ( .github/ )

It'd be good to have some kind of bumper for the version as an action, like we do for udd.yaml (it can be simpler as no CI needs to run - will have to be manually started as auto-commits that affect .github/ files don't run in ci, but that's okay).

Updated in #72 but would be good to script it somehow. (Should be a straightforward GitHub action.)

Add example udd.yaml for GitHub actions to automate pull-request

@UltiRequiem put together this script to automates dependency updates. I think it would be really nice to include/publicize it in the udd repo:

https://github.com/UltiRequiem/deno_template/blob/main/.github/workflows/uud.yaml

name: Dependencies

on:
  workflow_dispatch:
  schedule:
    - cron: "0 0 * * *"

jobs:
  udd:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - uses: denoland/setup-deno@v1
      - name: Update dependencies
        run: >
          deno run -A https://deno.land/x/udd/main.ts
          $(find . -name "*.ts") --test="deno test -Ar"
      - name: Create Pull Request
        uses: peter-evans/create-pull-request@v3
        with:
          commit-message: ":arrow_up: Update Dependencies"
          title: Update Deno Dependencies
          body: >
            Dependencies updates using [deno-udd](https://github.com/hayd/deno-udd).
          branch: update-deno-dependencies
          author: GitHub <[email protected]>
          delete-branch: true

Questions:
What happens if re-run and no merge since PR opened (does it update the PR or create a new one)?
Is the $(find . -name "*.ts") reasonable (Should this be better supported in udd itself?) ?

Note: IIRC GitHub recommends not using 0 0 to avoid everyone using 0 0 😆 .

But overall this is really nice, thanks @UltiRequiem!

Feature request: updating Deno version in GitHub actions

Huge fan of this project!

Was wondering if you'd consider extending its functionality to cover Deno version text in non-TS files (in particular GitHub actions).

name: Test
on:
  pull_request:
    branches:
      - "*"
jobs:
  test:
    name: Test
    strategy:
      matrix:
        os: [ubuntu-20.04, macos-11.0, windows-2019]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - uses: denoland/setup-deno@main
        with:
          deno-version: v1.17.1 # <--
      - run: scripts/test.ts

I'd understand if this is out of scope, as there's no generalized & obvious way to identify some version text as a Deno version. Perhaps it could apply––at first––only to denoland/setup-deno jobs.

Thank you for your consideration!

Weird suffix when using import_map.json

#^ is being added to the end of the URL (removed from its location after @)

Successfully updated:
https://deno.land/x/fresh@^1.0.2/ ^1.0.2 -> 1.0.2#^
https://esm.sh/preact@^10.10.0 ^10.10.0 -> 10.10.6#^
https://esm.sh/preact@^10.10.0/ ^10.10.0 -> 10.10.6#^
https://esm.sh/twind@^0.16.17 ^0.16.17 -> 0.16.17#^
https://esm.sh/twind@^0.16.17/ ^0.16.17 -> 0.16.17#^

import_map.json

{
  "imports": {
    "$fresh/": "https://deno.land/x/[email protected]/#^",
    "preact": "https://esm.sh/[email protected]/#^",
    "preact/": "https://esm.sh/[email protected]/#^/",
    "preact-render-to-string": "https://esm.sh/preact-render-to-string@^5.2.1?external=preact",
    "@twind": "./utils/twind.ts",
    "twind": "https://esm.sh/[email protected]/#^",
    "twind/": "https://esm.sh/[email protected]/#^/"
  }
}

Wildcards not working

In readme it says I can use wildcards to update all files in a directory.

deno-udd/README.md

Lines 41 to 45 in d8402fb

To update all the ts files in your directory:
```sh
udd *.ts
```

However this doesn't quite work for me on Deno 1.18.0

Warning Implicitly using latest version (0.7.1) for https://deno.land/x/udd/main.ts
*.ts
error: Uncaught (in promise) Error: The filename, directory name, or volume label syntax is incorrect. (os error 123), open '*.ts'
    return decoder.decode(await Deno.readFile(this.filename));
                          ^
    at async open (deno:runtime/js/40_files.js:51:17)
    at async Object.readFile (deno:runtime/js/40_read_file.js:25:18)
    at async Udd.content (https://deno.land/x/[email protected]/mod.ts:56:27)
    at async Udd.run (https://deno.land/x/[email protected]/mod.ts:60:29)
    at async udd (https://deno.land/x/[email protected]/mod.ts:14:10)
    at async main (https://deno.land/x/[email protected]/main.ts:135:21)
    at async https://deno.land/x/[email protected]/main.ts:175:3
The terminal process "C:\Users\Xeevis\.dev\deno.EXE 'run', '--allow-read', '--allow-write', '--allow-net', '--reload', '--quiet', 'https://deno.land/x/udd/main.ts', '--dry-run', '*.ts'" terminated with exit code: 1.

Incorrectly upgrade the version number to "undefined"

udd 0.8.2

deno-version: v1.29.1

Incorrectly upgrade the version number to "undefined"

deps.ts

export type { ConnInfo };
export { STATUS_TEXT } from "https://deno.land/[email protected]/http/http_status.ts";
export { encode };
export { default as isPlainObject } from "https://cdn.skypack.dev/[email protected]/isPlainObject?dts";
export { default as isPlainObject } from "https://cdn.skypack.dev/lodash@undefined/isPlainObject?dts";

export { default as fresh } from "https://cdn.skypack.dev/[email protected]?dts";
export { serve };
export { assertFalse };
export { METHODS };
export { html, json, text } from "https://esm.sh/@hattip/[email protected]";
export { html, json, text } from "https://esm.sh/@hattip/response@undefined";

Breaks on Deno 1.13

➜ udd ./**/*.ts
error: Found argument '--allow-plugin' which wasn't expected, or isn't valid in this context
        Did you mean --allow-run?

USAGE:
    deno run <SCRIPT_ARG>... --allow-env=<allow-env> --allow-net=<allow-net> --allow-read=<allow-read> --allow-run=<allow-run> --allow-write=<allow-write>

For more information try --help

Getting syntax error

I'm getting the following syntax error when running on the files from:

https://github.com/fhsinchy/deno-blog

find . -name "*.ts" -exec udd {} ;
./routes/blogs.ts
./routes/home.ts
./routes/auth.ts
./tests/version.test.ts
./db/mysql.ts
./helpers/between.ts
./controllers/blogs.ts
./controllers/auth.ts
./middleware/logger.ts
./middleware/authorize.ts
./middleware/timer.ts
./middleware/error.ts
./app.ts
./models/User.ts
./models/Blog.ts
./bin/server.ts
./deps.ts
[1/6] Looking for releases: https://deno.land/x/[email protected]/mod.tserror: Uncaught SyntaxError: Unexpected token : in JSON at position 3
at JSON.parse ()
at Response.json ($deno$/web/body.ts:183:17)
at async DenoLand.all (https://deno.land/x/[email protected]/registry.ts:109:20)
at async Udd.update (https://deno.land/x/[email protected]/mod.ts:82:22)
at async Udd.run (https://deno.land/x/[email protected]/mod.ts:69:22)
at async udd (https://deno.land/x/[email protected]/mod.ts:14:10)
at async main (https://deno.land/x/[email protected]/main.ts:84:21)
at async https://deno.land/x/[email protected]/main.ts:124:3
./debug_deno.ts
[1/1] Using latest: https://deno.land/[email protected]/path/posix.ts
Already latest version:
https://deno.land/[email protected]/path/posix.ts == v0.62.0

Crashes on URLs in docs

I have a file that contains JSDoc for a library. udd cannot operate on the file, as it tries to analyse the docs.

[1/1] Looking for releases: https://deno.land/x/redis) library.
   * @description The type of storage to use for keeping track of users and their requests.
   */
  storageClient?: error: Uncaught (in promise) Error: error getting versions for redis) library.
   * 
      throw new Error(`error getting versions for ${name}`);
            ^
    at DenoLand.all (https://deno.land/x/[email protected]/registry.ts:130:13)
    at async Udd.update (https://deno.land/x/[email protected]/mod.ts:83:22)
    at async Udd.run (https://deno.land/x/[email protected]/mod.ts:70:22)
    at async udd (https://deno.land/x/[email protected]/mod.ts:14:10)
    at async main (https://deno.land/x/[email protected]/main.ts:84:21)
    at async https://deno.land/x/[email protected]/main.ts:124:3

[bug/feat] deno.lock support

After Deno 1.18.0 release, I discovered Deno created a file called deno.lock, I think it's similar to NPM lockfile.
Udd bug is that dependencies update seems not to handle (ex. edit, create) the file, which I is kept intact (or not created) after update.

A workaround I found is to update deps with Udd, then remove the lockfile (if present) and run the project. This makes sure Deno automatically creates this file.

Would be great and fair if Udd updates automatically all dependencies on lockfile, too, with all hashes.

Early issues

  • Add --help
  • exit with code 1 if not args passed
  • only show test stdout+stderr if the test fails (?)
  • show number [1/N] on output for each url that's being updated
  • cache the owner/repo versions (so it's not re-requested if multiple std urls are used)
  • make output more concise
  • use logger and support -q and -v verbosity flags
  • tests for update.ts
  • add more registries e.g. raw.github

Future: interactive (choose which version, retry/continue etc.), semver handling, lock creation, custom domains (pass ts file that export defaults your own Registry/Versioned class and udd dynamically imports it and appends it to IMPLS/REGISTRIES), more flags...

warn/fix sha or non-versioned urls

At the moment udd skips them as they don't match the regex. There should be an optional conversion of no release to latest release.

Note: should also complain if no releases of a dependency. (Not sure what happens currently).

Support for `npm:` imports

Now that Deno supports NPM modules with npm:module-name@version, it would be great to have support in udd.

Support --upgrade to the specified name

If you install udd as foo (deno install -n foo ...) then the --upgrade should update foo not udd.

deno-udd/main.ts

Lines 85 to 86 in 862c789

// TODO support alternative name to udd if that's what's been used before.
await spawn([Deno.execPath(), "install", "--reload", "-qAfn", "udd", url]);

This should be straightforward... but I'm not sure how we access the name used.

Support "custom" registries

I think a way to do this is for each registry to be its own file and have it export default.
This will be a little verbose but would allows a user to pass a file whose default export registry could be used.

Browser support [Enhancement]

I think deno-udd can be modified to support modern browsers with es-module support, this is useful as then people can use this for their browser apps

Disable React next versions

Hi. When I run udd to update my dependencies, it always update the react version to the "next" version:

https://esm.sh/[email protected] 18.1.0 -> 18.2.0-next-e531a4a62-20220505

I guess this is a bug because I would expect to update always to the latest stable version. The other development versions should be ignored.

imaxe

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.