wtgtybhertgeghgtwtg
Repos
28
Followers
283

Events

issue comment
Gazelle extension for TypeScript

Most of the work I have has been with swc and linking side of things, so I doubt I'd be of much use if you've found an esbuild setup. Thank you for the offer, however.

Created at 3 days ago
issue comment
Gazelle extension for TypeScript

I've been trying my hand at this, but it's fraught with speedbumps.

  • Gazelle requires extensions to be built in Go. There was talk about a plugin to support other languages, but it seems to have stalled.
  • Since esbuild doesn't expose its parser and I can't seem to find any other parser in Go-space, I've been statically linking a Rust binary that uses swc. Since swc has a library to grab dependencies, this part is surprisingly straightforward.
  • rules_go has issues with IDE support for cgo, so errors around the bindings on the Go side just have to be ignored.
  • The ecosystem does not have go-to rules for certain tasks like linting or formatting like other languages. I've mostly had to resolve to some internal macros for those, but they are not portable. Right now, I've got it far enough that it can spit out something like
load("@aspect_rules_js//npm:defs.bzl", "npm_package")
load("@aspect_rules_ts//ts:defs.bzl", "ts_config")
load("@npm_dependencies//:defs.bzl", "npm_link_all_packages")
load("//macros/eslint-test:eslint_test.bzl", "eslint_test")
load("//macros/transpile-typescript:transpile_typescript.bzl", "transpile_typescript")
 
npm_link_all_packages(name = "node_modules")

ts_config(
    name = "tsconfig",
    src = "tsconfig.json",
)

transpile_typescript(
    name = "typescript",
    srcs = ["source/render-package-json.ts"],
    package_json = "package.json",
    tsconfig = ":tsconfig",
    deps = [":node_modules/sort-keys"],
)

npm_package(
    name = "render-package-json",
    srcs = [":typescript"],
    visibility = ["//visibility:public"],
)

eslint_test(
    name = "eslint_test",
    srcs = ["source/render-package-json.ts"],
    eslintrc = ".eslintrc.cjs",
    package_json = "package.json",
    tsconfig = ":tsconfig",
    deps = [":node_modules/sort-keys"],
)

but it's hacky and nowhere near close enough for a PR. If the trade-offs above are acceptable for now, is there a design document I can conform to while cleaning it up and submit a proof of concept?

Created at 6 days ago
issue comment
Add `--silent` flag.

Thank you for merging.

Created at 6 days ago
wtgtybhertgeghgtwtg delete branch silent-flag
Created at 6 days ago
pull request opened
Add `--silent` flag.

This pull request adds a --silent option to diplomat-tool to silence messages (e.g. "Generating c bindings:") that are displayed during run. I implemented it in the most naive way (just adding if expressions around every println), so please let me know if there is a more preferable way, or if the flag should be named something else, or if the change is just unwanted.

Created at 6 days ago
wtgtybhertgeghgtwtg create branch silent-flag
Created at 6 days ago
issue comment
Replace `structopt` with `clap@3`.

Thank you for merging.

Created at 2 weeks ago
wtgtybhertgeghgtwtg delete branch structopt-to-clap
Created at 2 weeks ago
pull request opened
Replace `structopt` with `clap@3`.

Running cargo audit on a project depending on this repository gives a warning that the transitive dependency ansi_term is unmaintained . This comes from the structopt dependency by way of clap@2. However, structopt is in maintenance mode since its main feature is included in clap@3, so that dependency on clap@2 will not be updated. As it is suggested by structopt to move to clap@3, and clap@3 replaced the ansi_term dependency, I am filing this PR to do so.

Please let me know if I have missed anything, or if this change is unwanted.

Created at 2 weeks ago
wtgtybhertgeghgtwtg create branch structopt-to-clap
Created at 2 weeks ago
opened issue
Consider exposing a `gopackagesdriver.sh` instead of having the user create one.

What version of rules_go are you using?

v0.35.0.

What version of gazelle are you using?

N/A

What version of Bazel are you using?

5.3.0.

Does this issue reproduce with the latest releases of all the above?

Yes.

What operating system and processor architecture are you using?

N/A

Any other potentially useful information about your toolchain?

N/A

What did you do?

Configured my IDE in accordance to https://github.com/bazelbuild/rules_go/wiki/Editor-setup.

What did you expect to see?

Ideally, the user should not have to add a script to their repository as part of the IDE setup. It is, at most, a minor inconvenience, but it could be slightly smoother if the configuration could directly point to a script this repository provides. For example, with VSCode

{
  "go.goroot": "${workspaceFolder}/bazel-${workspaceFolderBasename}/external/go_sdk",
  "go.toolsEnvVars": {
    "GOPACKAGESDRIVER": "${workspaceFolder}/bazel-${workspaceFolderBasename}/external/io_bazel_rules_go/gopackagesdriver.sh"
  },
  // Et cetera
}

If it wasn't for the workaround with GOPACKAGESDRIVER_RULES_GO_REPOSITORY_NAME, it would be possible to just refer to the tools/gopackagesdriver.sh this repository uses itself.

What did you see instead?

Currently, IDE setup requires copypasting a small script somewhere in the repository.

Created at 2 weeks ago
wtgtybhertgeghgtwtg delete branch bump-transitive-dependencies
Created at 1 month ago
issue comment
fix: update transitive `@swc/cli` dependencies

Thank you for merging.

Created at 1 month ago

Mirror latest version of swc (#74)

chore(deps): update dependency bazel to v5.3.0 (#75)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

chore: update to rules_js 1.1.0 (#77)

fix: update transitive @swc/cli dependencies

Created at 1 month ago

Mirror latest version of swc (#74)

chore(deps): update dependency bazel to v5.3.0 (#75)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

chore: update to rules_js 1.1.0 (#77)

Created at 1 month ago
issue comment
Plugins cannot be loaded from directories that start with '@'.

Thank you for the fix.

Created at 1 month ago
issue comment
fix: update transitive `@swc/cli` dependencies

The issue this sets out to resolve is still present in the v0.16.0 release.

Created at 1 month ago
opened issue
Plugins cannot be loaded from directories that start with '@'.

Version: 0.30.3

Let's say I have a directory structure like

demo/
├─ @path/
│  └─ plugin.wasm
├─ dprint.json
└─ file-to-format.ext

where dprint.json includes the relative path to plugin.wasm.

{
  "plugins": [
    "./@path/plugin.wasm"
  ],
}

Running dprint fmt file-to-format.ext will spit out an error

Error resolving plugin /home/demo: Error reading file /home/demo: Is a directory (os error 21)

So apparently it disregards the '@' and everything after it and tries to load ./ as a plugin instead of ./@path/plugin.wasm. If I rename @path to path and load the plugin at ./path/plugin.wasm, it works as expected, but that is not always possible. My specific use case is loading a plugin that's from a scoped package (e.g. ./node_modules/@my-scope/my-package/plugin.wasm), which necessarily has to start with '@'.

Created at 1 month ago
wtgtybhertgeghgtwtg delete branch move-trie-lib-cspell-types
Created at 1 month ago
pull request opened
fix(cspell-trie-lib): move `@cspell/cspell-types`

It was a devDependency, but parts of cspell-trie-lib import from it. This brings it in line with how other packages in the repo (e.g. @cspell/cspell-json-reporter, cspell-grammar) depend on @cspell/cspell-types.

Created at 1 month ago
wtgtybhertgeghgtwtg create branch move-trie-lib-cspell-types
Created at 1 month ago

fix: update transitive @swc/cli dependencies

Created at 1 month ago
pull request opened
fix: update transitive `@swc/cli` dependencies

I was running into an issue with source maps and found it was identical to https://github.com/sveltejs/svelte/issues/7728. The fix over there was updating source-map (since source-map@0.7.3 checks for the environment by the existence of fetch, which is now included in Node, and source-map@0.7.4 replaces this with a window check). Since source-map is a transitive dependency of @swc/cli, it's part of the pnpm-lock.yaml included, but it's currently locked to source-map@0.7.3. So, this PR was just the result of updating that, which fixes the source map issue.

Created at 1 month ago
wtgtybhertgeghgtwtg create branch bump-transitive-dependencies
Created at 1 month ago