-
Notifications
You must be signed in to change notification settings - Fork 13
5.2 | Scripts
Rácz Zalán edited this page Nov 25, 2023
·
2 revisions
The project contains several useful scripts you can use. In order to use them, first, you have to install the project's dependencies with npm install
. The package.json contains the scripts' definitions. You can run them either from VS Code's NPM Scripts window or from the terminal like npm run eslint
.
- build-production: Builds the extension in production mode, both the desktop and the web versions. You have to run it before packaging.
- build: Builds the extension in development mode, both the desktop and the web versions.
- watch: Builds the extension in development mode, both the desktop and the web versions in watch mode, so you don't have to manually run build when you change a file. When you run the extension, this script is automatically called in the background. However, keep in mind, that it only rebuilds the code, but hot reload is not supported. So if you change a file, while you started the extension, you still have to close and reopen it.
- compile-antlr-windows: Generates the ANTLR TypeScript lexer and parser from AntlrGlslLexer.g4, and AntlrGLslParser.g4 on Windows.
- compile-antlr-linux: Generates the ANTLR TypeScript lexer and parser from AntlrGlslLexer.g4, and AntlrGLslParser.g4 on Linux.
- markdownlint: Runs Markdownlint to check if markdown files are correct.
- prettier-lint: Runs Prettier to check if the files are formatted correctly.
- prettier-format: Runs Prettier to format all files. Since in the pre-commit hook Prettier formats all staged files, you rarely need to use it. However, it can be useful, if you change .prettierignore or .prettierrc.json.
- eslint: Runs ESLint to check if there are problems in the source code.
- run-in-browser: Runs VS Code's web version in an actual browser and runs the web version of the extension in it. Note, that this script doesn't build the extension, so you have to run build or watch before using it.
- package-universal: Packages the universal version of the extension. It will be used on platforms where platform-specific packages are not available, for example, on Alpine, or on Linux ARM64. The package won't contain glslang, therefore, it won't be able to report syntax errors. It generates a file named webgl-glsl-editor-VERSION.vsix.
- package-web: Packages the web version of the extension. The package won't contain glslang, therefore, it won't be able to report syntax errors, also, it won't contain the offline documentation. It generates a file named webgl-glsl-editor-web-VERSION.vsix.
- package-windows-x64: Packages the Windows x64 version of the extension. It generates a file named webgl-glsl-editor-win32-x64-VERSION.vsix.
- package-mac-x64: Packages the Mac x64 version of the extension. It generates a file named webgl-glsl-editor-dawrin-x64-VERSION.vsix.
- package-linux-x64: Packages the Linux x64 version of the extension. It generates a file named webgl-glsl-editor-linux-x64-VERSION.vsix.
- package-all: Runs all 5 packaging scripts.
- prepare: Runs when you install the dependencies and creates the formatting pre-commit hook. You probably never have to run it manually.