Feel free to open an issue to report a bug or share us your great ideas!
Please only put one bug/suggestion in each issue to make it easier to track, and provide helpful information (like the commands you wrote, the errors it showed) to help reproduce and fix.
Spyglass supports multiple languages. If you'd like to help us translate this project to your language, it would be really appreciated!
- Go to the localization website.
- Register by linking your GitHub account (recommended), or using your email.
- See two components of Spyglass here.
- Start translating!
- If your language is not listed on the platform, simply open an issue.
- If you have suggestions for the source string (
en-us), please open an issue, or discuss with other translators at the Discord server if you'd like to.
Some team members accept donations. If you're interested in sponsoring, you can go to their GitHub Sponsors pages:
-
$ git clone https://github.com/SpyglassMC/Spyglass.git
- Install Node.js LTS.
-
$ npm i && npm run build
If you're using VS Code to develop Spyglass:
- Install the recommended ESLint extension. Make a copy of
.vscode/settings.template.jsonand rename it to.vscode/settings.json. Now your VS Code should automatically fix all linting errors every time you save the file. - Press F5 to run the VS Code extension in development environment (
Server + Client). VS Code will automatically compile all packages and build the extension file in watch mode.
Or if you prefer the command line interface:
npm run buildto build all packages.npm run watchto watch changes and build all packages.npm run cleanto remove all js output. Use this when there seem to be caching issues with TypeScript's compiler.npm testto test all packages.npm run test:update-snapshotsto run tests and update test snapshots.npm run test:watchto run tests in watch mode.npm run fmtto format all files.npm run lintto check linting errors.npm run lint:fixto fix all auto-fixable linting errors.npm run committo run thegitmojiCLI. You actually don't have to worry about commit message as long as you're creating PR, as I can always change it.
You can debug tests with breakpoints by running the Run Unit Tests configuration and setting your breakpoints accordingly. If you want to run a specific subset of tests, add .only or
{ only: true} after the test block (e.g. describe.only(), it.only(),
it('...', { only: true }, ...)).
Note that the lint will fail in CI/CD if only tests are pushed to prevent mistakenly merging only to main (it should only be used for local testing!).
Tabs for indents, spaces for alignment. Except do not align things because the available tooling is unfortunately terrible.
- Install Jekyll according to its documentation.
- Run
npm run docs:startto start a local preview atlocalhost:4000.
The build script at the root level does the following steps in series:
- Run the
buildscript in./packages/locales. - Run the TypeScript compiler across all packages.
- Then, do the two steps in parallel:
- Run the
buildscript in./packages/playground. - Run the
buildscript in./packages/vscode-extension.
- Run the
The whole Spyglass project, including its source code and output, uses ES module.
However, as VS Code cannot consume ES modules as extensions (microsoft/vscode#130367),
the vscode-extension package defaults to use CommonJS modules, with file extensions mjs and mts to explicitly override that,