@gjuchault/typescript-library-starter
Advanced tools
Comparing version 2.0.4 to 2.0.5
@@ -19,19 +19,28 @@ "use strict"; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
// src/index.ts | ||
var src_exports = {}; | ||
__export(src_exports, { | ||
bar: () => bar, | ||
foo: () => foo | ||
foobar: () => foobar | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
function foo(a, b) { | ||
return a + b; | ||
// src/bar.ts | ||
function bar() { | ||
return "bar"; | ||
} | ||
function bar(a, b) { | ||
return a - b; | ||
// src/foo.ts | ||
function foo() { | ||
return "foo"; | ||
} | ||
// src/index.ts | ||
function foobar(a, b) { | ||
return foo().repeat(a).length + bar().repeat(b).length; | ||
} | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
bar, | ||
foo | ||
foobar | ||
}); | ||
//# sourceMappingURL=index.js.map |
@@ -1,11 +0,18 @@ | ||
function foo(a, b) { | ||
return a + b; | ||
// src/bar.ts | ||
function bar() { | ||
return "bar"; | ||
} | ||
function bar(a, b) { | ||
return a - b; | ||
// src/foo.ts | ||
function foo() { | ||
return "foo"; | ||
} | ||
// src/index.ts | ||
function foobar(a, b) { | ||
return foo().repeat(a).length + bar().repeat(b).length; | ||
} | ||
export { | ||
bar, | ||
foo | ||
foobar | ||
}; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,1 @@ | ||
export declare function foo(a: number, b: number): number; | ||
export declare function bar(a: number, b: number): number; | ||
export declare function foobar(a: number, b: number): number; |
@@ -1,2 +0,2 @@ | ||
## [2.0.4](https://github.com/gjuchault/typescript-library-starter/compare/v2.0.3...v2.0.4) (2022-08-11) | ||
## [2.0.5](https://github.com/gjuchault/typescript-library-starter/compare/v2.0.4...v2.0.5) (2022-08-16) | ||
@@ -6,2 +6,2 @@ | ||
* **testSetup:** stop re-adding origin ([4686662](https://github.com/gjuchault/typescript-library-starter/commit/46866629857a4184611ea48ae6b21089c9f5e0b5)) | ||
* **build:** missing bundle mode ([ff379fc](https://github.com/gjuchault/typescript-library-starter/commit/ff379fc1a57d0515236ccd63d0f0566a4d263e15)) |
{ | ||
"name": "@gjuchault/typescript-library-starter", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "Yet another typescript library starter template", | ||
@@ -57,3 +57,3 @@ "keywords": [ | ||
"@semantic-release/release-notes-generator": "^10.0.3", | ||
"@types/node": "^18.6.5", | ||
"@types/node": "^18.7.3", | ||
"@types/prompts": "^2.0.14", | ||
@@ -63,7 +63,7 @@ "@typescript-eslint/eslint-plugin": "^5.33.0", | ||
"c8": "^7.12.0", | ||
"cspell": "^6.6.0", | ||
"cspell": "^6.6.1", | ||
"esbuild": "^0.14.54", | ||
"eslint": "^8.21.0", | ||
"eslint": "^8.22.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-import-resolver-typescript": "^3.4.0", | ||
"eslint-import-resolver-typescript": "^3.4.1", | ||
"eslint-plugin-eslint-comments": "^3.2.0", | ||
@@ -70,0 +70,0 @@ "eslint-plugin-import": "^2.26.0", |
@@ -17,9 +17,8 @@ # Typescript Library Starter | ||
1. `npx degit gjuchault/typescript-library-starter my-project` | ||
1. `npx degit gjuchault/typescript-library-starter my-project` or click on `Use this template` button on GitHub! | ||
2. `cd my-project` | ||
3. `npm install` | ||
4. `npm run setup` | ||
4. `git init` (if you used degit) | ||
5. `npm run setup` | ||
Or click on `Use this template` button on GitHub! | ||
To enable deployment, you will need to: | ||
@@ -26,0 +25,0 @@ |
import path from "path"; | ||
import { build as esbuild } from "esbuild"; | ||
import { build as esbuild, BuildOptions } from "esbuild"; | ||
const baseConfig = { | ||
platform: "node" as const, | ||
target: "esnext" as const, | ||
format: "cjs" as const, | ||
const baseConfig: BuildOptions = { | ||
platform: "node", | ||
target: "esnext", | ||
format: "cjs", | ||
nodePaths: [path.join(__dirname, "../src")], | ||
sourcemap: true, | ||
external: [], | ||
bundle: true, | ||
}; | ||
@@ -12,0 +13,0 @@ |
import { describe, expect, it } from "vitest"; | ||
import { foo, bar } from "../index"; | ||
import { foobar } from "../index"; | ||
describe("foo()", () => { | ||
describe("foobar()", () => { | ||
describe("given two positive integers", () => { | ||
@@ -10,4 +10,4 @@ const first = 1; | ||
describe("when called", () => { | ||
it("returns the sum of them", () => { | ||
expect(foo(first, second)).toEqual(3); | ||
it("returns the sum of them multiplied by 3", () => { | ||
expect(foobar(first, second)).toEqual(9); | ||
}); | ||
@@ -17,14 +17,1 @@ }); | ||
}); | ||
describe("bar()", () => { | ||
describe("given two positive integers", () => { | ||
const first = 2; | ||
const second = 1; | ||
describe("when called", () => { | ||
it("returns the subtraction of them", () => { | ||
expect(bar(first, second)).toEqual(1); | ||
}); | ||
}); | ||
}); | ||
}); |
@@ -1,7 +0,6 @@ | ||
export function foo(a: number, b: number): number { | ||
return a + b; | ||
} | ||
import { bar } from "./bar"; | ||
import { foo } from "./foo"; | ||
export function bar(a: number, b: number): number { | ||
return a - b; | ||
export function foobar(a: number, b: number) { | ||
return foo().repeat(a).length + bar().repeat(b).length; | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
31836
35
569
80