@jspsych/config 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -2
- package/gulp.js +56 -0
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
# @jspsych/config
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
4
|
-
|
|
3
|
+
## 1.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
5
6
|
|
|
7
|
+
- [#2357](https://github.com/jspsych/jsPsych/pull/2357) [`c44ac202`](https://github.com/jspsych/jsPsych/commit/c44ac2024ae51cf14efa60ca285bb2e4dc0ebef7) Thanks [@bjoluc](https://github.com/bjoluc)! - Add a VERSION.md file to the release archive created by the `createCoreDistArchive` Gulp task
|
|
6
8
|
|
|
9
|
+
## 1.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
7
12
|
|
|
8
13
|
- [`bc058590`](https://github.com/jspsych/jsPsych/commit/bc058590950285e52116f809e4ccc57bae5a67f5) Thanks [@bjoluc](https://github.com/bjoluc)! - Initial release
|
package/gulp.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { readFileSync } from "fs";
|
|
1
2
|
import { sep as pathSeparator } from "path";
|
|
2
3
|
|
|
4
|
+
import glob from "glob";
|
|
3
5
|
import gulp from "gulp";
|
|
6
|
+
import file from "gulp-file";
|
|
4
7
|
import rename from "gulp-rename";
|
|
5
8
|
import replace from "gulp-replace";
|
|
6
9
|
import zip from "gulp-zip";
|
|
@@ -8,6 +11,56 @@ import merge from "merge-stream";
|
|
|
8
11
|
|
|
9
12
|
const { dest, src } = gulp;
|
|
10
13
|
|
|
14
|
+
const readJsonFile = (filename) => JSON.parse(readFileSync(filename, "utf8"));
|
|
15
|
+
|
|
16
|
+
const getVersionFileContents = () =>
|
|
17
|
+
[
|
|
18
|
+
"Included in this release:\n",
|
|
19
|
+
"Package|Version|Documentation",
|
|
20
|
+
"--- | --- | ---",
|
|
21
|
+
...(() => {
|
|
22
|
+
const docsBaseUrl =
|
|
23
|
+
"https://www.jspsych.org/" +
|
|
24
|
+
readJsonFile("packages/jspsych/package.json").version.split(".").slice(0, -1).join(".") +
|
|
25
|
+
"/";
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
glob
|
|
29
|
+
// Get an array of all package.json filenames
|
|
30
|
+
.sync("packages/*/package.json")
|
|
31
|
+
|
|
32
|
+
// Map file names to package details
|
|
33
|
+
.map((filename) => {
|
|
34
|
+
const packageJson = readJsonFile(filename);
|
|
35
|
+
return {
|
|
36
|
+
name: packageJson.name,
|
|
37
|
+
version: packageJson.version,
|
|
38
|
+
};
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
// Filter packages that should not be listed
|
|
42
|
+
.filter(({ name }) => !["@jspsych/config", "@jspsych/test-utils"].includes(name))
|
|
43
|
+
|
|
44
|
+
// Move the core package to the top of the list
|
|
45
|
+
.sort(({ name: n1 }, { name: n2 }) => (n1 === "jspsych" ? -1 : n2 === "jspsych" ? 1 : 0))
|
|
46
|
+
|
|
47
|
+
// Map package details to MarkDown table row strings
|
|
48
|
+
.map(({ name, version }) => {
|
|
49
|
+
return `${name.replace("@jspsych/", "")}|${version}|${
|
|
50
|
+
name === "jspsych"
|
|
51
|
+
? docsBaseUrl
|
|
52
|
+
: name.startsWith("@jspsych/plugin-")
|
|
53
|
+
? docsBaseUrl + "plugins/" + name.replace("@jspsych/plugin-", "")
|
|
54
|
+
: name.startsWith("@jspsych/extension-")
|
|
55
|
+
? docsBaseUrl + "extensions/" + name.replace("@jspsych/extension-", "")
|
|
56
|
+
: ""
|
|
57
|
+
}`;
|
|
58
|
+
})
|
|
59
|
+
);
|
|
60
|
+
})(),
|
|
61
|
+
"",
|
|
62
|
+
].join("\n");
|
|
63
|
+
|
|
11
64
|
export const createCoreDistArchive = () =>
|
|
12
65
|
merge(
|
|
13
66
|
// index.browser.js files
|
|
@@ -44,6 +97,9 @@ export const createCoreDistArchive = () =>
|
|
|
44
97
|
)
|
|
45
98
|
),
|
|
46
99
|
|
|
100
|
+
// VERSION.md
|
|
101
|
+
file("VERSION.md", getVersionFileContents(), { src: true }),
|
|
102
|
+
|
|
47
103
|
// Other files
|
|
48
104
|
src(["*.md", "license.txt"])
|
|
49
105
|
)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jspsych/config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Shared (build) configuration for jsPsych packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"canvas": "2.8.0",
|
|
57
57
|
"gulp": "4.0.2",
|
|
58
58
|
"gulp-cli": "2.3.0",
|
|
59
|
+
"gulp-file": "^0.4.0",
|
|
59
60
|
"gulp-rename": "2.0.0",
|
|
60
61
|
"gulp-replace": "1.1.3",
|
|
61
62
|
"gulp-zip": "5.1.0",
|