profile
viewpoint
Mark Tiedemann MarkTiedemann E.ON Hamburg, Germany https://marksweb.site

PR opened JulianEggers/DarkMode

Fix some strings
+2 -2

0 comment

1 changed file

pr created time in a day

create barnchMarkTiedemann/DarkMode

branch : fix-text

created branch time in a day

push eventMarkTiedemann/DarkMode

Mark Tiedemann

commit sha 9d68959412454a1753c931835ed86d5a69f224ff

Update text

view details

Julian Eggers

commit sha 3b03d263fabf9f34b1e59190143ba8f509d51822

Merge pull request #1 from MarkTiedemann/update-text Update text

view details

Julian Eggers

commit sha 92055e9307f42ffb07caab6762adb7650d1929cf

Update gradle

view details

Julian Eggers

commit sha ac9875f1b778410e2d94d2cd6f4cdade5756f5cb

Merge branch 'master' of https://github.com/JulianEggers/DarkMode

view details

Julian Eggers

commit sha ac8099c5bb8ae120f8ae3ffa298bc3a51a77bcde

Fix apostrophe error

view details

Julian Eggers

commit sha ff60ff725cf11b0ef168e666387e205684192740

Replace maps screenshot with generic example layout + Add error message if changing mode failed

view details

Julian Eggers

commit sha 5eff641223df64b46bc24b7cae7160320894b049

Improve error color

view details

Julian Eggers

commit sha ae6402dbb4d724d92049d951a7821748b0fe9e3c

Mirate to use of ViewModel

view details

Julian Eggers

commit sha d9fae967ed8dc0cfe7bca0ebce04739f23f761dc

Update gitignore

view details

Julian Eggers

commit sha 5cd9999f95b6c34553f1982a2ea17770015b2bb4

Update settings instruction + update go to settings logic

view details

Julian Eggers

commit sha 80820225173f11df2d7932c0a031f653849d3d92

Release 1.1 (2)

view details

push time in a day

startedmaebert/themostdangerouswritingapp

started time in 3 days

push eventangular-hamburg/react.angular.hamburg

Mark Tiedemann

commit sha 33992ddaf74c409bceae7ce757370ee747259aca

Update team, hosts, sponsors

view details

push time in 3 days

push eventangular-hamburg/react.angular.hamburg

Mark Tiedemann

commit sha 59af4265a3a7f23df1dc0b39be320e4112c73adb

Update team and sponsors; Misc changes

view details

push time in 3 days

push eventMarkTiedemann/DarkMode

Mark Tiedemann

commit sha 9d68959412454a1753c931835ed86d5a69f224ff

Update text

view details

push time in 7 days

push eventMarkTiedemann/DarkMode

Mark Tiedemann

commit sha da80b4361642ada69225abd37c475b8eec7a7457

Update text

view details

push time in 7 days

push eventMarkTiedemann/DarkMode

Mark Tiedemann

commit sha baceb81ba9768cab688597faceec7c3fa126d759

Update text

view details

push time in 7 days

startedJulianEggers/DarkMode

started time in 7 days

PR opened JulianEggers/DarkMode

Update text
+3 -3

0 comment

1 changed file

pr created time in 7 days

create barnchMarkTiedemann/DarkMode

branch : update-text

created branch time in 7 days

fork MarkTiedemann/DarkMode

Android App for activating the on some devices hidden android internal dark mode.

fork in 7 days

startedasync-rs/async-std

started time in 8 days

Pull request review commentdenoland/deno_std

JSDOM port

+import { jsdom as instance } from "./vendor/jsdom.js";+import { jsdom } from "./types/jsdom.ts";++export const JSDOM = instance.JSDOM as jsdom.JSDOM;

@kitsonk, awesome! As soon as https://github.com/denoland/deno/pull/2746 is released, I will update the types here.

MarkTiedemann

comment created time in 8 days

Pull request review commentdenoland/deno_std

JSDOM port

+import { jsdom as instance } from "./vendor/jsdom.js";+import { jsdom } from "./types/jsdom.ts";++export const JSDOM = instance.JSDOM as jsdom.JSDOM;

No worries, @j-f1.

I just tried again, with the same code, and got a different error:

$ deno test.ts
Compile file:///Users/marktiedemann/dev/deno_std/jsdom/mod.ts

error TS2300: Duplicate identifier 'JSDOM'.

► file:///Users/marktiedemann/dev/deno_std/jsdom/mod.ts:1:19

1 export { jsdom as JSDOM } from "./vendor/jsdom.js";
                    ~~~~~

error TS2300: Duplicate identifier 'JSDOM'.

► file:///Users/marktiedemann/dev/deno_std/jsdom/mod.ts:2:19

2 export { jsdom as JSDOM } from "./types/jsdom.ts";
                    ~~~~~


Found 2 errors.

This seems like a more expected error, still unfortunate.

MarkTiedemann

comment created time in 11 days

Pull request review commentdenoland/deno_std

JSDOM port

+import { jsdom as instance } from "./vendor/jsdom.js";+import { jsdom } from "./types/jsdom.ts";++export const JSDOM = instance.JSDOM as jsdom.JSDOM;

Thanks for the suggestion, @j-f1. Unfortunately, this doesn't work on my machine. When I change it, JSDOM can't be imported anymore.

$ deno test.ts
Compile file:///Users/marktiedemann/dev/deno_std/jsdom/mod.ts
error: Uncaught SyntaxError: The requested module './mod.ts' does not provide an export named 'JSDOM'
MarkTiedemann

comment created time in 12 days

startedsvg/svgo

started time in 12 days

startedsharkdp/insect

started time in 14 days

push eventMarkTiedemann/fullscreen

Mark Tiedemann

commit sha 79ca98679756ad46105c557f597e8a40f4777a26

Add publish info

view details

push time in 15 days

push eventMarkTiedemann/fullscreen

Mark Tiedemann

commit sha f9871454bbfc8cdc30e7a6deb8ec9a485996f09b

Add Makefile

view details

push time in 15 days

push eventMarkTiedemann/fullscreen

Mark Tiedemann

commit sha 94cb01a65af3113a77c4ed227f614b611a03f0c8

Initial commit

view details

push time in 15 days

create barnchMarkTiedemann/fullscreen

branch : master

created branch time in 15 days

created repositoryMarkTiedemann/fullscreen

Browser extension for toggling fullscreen on any website.

created time in 15 days

startedfunkia/list

started time in 21 days

startedsaghul/qjsuv

started time in 21 days

pull request commentOctoLinker/OctoLinker

Support JavaScript URL imports

Is this ready to be merged yet, @stefanbuck? Or is there anything I still need to do?

MarkTiedemann

comment created time in 22 days

pull request commentOctoLinker/OctoLinker

Support JavaScript URL imports

Anyway, all good now.

Awesome! Thank you for fixing the snapshots!

I'm less worried about the size since it's a browser extensions

True.

I think a better reason for using new URL() rather than is-url is that it's a standard rather than just some NPM package. So, in theory, it should be easier to understand and maintain this code.

As mentioned earlier, this does not 100% match the spec since it also link just a domain, but that's fine in my opinion.

I agree, that's fine.

Again, thanks a lot!

MarkTiedemann

comment created time in 22 days

pull request commentOctoLinker/OctoLinker

Support JavaScript URL imports

Mhhh still failing 😕 The latest master is passing so something must be odd with this branch. I'll give it another try tomorrow.

That is weird indeed. At the weekend, I would have time to debug as well.

The other is using is-url which also enabled to fix the other test.

I think using is-url is fine, but I'd prefer new URL() so we can ship less code (with 94%, browser support is pretty good).

MarkTiedemann

comment created time in 23 days

pull request commentOctoLinker/OctoLinker

Support JavaScript URL imports

I added 1 simple e2e test - I hope that's fine.

MarkTiedemann

comment created time in 24 days

push eventMarkTiedemann/OctoLinker

Mark Tiedemann

commit sha 088a6ed1012cd8d5b7fe4f6e94a639c584580b15

Support JavaScript URL imports

view details

push time in 24 days

pull request commentOctoLinker/OctoLinker

Support JavaScript URL imports

I deleted the snapshot file, then re-ran yarn test - but there's no diff. Am I missing anything on how snapshots work? I don't have any experience with them.

MarkTiedemann

comment created time in 24 days

startedjedisct1/minisign

started time in 24 days

pull request commentOctoLinker/OctoLinker

Support JavaScript URL imports

Anyway, maybe best to just revert the snapshot change which solved the issue for me.

Sure, will do.

do you mind to add an End2End test or two for this change

No, I didn't know you had e2e tests. Will add some tomorrow!

but apart from that this looks good to me.

Awesome. :)

MarkTiedemann

comment created time in 24 days

Pull request review commentOctoLinker/OctoLinker

Support JavaScript URL imports

 describe('javascript-universal', () => {     });   }); +  it("resolves 'https://example.org/foo.ts' to 'https://example.org/foo.ts'", () => {+    expect(plugin.resolve(path, ['https://example.org/foo.ts'])).toEqual({+      target: 'https://example.org/foo.ts',+      type: 'trusted-url',+    });+  });++  it("does not resolve 'https://example.org/'", () => {+    // TODO: Currently resolves incorrectly as 'https' module,+    // but should not resolve.

Not sure how to fix this. ^

MarkTiedemann

comment created time in 24 days

Pull request review commentOctoLinker/OctoLinker

Support JavaScript URL imports

 export function javascriptFile({ path, target }) {   }); } +function isURLImport(target) {+  try {+    const { protocol, pathname } = new URL(target);+    if (protocol !== 'https:' && protocol !== 'http:') return false;+    const ext = extname(pathname);+    if (ext !== '.js' && ext !== '.ts') return false;+    return true;+  } catch (err) {+    return false;+  }+}

I think checking for :http(s) as the protocol and .{js,ts} as the extension is pretty much the bare minimum of checks that need / should be done here. For example, new URL("a:b") is a valid URL (protocol a:, path b).

MarkTiedemann

comment created time in 24 days

pull request commentOctoLinker/OctoLinker

Support JavaScript URL imports

Not sure what's wrong with the snapshots. Can you take a look, @stefanbuck?

MarkTiedemann

comment created time in 24 days

push eventMarkTiedemann/OctoLinker

Mark Tiedemann

commit sha 16d28c6be5c2baab71ab2ed4b05d55365ad91e7c

Support JavaScript URL imports

view details

push time in 24 days

push eventMarkTiedemann/OctoLinker

Mark Tiedemann

commit sha 5130b09cff5986bab220d275ccd1407f611449a9

Support JavaScript URL imports

view details

push time in 24 days

PR opened OctoLinker/OctoLinker

Support JavaScript URL imports

See: https://github.com/OctoLinker/OctoLinker/issues/613

Looking for feedback, @stefanbuck.

+41 -3

0 comment

3 changed files

pr created time in 24 days

create barnchMarkTiedemann/OctoLinker

branch : support-url-imports

created branch time in 24 days

pull request commentdenoland/deno_std

Revert "http: delete conn parameter in readRequest (#430)"

Is this PR still relevant?

Yes, the WS module is still broken as described in #441.

ry

comment created time in a month

pull request commentdenoland/deno_std

[http] Handle aborted http Requests

Yes, I think this is fixed, but not yet released.

zekth

comment created time in a month

issue commentOctoLinker/OctoLinker

Deno support

Okay, sure. I'll take a stab at implementing this feature in the next few days.

MarkTiedemann

comment created time in a month

fork MarkTiedemann/OctoLinker

OctoLinker — Links together, what belongs together

https://octolinker.now.sh

fork in a month

issue commentdenoland/deno_install

Unable to access https://deno.land from server with only IPv6

curl -fsSL --ipv6 https://deno.land/x/install/install.sh works on my machine. Might be a proxy or firewall issue, but I doubt it's related to deno.land.

josephrocca

comment created time in a month

push eventMarkTiedemann/deno_std

Mark Tiedemann

commit sha cbffa8ff7d64431d998d03504c3b93221bca5630

Rename module file mod.ts

view details

push time in a month

pull request commentdenoland/deno_std

JSDOM port

I think this is ready to be reviewed now, @ry.

One major painpoint, I guess, is that the DOM and JSDOM types are still preliminary. There are also some other future TODOs, for example, investigating whether the bundle size can be improved, testing more of JSDOM's functionality, and rewriting/wrapping some Node specific-parts in JSDOM (for example, JSDOM.fromURL and JSDOM.fromFile both use built-in Node modules). But I think these can be tackled in future PRs.

MarkTiedemann

comment created time in a month

push eventMarkTiedemann/deno_std

Mark Tiedemann

commit sha a3dd252682d0ab16adb94219dec8082d76590cb4

Add docs

view details

push time in a month

push eventMarkTiedemann/deno_std

Mark Tiedemann

commit sha 8e4996a9fb85c07beda9dd4c16b319b90372ea47

Fix lint

view details

push time in a month

push eventMarkTiedemann/deno_std

Mark Tiedemann

commit sha 68c2d7d4c5875f8d7edd67dae957427d884ab47d

Misc changes

view details

push time in a month

fork MarkTiedemann/TypeScript

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

https://www.typescriptlang.org

fork in a month

startedoilshell/oil

started time in a month

Pull request review commentdenoland/deno_std

WIP: JSDOM port

+import "./vendor/jsdom.js";++// TODO: Investigate how to reuse typings from:+// - https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/jsdom/index.d.ts+// - https://github.com/microsoft/TypeScript/blob/master/lib/lib.dom.d.ts

Ah, too bad. I guess I will add some preliminary types for now, and we can improve them later, once .d.ts files are supported.

MarkTiedemann

comment created time in a month

push eventMarkTiedemann/deno_std

Mark Tiedemann

commit sha 550a2323848620de447a945e6646be49139eb3cd

Fix more linting issues

view details

push time in a month

push eventMarkTiedemann/deno_std

Mark Tiedemann

commit sha 6ec861dba347c3b5c637929a8bbcfbae8add396a

Try fix lint

view details

push time in a month

Pull request review commentdenoland/deno_std

WIP: JSDOM port

+import "./vendor/jsdom.js";++// TODO: Investigate how to reuse typings from:+// - https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/jsdom/index.d.ts+// - https://github.com/microsoft/TypeScript/blob/master/lib/lib.dom.d.ts

@kitsonk Any idea on how to reuse these types here?

MarkTiedemann

comment created time in a month

Pull request review commentdenoland/deno_std

WIP: JSDOM port

+{+  "scripts": {+    "vendor": "webpack-cli"+  },+  "devDependencies": {+    "jsdom": "15.1.1",+    "webpack": "4.36.1",+    "webpack-cli": "3.3.6"+  }+}

I added the package.json so you can reproduce building the vendor bundle.

Is this a good approach, @ry?

Might be something we can do for //deno_std/prettier, too.

MarkTiedemann

comment created time in a month

Pull request review commentdenoland/deno_std

WIP: JSDOM port

+import "./vendor/jsdom.js";++let JSDOM = (window as any).jsdom.JSDOM;+let dom = new JSDOM(`+  <!DOCTYPE html>+  <p>Hello, Deno!</p>+`);

3.05 MiB

I added a TODO for investigating whether we can reduce this size.

MarkTiedemann

comment created time in a month

push eventMarkTiedemann/deno_std

Mark Tiedemann

commit sha 38ec8d26f55c137b8be3cf777b527130a581de6c

Misc changes

view details

push time in a month

PR opened denoland/deno_std

WIP: JSDOM port

Closes https://github.com/denoland/deno_std/issues/537.

$ cd jsdom
$ npm install --no-package-lock webpack@4.36.1 webpack-cli@3.3.6 jsdom@15.1.1
$ ./node_modules/.bin/webpack-cli
Hash: 80cb94c06fc1cfb9a48b
Version: webpack 4.36.1
Time: 2422ms
Built at: 07/20/2019 11:51:39 PM
     Asset      Size  Chunks                    Chunk Names
./jsdom.js  3.05 MiB       0  [emitted]  [big]  main
Entrypoint main [big] = ./jsdom.js
 [17] (webpack)/buildin/global.js 472 bytes {0} [built]
[108] (webpack)/buildin/module.js 497 bytes {0} [built]
[231] canvas (ignored) 15 bytes {0} [built]
[440] ./streams (ignored) 15 bytes {0} [built]
[441] ./extend-node (ignored) 15 bytes {0} [built]
[519] util (ignored) 15 bytes {0} [built]
[521] util (ignored) 15 bytes {0} [built]
[562] buffer (ignored) 15 bytes {0} [optional] [built]
[563] crypto (ignored) 15 bytes {0} [optional] [built]
[625] crypto (ignored) 15 bytes {0} [built]
    + 948 hidden modules
$ deno jsdom.ts
Compile file:///Users/marktiedemann/dev/deno_std/jsdom/jsdom.ts
Hello, Deno!

TODOs:

  • [ ] Vendor type definitions from @types/jsdom.
  • [ ] Add tests.
  • [ ] Write documentation.

Looking for feedback.

cc @ry

+646 -0

0 comment

4 changed files

pr created time in a month

create barnchMarkTiedemann/deno_std

branch : port-jsdom

created branch time in a month

push eventMarkTiedemann/deno_std

Kevin (Kun) "Kassimo" Qian

commit sha a0b5aec82397bf76d3e8348194536c2596292e65

path: remove export = module (#95)

view details

Ryan Dahl

commit sha 72b2e20f9da1d431ba9cac3247ee38ee82d5d8f4

Bump deno version to v0.2.6

view details

Yoshiya Hinosawa

commit sha 41a2d218264b2f9217bf793893aff5dadd2c4ca9

feat: print test status on the same line as test name (#100)

view details

木杉

commit sha 5be16ba5992b34a64d307779350b88b5cacbfa23

refactor(path): reorg (#101)

view details

Kitson Kelly

commit sha 92bbca8166d6566011aff0ef467a83433747a937

Reorg colors (#96)

view details

Kitson Kelly

commit sha 0e00fe9cd361165d28beb117cdf103ff8f9d3d8b

Add media_types collection (#97)

view details

Kwang-in (Dennis) Jung

commit sha 3656ab5b9937cc3fbdf1c9e0d1414fbf05e78240

Define type for available date format (#88)

view details

木杉

commit sha c42686dc36ba888137fe734c59318466f41d7dfa

style(net): format code (#104)

view details

木杉

commit sha 41312ad39fe77cee7dd2cc4b48308eebb45f870a

refactor(mkdirp): reorg (#103)

view details

Andy Hayden

commit sha c5e6e015b5be19027f60c19ca86283d12f9258f3

Reorgnanize repos, examples and tests (#105)

view details

hkdnet

commit sha 9f1de43cc47b0bee4d7d04a1b3ebc238333575bc

Remove an unnecessary code block (#107)

view details

Kitson Kelly

commit sha b99d7d3e0f61216db7b5a5ad2bc254f8ac97ff4d

Improve re-exports in http (#111)

view details

迷渡

commit sha 1d64eba63df97ec70910560140bd1a1b87763fa7

fix wrong links for flags (#112)

view details

Yungoo Kong

commit sha 39cfdb48a88527306e630b57eaa08ef42e38fb20

Fix wrong links (#106)

view details

Kitson Kelly

commit sha 77b3391a21fc823f891f85c854c2bc58f9ad298f

Fix media_types running under Deno with ESM (#113) And bump CI to v0.2.7

view details

Kwang-in (Dennis) Jung

commit sha 6c5bdc58bad12626152c5903e52c2457a5f81883

Improve http/README (#114)

view details

Ryan Dahl

commit sha 6a41189a98e29b0c233f12610220490b6deed608

Improve readme (#117)

view details

James Garbutt

commit sha 388bc47ea7569b97c1a729343970c3cdb376c668

colors: add test cases (#120)

view details

Kitson Kelly

commit sha 9a3eb207dcd1d032a3c3f7e60f8ee9c5e793f022

Improve assert (#124)

view details

James Garbutt

commit sha cc40d3e984993afd5e6cdc4acab71676a278e7af

datetime: correct hh:mm formats and add test cases (#121)

view details

push time in a month

issue commentOctoLinker/OctoLinker

Deno support

On another note, I believe that import { foo } from "https://example.org/bar.js"; is already supported in a <script type="module"> (see: https://jakearchibald.com/2017/es-modules-in-browsers/#bare-import-specifiers-arent-currently-supported). This isn't really a new invention by Deno but rather Deno trying to follow web standards.

MarkTiedemann

comment created time in a month

issue commentOctoLinker/OctoLinker

Deno support

Right, Deno compatible JavaScript or TypeScript files are not marked in any special way.

However, there are two distinctions here:

  • In Node, require("module") or require("./file") doesn't need an extension. In Deno, .js or .ts is mandatory.
  • Unlike in Deno, in Node, you cannot import from a URL, e.g. http://example.org/module.ts or https://example.org/module.ts.

So I guess, based on that, if a file with a proper extension is imported from a URL, instead of linking to the http or https NPM modules, you could link to the respective file instead.

But yeah, I'm not a 100% certain either.

MarkTiedemann

comment created time in a month

issue openedOctoLinker/OctoLinker

Deno support

import * as fs from "https://deno.land/std/fs/mod.ts";

..., for example, should link to https://deno.land/std/fs/mod.ts rather than https://www.npmjs.com/package/https.

created time in a month

issue closeddenolib/qs

vs. URLSearchParams

Deno already supports URLSearchParams which can be used to parse and stringify a query string.

$ deno
> new URLSearchParams("a=1&b=2")
URLSearchParams { params: [ [ "a", "1" ], [ "b", "2" ] ], url: null }
> q = new URLSearchParams(); q.set("a", 1); q.set("b", 2); q.toString()
a=1&b=2

So, is this module actually necessary? What does it do differently then URLSearchParams? How does it hold up in benchmarks? Could the module be re-written to use URLSearchParams internally?

closed time in a month

MarkTiedemann

issue commentdenolib/qs

vs. URLSearchParams

@kevinkassimo I think there are 2 arguments made in that issue.

  1. URLSearchParams is not supported in all browsers yet (92%), and a polyfill would increase bundle size. However, I don't think this argument applies to Deno - the polyfill isn't needed since Deno ships with URLSearchParams.

  2. Support for nesting, e.g. { a: 1, b: { c: 2 } } => a=1&b[c]=2, as a feature that URLSearchParams doesn't support.

Might be good to add a section to the README.md to clarify use-cases for qs vs. URLSearchParams.

MarkTiedemann

comment created time in a month

create barnchMarkTiedemann/about_building

branch : master

created branch time in a month

created repositoryMarkTiedemann/about_building

created time in a month

issue openeddenolib/qs

vs. URLSearchParams

Deno already supports URLSearchParams which can be used to parse and stringify a query string.

$ deno
> new URLSearchParams("a=1&b=2")
URLSearchParams { params: [ [ "a", "1" ], [ "b", "2" ] ], url: null }
> q = new URLSearchParams(); q.set("a", 1); q.set("b", 2); q.toString()
a=1&b=2

So, is this module actually necessary? What does it do differently then URLSearchParams? How does it hold up in benchmarks? Could the module be re-written to use URLSearchParams internally?

created time in a month

issue commentdenoland/deno_install

support chocolatey

Haven't used Chocolatey in years (ever since I learned about Scoop, which we already support...) so this isn't high priority to me.

@ry If you have any good reasons for why this is important, please let me know. I do have some free time coming up, so I might take a stab at creating the package in the next few days.

In any case, here's the documentation for creating a Chocolatey package:

  • CreatePackagesQuickStart: https://chocolatey.org/docs/create-packages-quick-start
  • CreatePackages: https://chocolatey.org/docs/create-packages

Unlike Scoop packages (e.g. deno.json), Chocolatey packages aren't updated automatically. So we'd have to do that as part of the Deno release process.

@ry You'll also need to register an account and manage the API key.

PS: To be completely honest, I don't think creating a Chocolatey package is worth it at this point...

ry

comment created time in a month

created tagMarkTiedemann/deno_test

tagv0.1.0

Convenience wrapper around Deno `std/testing`.

created time in a month

create barnchMarkTiedemann/deno_test

branch : master

created branch time in a month

created repositoryMarkTiedemann/deno_test

Convenience wrapper around Deno `std/testing`.

created time in a month

push eventMarkTiedemann/deno_html_colors

Mark Tiedemann

commit sha 05164afa734e30347655940027e1189e66e7e205

Update example import

view details

Mark Tiedemann

commit sha 17534cebbb5d584fd9f01a39561b7b35a42858fb

Refactor build process

view details

push time in a month

push eventMarkTiedemann/deno_intro

Mark Tiedemann

commit sha dd1506e28672ec8098b6824e9539334a58740361

Use html_colors module

view details

push time in a month

created tagMarkTiedemann/deno_html_colors

tagv1.0.0

List of HTML color names for Deno.

created time in a month

push eventMarkTiedemann/deno_html_colors

Mark Tiedemann

commit sha 2faa4959dcc41eabe7147bf3c95a0e197b48582a

Initial commit

view details

push time in a month

push eventMarkTiedemann/deno_html_colors

Mark Tiedemann

commit sha e3acf5d01d6bbc674b81527552ad1504e90b3bb2

Initial commit

view details

push time in a month

create barnchMarkTiedemann/deno_html_colors

branch : master

created branch time in a month

created repositoryMarkTiedemann/deno_html_colors

List of HTML color names for Deno.

created time in a month

pull request commentsindresorhus/tasklist

Stream interface, more flags and error handling

Ok, I've added the promise interface back.

Great, thank you!

and finally the TravisCI build allso passes

For some reason, GitHub is marking the CI as Queued — Build Created / yellow to me, whereas Travis shows the build as "passed" / green ... But yeah, the tests are passing. Also, run some tests on my personal Windows machine, just in case.

I asked for a few minor changes that you could clean-up, @sbencoding. And I'm not sure whether the streaming interface was implemented in a good way - that might be a few more changes.

Other than that, this is looking good to me.

Perhaps @sindresorhus should take a look as well. :)

sbencoding

comment created time in a month

Pull request review commentsindresorhus/tasklist

Stream interface, more flags and error handling

 module.exports = async (options = {}) => { 		} 	} -	const defaultHeaders = [-		'imageName',-		'pid',-		'sessionName',-		'sessionNumber',-		'memUsage'-	];--	const verboseHeaders = defaultHeaders.concat([-		'status',-		'username',-		'cpuTime',-		'windowTitle'-	]);+	let currentHeader;+	if (options.apps) {+		currentHeader = 'apps';+	} else if (options.modules !== undefined) {+		currentHeader = 'modules';+	} else if (options.services) {+		currentHeader = 'services';+	} else {+		currentHeader = 'default';+	} -	const headers = options.verbose ? verboseHeaders : defaultHeaders;+	if (options.verbose) {+		currentHeader += 'Verbose';+	} -	const {stdout} = await execFile('tasklist', args);+	const columns = csvHeaders[currentHeader];+	const currentTransform = transforms[currentHeader];+	return {args, columns, currentTransform};+} -	// Not start with `"` means no matching tasks. See #11.-	const data = stdout.startsWith('"') ? await neatCsv(stdout, {headers}) : [];+/**+ * Execute tasklist and return results through a stream+ * @param {Options} options The options of the command+ * @returns {Stream} Stream, returning parsed results+ */+function stream(options = {}) {+	const {args, columns, currentTransform} = main(options);+	const parser = csv.parse({columns});+	const pt = passThrough();+	const processOutput = childProcess.spawn('tasklist.exe', args).stdout;+	let outputChecked = false; -	return data.map(task => {-		// Normalize task props-		task.pid = Number(task.pid);-		task.sessionNumber = Number(task.sessionNumber);-		task.memUsage = Number(task.memUsage.replace(/[^\d]/g, '')) * 1024;+	processOutput.on('data', data => {

I'm not sure that this is a good way to implement the streaming. You're manually connecting your streams rather that .pipe'ing the data through them. I think that this means that, for example, once the returned stream is aborted, the other streams will continue to handle incoming tasklist data, rather than being aborted, too.

Haven't worked with Node streams in a few years, though, so I might be wrong.

@sindresorhus Any input on this?

sbencoding

comment created time in a month

Pull request review commentsindresorhus/tasklist

Stream interface, more flags and error handling

 module.exports = async (options = {}) => { 		} 	} -	const defaultHeaders = [-		'imageName',-		'pid',-		'sessionName',-		'sessionNumber',-		'memUsage'-	];--	const verboseHeaders = defaultHeaders.concat([-		'status',-		'username',-		'cpuTime',-		'windowTitle'-	]);+	let currentHeader;+	if (options.apps) {+		currentHeader = 'apps';+	} else if (options.modules !== undefined) {+		currentHeader = 'modules';+	} else if (options.services) {+		currentHeader = 'services';+	} else {+		currentHeader = 'default';+	} -	const headers = options.verbose ? verboseHeaders : defaultHeaders;+	if (options.verbose) {+		currentHeader += 'Verbose';+	} -	const {stdout} = await execFile('tasklist', args);+	const columns = csvHeaders[currentHeader];+	const currentTransform = transforms[currentHeader];+	return {args, columns, currentTransform};+} -	// Not start with `"` means no matching tasks. See #11.-	const data = stdout.startsWith('"') ? await neatCsv(stdout, {headers}) : [];+/**+ * Execute tasklist and return results through a stream+ * @param {Options} options The options of the command+ * @returns {Stream} Stream, returning parsed results+ */+function stream(options = {}) {

You called the other function promiseInterface. Perhaps rename to streamInterface? Or remove "interface" from both names?

sbencoding

comment created time in a month

Pull request review commentsindresorhus/tasklist

Stream interface, more flags and error handling

 module.exports = async (options = {}) => { 		} 	} -	const defaultHeaders = [-		'imageName',-		'pid',-		'sessionName',-		'sessionNumber',-		'memUsage'-	];--	const verboseHeaders = defaultHeaders.concat([-		'status',-		'username',-		'cpuTime',-		'windowTitle'-	]);+	let currentHeader;+	if (options.apps) {+		currentHeader = 'apps';+	} else if (options.modules !== undefined) {+		currentHeader = 'modules';+	} else if (options.services) {+		currentHeader = 'services';+	} else {+		currentHeader = 'default';+	} -	const headers = options.verbose ? verboseHeaders : defaultHeaders;+	if (options.verbose) {+		currentHeader += 'Verbose';+	} -	const {stdout} = await execFile('tasklist', args);+	const columns = csvHeaders[currentHeader];+	const currentTransform = transforms[currentHeader];+	return {args, columns, currentTransform};+} -	// Not start with `"` means no matching tasks. See #11.-	const data = stdout.startsWith('"') ? await neatCsv(stdout, {headers}) : [];+/**+ * Execute tasklist and return results through a stream+ * @param {Options} options The options of the command+ * @returns {Stream} Stream, returning parsed results+ */+function stream(options = {}) {+	const {args, columns, currentTransform} = main(options);+	const parser = csv.parse({columns});+	const pt = passThrough();+	const processOutput = childProcess.spawn('tasklist.exe', args).stdout;+	let outputChecked = false; -	return data.map(task => {-		// Normalize task props-		task.pid = Number(task.pid);-		task.sessionNumber = Number(task.sessionNumber);-		task.memUsage = Number(task.memUsage.replace(/[^\d]/g, '')) * 1024;+	processOutput.on('data', data => {+		if (!outputChecked) {+			outputChecked = true;+			// Check if result is empty+			if (!data.toString().startsWith('"')) {+				processOutput.end();+				pt.end();+				return;+			}+		} -		if (options.verbose) {-			task.cpuTime = sec(task.cpuTime);+		if (parser.writable) {+			parser.write(data); 		}+	});+	parser.on('readable', () => {+		let data;+		do {+			data = parser.read();+			if (data && pt.writable) {+				pt.write(currentTransform(data));+			} else {+				processOutput.end();+				break;+			}+		} while (data);+	}); -		return task;+	processOutput.on('end', () => {+		parser.end(); 	});-};+	parser.on('end', () => pt.end());+	parser.on('error', _ => pt.end());++	return pt;+}++/**+ * Execute tasklist and get normalized results from the output+ * @param {Options} options The options of the command+ * @returns {Promise<Array>} The parsed results+ */+async function promiseInterface(options = {}) {+	const {args, columns, currentTransform} = main(options);+	const {stdout} = await execFile('tasklist', args);
	const {stdout} = await execFile('tasklist.exe', args);

Like in L127.

sbencoding

comment created time in a month

push eventMarkTiedemann/deno_intro

Mark Tiedemann

commit sha 02f05269a133ef3be5af89d423e16cd9d74271ea

Refactor make.ts

view details

push time in a month

push eventMarkTiedemann/deno_intro

Mark Tiedemann

commit sha 9e7b6461e5670fa85d525be91d61aacc8e826e59

Misc changes

view details

push time in a month

push eventMarkTiedemann/deno_intro

Mark Tiedemann

commit sha 35e2d98606d22e6aef2872b841b857735dfdd897

Misc changes

view details

push time in a month

push eventMarkTiedemann/deno_intro

Mark Tiedemann

commit sha 2053303fec5e38608e6719bc6b3ee26ac661058c

Rewrite slide generation

view details

push time in a month

push eventMarkTiedemann/deno_intro

Mark Tiedemann

commit sha 02a8526890e25c5702f4c955d8bddde0ec64161b

Fix function syntax highlighting

view details

push time in a month

push eventMarkTiedemann/deno_intro

Mark Tiedemann

commit sha a4181f18e643511206b63e5f74e7b652f640df37

Fix indentation

view details

push time in a month

push eventMarkTiedemann/deno_intro

Mark Tiedemann

commit sha cf09cd2ecc4d3aaeaab96e7f9c93891c557fce9b

Rename misc dev tools

view details

push time in a month

push eventMarkTiedemann/deno_intro

Mark Tiedemann

commit sha 287a709c80c7d8ce486243662508ccb9daab4d91

Rename misc dev tools

view details

push time in a month

push eventMarkTiedemann/deno_intro

Mark Tiedemann

commit sha d9eb1f0241ec742d2b969dd1d2dcf84e0ffabfdc

Misc changes

view details

push time in a month

push eventMarkTiedemann/deno_intro

Mark Tiedemann

commit sha 2aa3136d23a1f5e64897dd8f460958ffbe8b5868

Misc changes

view details

push time in a month

push eventMarkTiedemann/deno_intro

Mark Tiedemann

commit sha b5fb1f7b95942951941994241c63b67bc7e152ba

Add feature web compat

view details

push time in a month

push eventMarkTiedemann/deno_intro

Mark Tiedemann

commit sha 28cab8f637505cf95d156fefc1174da889faa865

Add feature misc

view details

push time in a month

push eventMarkTiedemann/deno_intro

Mark Tiedemann

commit sha 5618f3d797492e1e39d68aa1506c14eaf7e6e85d

Add feature package management

view details

push time in a month

push eventMarkTiedemann/deno_intro

Mark Tiedemann

commit sha f33c8b884586c49cd60eadcc92cd8a0acfc96677

Add feature modules

view details

push time in a month

more