Skip to content

Commit

Permalink
merge main and fix rollup conflict (remove iife only and add record a…
Browse files Browse the repository at this point in the history
…s external dependency)
  • Loading branch information
becky-gilbert committed Sep 3, 2024
2 parents ade4e1d + 96beb6b commit 224c9df
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 31 deletions.
43 changes: 35 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
"rollup-plugin-dotenv": "^0.5.1"
},
"peerDependencies": {
"jspsych": "^7.3.4"
"jspsych": "^8.0.2"
}
}
2 changes: 1 addition & 1 deletion packages/data/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DataCollection } from "jspsych/dist/modules/data/DataCollection";
import { DataCollection } from "jspsych";

export type ApiPromise = Promise<Data<Attributes> | Data<Attributes>[]>;

Expand Down
2 changes: 1 addition & 1 deletion packages/lookit-initjspsych/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@jspsych/config": "^2.0.0"
},
"peerDependencies": {
"jspsych": "^7.3.4"
"jspsych": "^8.0.2"
},
"optionalDependencies": {
"@rollup/rollup-linux-arm64-gnu": "^4.14.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/lookit-initjspsych/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DataCollection } from "jspsych/dist/modules/data/DataCollection";
import { DataCollection } from "jspsych";

export type UserFunc = (data: DataCollection) => void;

Expand Down
2 changes: 1 addition & 1 deletion packages/lookit-initjspsych/src/utils.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DataCollection } from "jspsych/dist/modules/data/DataCollection";
import { DataCollection } from "jspsych";

import { Child, PastSession, Study } from "@lookit/data/dist/types";
import { on_data_update, on_finish } from "./utils";
Expand Down
2 changes: 1 addition & 1 deletion packages/lookit-initjspsych/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Api from "@lookit/data";
import { LookitWindow } from "@lookit/data/dist/types";
import { DataCollection } from "jspsych/dist/modules/data/DataCollection";
import { DataCollection } from "jspsych";
import { UserFunc } from "./types";

declare let window: LookitWindow;
Expand Down
2 changes: 1 addition & 1 deletion packages/record/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@
"rollup-plugin-dotenv": "^0.5.1"
},
"peerDependencies": {
"jspsych": "^7.3.4"
"jspsych": "^8.0.2"
}
}
2 changes: 1 addition & 1 deletion packages/surveys/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@
"@types/dompurify": "^3.0.5"
},
"peerDependencies": {
"jspsych": "^7.3.4"
"jspsych": "^8.0.2"
}
}
27 changes: 12 additions & 15 deletions rollup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,19 @@ export function makeRollupConfig(iifeName) {
return jsPsychMakeRollupConfig(iifeName).map((config) => {
return {
...config,
// Add data package as external dependency
// Add data and record packages as external dependencys
external: [...config.external, dataPackageName, recordPackageName],
output: config.output
// Only build iife bundles
.filter((output) => output.format === "iife")
.map((output) => {
return {
...output,
globals: {
...output.globals,
// Explicitly state data's iife name
[dataPackageName]: dataPackageIifeName,
[recordPackageName]: recordPackageIifeName,
},
};
}),
output: config.output.map((output) => {
return {
...output,
globals: {
...output.globals,
// Explicitly state iife names
[dataPackageName]: dataPackageIifeName,
[recordPackageName]: recordPackageIifeName,
},
};
}),
};
});
}

0 comments on commit 224c9df

Please sign in to comment.