Skip to content

Commit

Permalink
fix bundling with package json
Browse files Browse the repository at this point in the history
  • Loading branch information
harrydowning committed Aug 29, 2024
1 parent 505dc62 commit c28b628
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 10 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Changed

- `scopeName` to be required
- Output to be bundled and minified
- Injection grammar to be separated into `source.yaml.injection` and `source.github-actions-workflow.injection`

## [1.0.1] - 2024-08-26

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Thank you for taking an interest in contributing to this project. All contributi

## Development Workflow

- Implement changes, noting that `package.json` is partially generated and `syntaxes/*` is fully generated so relevant changes to these should be made in `src`
- Run `npm run generate` to update `package.json` and `syntaxes/*`
- Implement changes, noting that `package.json` is partially generated and `syntaxes` is fully generated so relevant changes to these should be made in `src`
- Run `npm run generate` to update `package.json` and `syntaxes`
- Use F5 within VS Code to test the extension

## Release Workflow
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@
"typescript-eslint": "^8.3.0"
},
"scripts": {
"build": "tsc && esbuild dist/extension.js --bundle --platform=node --outfile=dist/extension.js --allow-overwrite --minify --external:vscode",
"build": "tsc && esbuild dist/extension.js --bundle --platform=node --outfile=dist/extension.js --allow-overwrite --minify --external:vscode --external:../package.json --alias:@package=../package.json",
"generate": "ts-node src/generate.ts",
"lint": "eslint",
"format": "prettier . --check",
Expand Down
4 changes: 1 addition & 3 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import packageJson from "../package.json";

export { packageJson };
import packageJson from "@package";

export const SUB_INCLUDE_CONFIG = "include";
export const INCLUDE_CONFIG = `${packageJson.name}.${SUB_INCLUDE_CONFIG}`;
Expand Down
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import vscode from "vscode";
import packageJson from "@package";
import {
INCLUDE_CONFIG,
LANGUAGES,
packageJson,
SUB_INCLUDE_CONFIG,
VERSION_STATE,
} from "./constants";
Expand Down
2 changes: 1 addition & 1 deletion src/package.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { packageJson } from "./constants";
import packageJson from "@package";
import { InjectionGrammar } from "./injection-grammar";
import { Writable } from "./writable";

Expand Down
2 changes: 1 addition & 1 deletion src/writable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class Writable {
try {
fileData = fs.readFileSync(this.#absolutePath).toString();
} catch {
fileData = undefined;
fileData = null;
}

if (fileData === data) {
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
"resolveJsonModule": true,
"strict": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true
"esModuleInterop": true,
"paths": {
"@package": ["./package.json"]
}
},
"include": ["src/**/*"]
}

0 comments on commit c28b628

Please sign in to comment.