Skip to content

Commit

Permalink
Merge pull request #61 from XaveScor/43-save-devdeps
Browse files Browse the repository at this point in the history
43: save devdeps
  • Loading branch information
XaveScor authored Oct 25, 2024
2 parents 13f1530 + e9979c0 commit 092beae
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 5 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
"bin": "./src/run.ts",
"type": "module",
"scripts": {
"test": "vitest",
"test:update-snapshots": "vitest -u"
"test": "vitest src",
"test:update-snapshots": "pnpm test -- -u",
"test:e2e": "vitest e2e",
"test:e2e-update-snapshots": "pnpm test:e2e -- -u"
},
"keywords": [
"smartbundle",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"use strict";
console.log(1);
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "43-devdeps",
"type": "module",
"version": "0.0.0",
"types": "./entrypoint.d.ts",
"module": "./entrypoint.js",
"description": "",
"exports": {
".": {
"types": "./entrypoint.d.ts",
"import": {
"types": "./entrypoint.d.ts",
"default": "./entrypoint.js"
},
"require": {
"types": "./entrypoint.d.ts",
"default": "./entrypoint.cjs"
},
"default": "./entrypoint.js"
},
"./package.json": "./package.json"
},
"devDependencies": {
"test": "0.6.0"
}
}
4 changes: 2 additions & 2 deletions src/build.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ describe("bugs", () => {
// @ts-expect-error
expect(tmpDir).toMatchDirSnapshot();
});
test("36-remove-devdeps", async ({ tmpDir }: { tmpDir: string }) => {
test("43-save-devdeps", async ({ tmpDir }: { tmpDir: string }) => {
const res = await run({
outputDir: tmpDir,
sourceDir: "./src/fixtures/36-remove-devdeps",
sourceDir: "./src/fixtures/43-save-devdeps",
});

expect(res.error).toBeFalsy();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "36-devdeps",
"name": "43-devdeps",
"private": true,
"version": "0.0.0",
"type": "module",
Expand Down
1 change: 1 addition & 0 deletions src/writePackageJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export async function writePackageJson(
sideEffects: parsed.sideEffects,
unpkg: parsed.unpkg,
homepage: parsed.homepage,
devDependencies: parsed.devDependencies,
};

await writeFile(`${outDir}/package.json`, JSON.stringify(res, null, 2));
Expand Down

0 comments on commit 092beae

Please sign in to comment.