Skip to content

Commit 2226915

Browse files
committed
only tsc once
1 parent 6ac75c1 commit 2226915

File tree

5 files changed

+6
-17
lines changed

5 files changed

+6
-17
lines changed

bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export {version} from "./package.json";
2-
export * from "./src/index.js";
2+
export * from "./build/index.js";

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"test:mocha": "mkdir -p test/output && mocha --conditions=mocha 'test/**/*-test.*' 'test/plot.js'",
3333
"test:lint": "eslint src test",
3434
"test:typecheck": "tsc --noEmit",
35-
"prepublishOnly": "rm -rf build dist && rollup -c && tsc && tsx scripts/readme-to-jsdoc.ts",
35+
"prepublishOnly": "rm -rf build dist && tsc && tsx scripts/readme-to-jsdoc.ts && rollup -c",
3636
"postpublish": "git push && git push --tags",
3737
"dev": "vite"
3838
},
@@ -45,7 +45,6 @@
4545
"@rollup/plugin-commonjs": "22",
4646
"@rollup/plugin-json": "4",
4747
"@rollup/plugin-node-resolve": "13",
48-
"@rollup/plugin-typescript": "^8.3.2",
4948
"@types/d3": "^7.4.0",
5049
"@types/expect": "^24.3.0",
5150
"@types/mocha": "^9.1.1",

rollup.config.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import commonjs from "@rollup/plugin-commonjs";
44
import json from "@rollup/plugin-json";
55
import node from "@rollup/plugin-node-resolve";
66
import * as meta from "./package.json";
7-
import typescript from "@rollup/plugin-typescript";
87

98
const filename = meta.name.split("/").pop();
109

@@ -27,7 +26,7 @@ const config = {
2726
indent: false,
2827
banner: `// ${meta.name} v${meta.version} Copyright ${copyrights.join(", ")}`
2928
},
30-
plugins: [typescript(), commonjs(), json(), node()]
29+
plugins: [commonjs(), json(), node()]
3130
};
3231

3332
export default [
@@ -38,7 +37,7 @@ export default [
3837
name: "Plot",
3938
format: "umd",
4039
extend: true,
41-
file: `build/${filename}.umd.js`,
40+
file: `dist/${filename}.umd.js`,
4241
globals: {d3: "d3"},
4342
paths: {d3: d3Path}
4443
}

scripts/readme-to-jsdoc.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,8 @@ for (const file of glob.sync("build/**/*.js")) {
5858
const [, name] = match;
5959
const docs = docmap.get(name);
6060
if (!docs) throw new Error(`missing @jsdoc definition: ${name}`);
61-
if (file === "build/plot.umd.js") "ignore";
62-
else if (!unused.has(name)) throw new Error(`duplicate @jsdoc reference: ${name}`);
63-
else unused.delete(name);
61+
if (!unused.has(name)) throw new Error(`duplicate @jsdoc reference: ${name}`);
62+
unused.delete(name);
6463
++count;
6564
lines[i] = docs
6665
.map((line, i, lines) => (i === 0 ? `/** ${line}` : i === lines.length - 1 ? ` * ${line}\n */` : ` * ${line}`))

yarn.lock

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,6 @@
225225
is-module "^1.0.0"
226226
resolve "^1.19.0"
227227

228-
"@rollup/plugin-typescript@^8.3.2":
229-
version "8.5.0"
230-
resolved "https://registry.yarnpkg.com/@rollup/plugin-typescript/-/plugin-typescript-8.5.0.tgz#7ea11599a15b0a30fa7ea69ce3b791d41b862515"
231-
integrity sha512-wMv1/scv0m/rXx21wD2IsBbJFba8wGF3ErJIr6IKRfRj49S85Lszbxb4DCo8iILpluTjk2GAAu9CoZt4G3ppgQ==
232-
dependencies:
233-
"@rollup/pluginutils" "^3.1.0"
234-
resolve "^1.17.0"
235-
236228
"@rollup/pluginutils@^3.0.8", "@rollup/pluginutils@^3.1.0":
237229
version "3.1.0"
238230
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b"

0 commit comments

Comments
 (0)