redhat-developer / redhat-developer/yaml-language-server

Improve output directory structure

Open
#1,124 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.5k
Forks
352
Avg merge
2d 7h
Merged PRs (30d)
11

Description

Describe the bug

See the discussion on https://github.com/redhat-developer/yaml-language-server/pull/1104

The compiled code is split between two folders:

  • ./out for the code compiled to CommonJS modules as well as a compiled copy of the test code
  • ./lib for the code compiled to UMD modules and to ESM modules

Notably, the relative paths to ./l10n from the CommonJS server.js and the UMD and ESM server.js are different. This means that the localization information will not be loaded properly when running with the compiled UMD or ESM code.

Making changes to the output directory structure could break projects that consume yaml-language-server, but the current structure is confusing and causing problems.

Expected Behavior

  1. There should be one "output" folder for the compiled code
  2. The relative path from server.js to ./l10n for CJS, UMD, and ESM should be the same

Current Behavior

  1. There are two output folders: out and lib
  2. The relative path from server.js to ./l10n for CJS is ../../../l10n and for UMD and ESM it's ../../l10n

Steps to Reproduce

  1. Compile the code npm run compile; npm run compile:esm; npm run compile:umd
  2. Observe the directory structure of the output code

Environment

  • Windows
  • Mac
  • Linux
  • other (please specify)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the output produced by npm run compile, npm run compile:esm, and npm run compile:umd, comparing the out and lib folders and the server.js paths to ./l10n. Read the discussion in pull request 1104 before changing the layout. Done means one output folder is used and CJS, UMD, and ESM resolve localization through the same relative path without breaking the documented compile commands.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.