Skip to content

Commit fe3189b

Browse files
authored
fix(cli): generate comprehensive license as LICENSE for npm publish (#936)
Generate the bundled dependency license file directly as LICENSE instead of LICENSE.md, so npm publish includes the comprehensive license. Remove the separate syncLicenseFromRoot() that copied the simple MIT license from root, since generateLicenseFile() already includes it.
1 parent db67e9b commit fe3189b

2 files changed

Lines changed: 4 additions & 12 deletions

File tree

packages/cli/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/npm
22
/artifacts
33
/LICENSE
4-
/LICENSE.md
54
/skills/vite-plus/docs

packages/cli/build.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* 4. syncCorePackageExports() - Creates shim files to re-export from @voidzero-dev/vite-plus-core
99
* 5. syncTestPackageExports() - Creates shim files to re-export from @voidzero-dev/vite-plus-test
1010
* 6. copySkillDocs() - Copies docs into skills/vite-plus/docs for runtime MCP access
11-
* 7. syncReadmeFromRoot()/syncLicenseFromRoot() - Keeps package docs/license in sync
11+
* 7. syncReadmeFromRoot() - Keeps package README in sync
1212
*
1313
* The sync functions allow this package to be a drop-in replacement for 'vite' by
1414
* re-exporting all the same subpaths (./client, ./types/*, etc.) while delegating
@@ -64,13 +64,13 @@ if (!skipTs) {
6464
generateLicenseFile({
6565
title: 'Vite-Plus CLI license',
6666
packageName: 'Vite-Plus',
67-
outputPath: join(projectDir, 'LICENSE.md'),
67+
outputPath: join(projectDir, 'LICENSE'),
6868
coreLicensePath: join(projectDir, '..', '..', 'LICENSE'),
6969
bundledPaths: [join(projectDir, 'dist', 'global')],
7070
resolveFrom: [projectDir],
7171
});
72-
if (!existsSync(join(projectDir, 'LICENSE.md'))) {
73-
throw new Error('LICENSE.md was not generated during build');
72+
if (!existsSync(join(projectDir, 'LICENSE'))) {
73+
throw new Error('LICENSE was not generated during build');
7474
}
7575
}
7676
// Build native first - TypeScript may depend on the generated binding types
@@ -83,7 +83,6 @@ if (!skipTs) {
8383
}
8484
await copySkillDocs();
8585
await syncReadmeFromRoot();
86-
await syncLicenseFromRoot();
8786

8887
async function buildNapiBinding() {
8988
const buildCommand = createBuildCommand(napiArgs);
@@ -482,12 +481,6 @@ async function syncReadmeFromRoot() {
482481
}
483482
}
484483

485-
async function syncLicenseFromRoot() {
486-
const rootLicensePath = join(projectDir, '..', '..', 'LICENSE');
487-
const packageLicensePath = join(projectDir, 'LICENSE');
488-
await copyFile(rootLicensePath, packageLicensePath);
489-
}
490-
491484
function splitReadme(content: string, label: string) {
492485
const match = /^---\s*$/m.exec(content);
493486
if (!match || match.index === undefined) {

0 commit comments

Comments
 (0)