aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugin/AGENTS/DEVELOPMENT.md5
-rw-r--r--plugin/scripts/package.js4
2 files changed, 5 insertions, 4 deletions
diff --git a/plugin/AGENTS/DEVELOPMENT.md b/plugin/AGENTS/DEVELOPMENT.md
index ca008af..71f9e8e 100644
--- a/plugin/AGENTS/DEVELOPMENT.md
+++ b/plugin/AGENTS/DEVELOPMENT.md
@@ -16,14 +16,15 @@ npm run package
`npm run package` runs syntax checks and the existing Node tests, then uses vsce
through `scripts/package.js` to generate `cpsc-plugin-YYYYMMDD-HHMMSS-commit.vsix`.
-Both filename components come from HEAD: its UTC commit timestamp and Git short ID.
+Both filename components come from the last commit that touched `plugin/`: its UTC
+commit timestamp and Git short ID.
The internal version is `YYYYMMDD.HHMMSS.0+commit`; the numeric time component
has no leading zeros (midnight is `0`). For example, the file
`cpsc-plugin-20261018-054123-1b0b287.vsix` contains version
`20261018.54123.0+1b0b287` in both package.json and the VSIX manifest.
The source manifest and lockfile retain their development version; vsce overrides
only the packaged version, without modifying source files or creating commits/tags.
-Missing Git or unreadable HEAD fails packaging. Runtime dependencies are not bundled.
+Missing Git or an unreadable last plugin commit fails packaging. Runtime dependencies are not bundled.
`@vscode/vsce`, `vscode-textmate` and `vscode-oniguruma` are development tools only.
Do simple verification before each feature commit and follow the global commit
diff --git a/plugin/scripts/package.js b/plugin/scripts/package.js
index 67ff99f..7ef8f17 100644
--- a/plugin/scripts/package.js
+++ b/plugin/scripts/package.js
@@ -5,13 +5,13 @@ const path = require('node:path');
const pluginDir = path.resolve(__dirname, '..');
try {
- const revision = execFileSync('git', ['log', '-1', '--format=%ct:%h'], {
+ const revision = execFileSync('git', ['log', '-1', '--format=%ct:%h', '--', '.'], {
cwd: pluginDir,
encoding: 'utf8',
stdio: ['ignore', 'pipe', 'pipe']
}).trim();
const match = /^(\d+):([0-9a-f]+)$/.exec(revision);
- if (!match) throw new Error('Cannot read the HEAD commit for the package version.');
+ if (!match) throw new Error('Cannot read the last plugin commit for the package version.');
const timestamp = new Date(Number(match[1]) * 1000).toISOString();
const date = timestamp.slice(0, 10).replace(/-/g, '');
const time = timestamp.slice(11, 19).replace(/:/g, '');