profile
viewpoint
Jürg Lehni lehni Switzerland http://juerglehni.com Works collaboratively across disciplines, dealing with the nuances between technology, tools and the human condition.

lehni/bootstrap.js 22

JavaScript Framework for Browsers, Servers and Anything in Between

helma-next/helma-next 10

Helma Next, next generation version of Helma.

lehni/boots 7

Boots CMS Framework for Helma Application Server, based on the Bootstrap JavaScript Framework

abstractmachine/ThinkingMachines 5

Thinking Machines is a semester project at the Media Design Master, HEAD – Genève, in which students will revisit the concept of “personal computers” in the age of neural networks and explore how the creation of personalised assistants can reshape their creative workflow.

lehni/babel-jest-nested 3

A modified version of babel-jest, adding support for .babelrc files in sub-folders

lehni/gulp-qunits 3

Run hybrid unit tests through QUnit in a headless PhantomJS instance, as well as directly in Node.js – Forked from https://github.com/jonkemp/gulp-qunit but developed as a separate project for use in http://paperjs.org.

lehni/jade.php 3

Jade template engine ported to PHP 5.3

lehni/gulp-git-streamed 2

A simple wrapper around gulp-git (Git plugin for gulp), making all commands return streams for better chainability.

lehni/gulp-whitespace 2

A simple gulp plugin that strips and converts white-space in text- and code- files.

lehni/helma-next 2

A modified version of Helma.org, as used by the Boots Framework.

issue commenttc39/proposal-decorators

Dynamically generated properties no longer possible?

Issue https://github.com/tc39/proposal-decorators/issues/342 shows one way to modify a class' shape to anything you want using the currently spec'd decorators.

matthewadams

comment created time in 2 hours

issue commenttc39/proposal-decorators

[idea] decorator for defining logic of one method across multiple definitions of a method (duplicate methods, and they all run)

This wouldn't change anything about how classes work. The various forms of the idea above are all syntax sugar, and would behave identical to this one:

class MyEl extends HTMLElement {
  featureA = new FeatureA
  featureB = new FeatureB
  featureC = new FeatureC

  connectedCallback() {
    this.featureA.run(this)
    this.featureB.run(this)
    this.featureC.run(this)
  }

  disconnectedCallback() {
    this.featureA.stop(this)
    this.featureB.stop(this)
    this.featureC.stop(this)
  }
}

But perhaps the idea isn't that useful enough to warrant introducing it. Maybe just breaking classes up into smaller classes is better.

trusktr

comment created time in 2 hours

issue commenttc39/proposal-decorators

decorator for hooking onto specific method call, without subclasses having to call `super.method()`.

I too suspect perhaps this is something for EXTENSIONS.md.

trusktr

comment created time in 2 hours

issue commenttc39/proposal-decorators

decorator for post-construction (after subclass constructors)

I want to leave this feature for a follow-on proposal.

Willing to take a PR for EXTENSIONS.md?

trusktr

comment created time in 2 hours

issue closedfoliojs/fontkit

Convert path.toSVG() output back to original text?

Hopefully I'm not overlooking something that's already been addressed, but given this scenario, what could i do in the second function to get the original character codes/original string from svg info?:

const fontkit = require('fontkit');
const font = fontkit.openSync(__dirname + '/font.ttf');

// Works great
const StringToSVG = string => {
  let run = font.layout(string)

  return run.glyphs.map(g => g.path.toSVG())
}

let svg = StringToSVG(string)


const SVGtoString = svg => {
  // What can i do with these SVG Paths?
}

let originalString = SVGtoString(svg)

// To get this output?
console.log(originalString)

closed time in 4 hours

rickybrown

issue commentpaperjs/paper.js

the method hitTest will return some non-existent Path

But in my project, i will addPath and CompoundPath at the same time in a Layer, so when i click the item , i don't kown it belong Path or CompoundPath, i can't use the class to only test for CompoundPaths, beasuce it will lose the Path item. Do we have any options which only test for the item(not the item which paperJs automatically added ,like CompoundPath 's children) that are added to the layer?

Terness

comment created time in 5 hours

issue commentfoliojs/fontkit

Convert path.toSVG() output back to original text?

You can't? Once you turn the text into outline vector graphics, you lose any relation to the original text. Unless you want to perform OCR of course. Instead, make your code remember which SVG belongs to which text and don't try to convert svg to text, but directly look up with text belongs to which svg path.

rickybrown

comment created time in 7 hours

startedrubena/telnet

started time in 7 hours

issue openedprettier/plugin-pug

dontWrapAttributesPattern

Request / Idea

Would it make sense to have a do not wrap regex pattern, similar to pugWrapAttributesPattern ? Possible use cases can be to match lines with irrelevant code that doesn't require much attention or repetitive. It could save space and produce more readable code.

For instance, if we had a dontWrapAttributesPattern:

v-img.shrink.mt-1.hidden-sm-and-down(
                    alt="Vuetify Name",
                    contain="",
                    min-width="100",
                    src="https://cdn.vuetifyjs.com/images/logos/vuetify-name-dark.png",
                    width="100"
                )
                
                input(name="my_name", type="text", value="my_value")
                input(name="his_name", type="text", value="my_value")
                input(name="her_name", type="text", value="my_value")
                input(name="their_name", type="text", value="my_value")
                input(name="any_name", type="text", value="my_value")
                input(name="cat_name", type="text", value="my_value")
                input(name="bird_name", type="text", value="my_value")

                my-comp(
                    :important="matter",
                    @click="anything",
                    v-slot="{ childState }"
                )
                    | {{ parentMsg }} {{ childState }}```

vs

                v-img.shrink.mt-1.hidden-sm-and-down(
                    alt="Vuetify Name",
                    contain="",
                    min-width="100",
                    src="https://cdn.vuetifyjs.com/images/logos/vuetify-name-dark.png",
                    width="100"
                )

                input(
                    name="my_name",
                    type="text",
                    value="my_value"
                )
                input(
                    name="his_name",
                    type="text",
                    value="my_value"
                )
                input(
                    name="her_name",
                    type="text",
                    value="my_value"
                )
                input(
                    name="their_name",
                    type="text",
                    value="my_value"
                )
                input(
                    name="any_name",
                    type="text",
                    value="my_value"
                )
                input(
                    name="cat_name",
                    type="text",
                    value="my_value"
                )
                input(
                    name="bird_name",
                    type="text",
                    value="my_value"
                )

                my-comp(
                    :important="matter",
                    @click="anything",
                    v-slot="{ childState }"
                )
                    | {{ parentMsg }} {{ childState }}

        v-spacer

Also both dontWrapAttributesPattern and wrapAttributesPattern should take in an object of regexs, so this can be customized with other options relating to the regex matching (i.e ignorePugWidth with certain rules)

created time in 8 hours

issue closedprettier/plugin-pug

Bug: Invalid pugWrapAttributesPattern value

Info

"@prettier/plugin-pug": "^1.10.1",
"prettier": "^2.2.0",
"framework, vue"
"node, Welcome to Node.js v14.6.0."
"os, WSL"

Prettier config

module.exports = {
    trailingComma: "es5",
    tabWidth: 4,
    semi: true,
    printWidth: 120,
    singleQuote: false,
    // htmlWhitespaceSensitivity: "ignore",
    overrides: [
        {
            files: "*.vue",
            options: {
                tabWidth: 4,
                pugTabWidth: 4,
                pugPrintWidth: 120,
                pugSingleFileComponentIndentation: false,
                // pugWrapAttributesThreshold: 1,
                pugWrapAttributesPattern: 1,
                pugSortAttributes: "asc",
                // pugClosingBracketPosition: "last-line",
            },
        },
    ],
};

Additional Context

While running prettier through the CLI, it returns

[error] Invalid pugWrapAttributesPattern value. Expected a string, but received 1.

Setting to pugWrapAttributesPattern: "1", removes the error, but it appears the output is not being processed as defined in pugWrapAttributesPattern documentation. It seems to be ignored.

closed time in 8 hours

basaran

issue commentprettier/plugin-pug

Bug: Invalid pugWrapAttributesPattern value

Thank you very much, it is as expected now.

basaran

comment created time in 8 hours

startedradarsat1/liblo

started time in 8 hours

created repositoryrsms/go-immutable

Immutable data structures for Go

created time in 9 hours

startedshadyjesse/freebee

started time in 9 hours

startedkkempes/orca

started time in 10 hours

startedundercasetype/Fraunces

started time in 10 hours

startedxz/new.css

started time in 10 hours

startedsharkdp/hyperfine

started time in 10 hours

issue openedfoliojs/fontkit

Convert path.toSVG() output back to original text?

Hopefully I'm not overlooking something that's already been addressed, but given this scenario, what could i do in the second function to get the original character codes/original string from svg info?:

const fontkit = require('fontkit');
const font = fontkit.openSync(__dirname + '/font.ttf');

// Works great
const StringToSVG = string => {
    let run = font.layout(string)

    return run.glyphs.map(g => g.path.toSVG())
  }

let svg = StringToSVG(string)

const SVGtoString = svg => {
    // What can i do with these SVG Paths?
}

let originalString = SVGtoString(svg)

// To get this output?
console.log(originalString)

created time in 11 hours

created tagprettier/plugin-pug

tag1.11.0

Prettier Pug Plugin

created time in 11 hours

release prettier/plugin-pug

1.11.0

released time in 11 hours

push eventprettier/plugin-pug

Shinigami92

commit sha 45e363858edbf60a00e33ae3fbb7a283c489762e

Set version to 1.11.0

view details

push time in 11 hours

push eventprettier/plugin-pug

Shinigami92

commit sha 5d796bc93df80f985527640a786e6406d51ab479

Fix expected test result

view details

Shinigami92

commit sha 7feb1dad32403b2e1a5f14d4ee49c87a074d1163

Update yarn.lock

view details

Shinigami92

commit sha 19a6ae06280d84a4029a746eca9c4e4abd001179

Support node 15 instead of node 13

view details

Shinigami92

commit sha 57d71c63ba06d6a7a324cb8b024e973dde53d7eb

Update Changelog

view details

push time in 11 hours

delete branch prettier/plugin-pug

delete branch : issue-156

delete time in 11 hours

push eventprettier/plugin-pug

Shinigami

commit sha a32774613daa507d6431b791f8e8077efef5c800

Add test for issue 156 (#157)

view details

push time in 11 hours

PR merged prettier/plugin-pug

Handle multiline inline script

closes #156

+31 -0

0 comment

3 changed files

Shinigami92

pr closed time in 11 hours

issue closedprettier/plugin-pug

Bug: Multiline inline script throws TypeError: Cannot read property '0' of undefined

Info

Tool Version
Framework none
Node v10.14 - 14.13
OS win10
    "eslint": "7.13.0",
    "eslint-plugin-pug": "1.2.2",
    "prettier": "2.1.2",
    "@prettier/plugin-pug": "1.10.1",

Eslint config

{
  "parserOptions": {
    "ecmaVersion": 2018
  },
  "env": {
      "es6": true
  },
  "plugins": [
    "prettier",
    "pug"
  ],
  "extends": [
      "plugin:prettier/recommended"
  ],
  "rules": {
      "prettier/prettier": [
        "error",
        {
            "usePrettierrc": true
        }
      ]
  }
}

There is no error if I remove extends and rules.prettier/prettier

Prettier config

{
  "printWidth": 120,
  "endOfLine": "auto"
}

If I use {} config I don't see error.

I use this command with this eslint config:

  • eslint --ext .js,.pug \"./src\" - doesn't work
  • eslint --ext .js\"./src\" - works
  • eslint --ext .pug \"./src\" - works

Input

doesn't work (with more than one line). We can have function body or not - there is always error.

script.
  function foo() {
  }

works

script.
  function foo() {}

Output or Error

I get error for multiline inline script

TypeError: Cannot read property '0' of undefined
    at Object.exports.transformFix (.\node_modules\eslint-plugin-pug\utils.js:115:72)
    at .\node_modules\eslint-plugin-pug\utils.js:135:25
    at arrayEach (.\node_modules\lodash\lodash.js:516:11)
    at Function.forEach (.\node_modules\lodash\lodash.js:9368:14)
    at .\node_modules\eslint-plugin-pug\utils.js:128:7
    at arrayEach (.\node_modules\lodash\lodash.js:516:11)
    at Function.forEach (.\node_modules\lodash\lodash.js:9368:14)
    at exports.postprocess (.\node_modules\eslint-plugin-pug\utils.js:126:5)
    at Linter._verifyWithProcessor (.\node_modules\eslint\lib\linter\linter.js:1327:16)
    at Linter._verifyWithConfigArray (.\node_modules\eslint\lib\linter\linter.js:1264:25)

Thanks. I see [0] in eslint-plugin-pug\utils.js So I created issue for this prettier plugin.

closed time in 11 hours

silveoj

delete branch prettier/plugin-pug

delete branch : issue-158

delete time in 11 hours

push eventprettier/plugin-pug

Shinigami

commit sha 7fcedb3be24a7d3d1e96a40263a399a859147b15

Format inline scripts and styles (#159) * Add test for issue 158 * Format start-pipeless-text script code * Add script.whitespace pug native test * Log warn for unhandled token * Only format if previous was fot token * Preserve newline * Fix trailing whitespaces * Format inline style * Request for potential parser * Improve code readability Co-authored-by: Daniel Theuke <st-ddt@gmx.de>

view details

push time in 11 hours

PR merged prettier/plugin-pug

Format inline scripts and styles type: enhancement

closes #158

+161 -9

0 comment

11 changed files

Shinigami92

pr closed time in 11 hours

more