Skip to content

Commit

Permalink
remove generateCitation from node scripts and directly call
Browse files Browse the repository at this point in the history
  • Loading branch information
cherriechang committed Oct 23, 2024
1 parent 8bbf9b7 commit 00d60fb
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 13 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ jobs:
- name: Check types
run: npm run tsc

- name: Prebuild citation
run: npm run prebuild

- name: Build packages
run: npm run build

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"scripts": {
"test": "jest",
"test:watch": "npm test -- --watch",
"prebuild": "node generateCitation.js",
"build": "turbo run build",
"build:archive": "gulp createCoreDistArchive",
"update-unpkg-links": "gulp updateUnpkgLinks",
Expand Down
6 changes: 0 additions & 6 deletions packages/config/generateCitation.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,3 @@ export default function generateCitation() {

return JSON.stringify(citationData);
}

// Execute and write to file
const citationData = generateCitationData();
fs.writeFileSync("citation-data.json", citationData);

console.log("Citation data generated and saved to citation-data.json");
5 changes: 2 additions & 3 deletions packages/config/rollup.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ const makeConfig = ({
const input = "src/index.ts";
const destinationDirectory = "dist";
const destination = `${destinationDirectory}/index`;
const citationData = JSON.parse(fs.readFileSync("citation-data.json", "utf-8"));

outputOptions = {
sourcemap: true,
Expand All @@ -45,8 +44,8 @@ const makeConfig = ({
/** @type{import("rollup-plugin-esbuild").Options} */
const esBuildPluginOptions = {
define: {
__APACITATION__: citationData.apa,
__BIBTEXCITATION__: citationData.bibtex,
__APACITATION__: generateCitation().apa,
__BIBTEXCITATION__: generateCitation().bibtex,
},
};

Expand Down

0 comments on commit 00d60fb

Please sign in to comment.