@static-suite/static-suite-data-server 2.0.4 → 2.0.8
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/.github/workflows/publish-to-npm.yml +35 -0
- package/.github/workflows/update-dependencies.yml +46 -0
- package/.husky/pre-commit +1 -0
- package/README.md +1 -1
- package/dist/http/README.md +1 -1
- package/dist/http/routes/dump.d.ts.map +1 -1
- package/dist/http/routes/dump.js +0 -4
- package/dist/lib/store/dump/dump.types.d.ts +0 -5
- package/dist/lib/store/dump/dump.types.d.ts.map +1 -1
- package/dist/lib/store/dump/dumpManager.d.ts.map +1 -1
- package/dist/lib/store/dump/dumpManager.js +0 -1
- package/package.json +2 -2
- package/src/http/routes/dump.ts +0 -4
- package/src/lib/store/dump/dump.types.ts +0 -7
- package/src/lib/store/dump/dumpManager.ts +0 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Publish to npm whenever a tag is pushed
|
|
2
|
+
name: Publish to NPM
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
push:
|
|
6
|
+
tags: v*
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
node-version: [26]
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
id-token: write
|
|
18
|
+
steps:
|
|
19
|
+
- name: Check out repository
|
|
20
|
+
uses: actions/checkout@v7
|
|
21
|
+
|
|
22
|
+
- name: Set up Node ${{ matrix.node-version }}
|
|
23
|
+
uses: actions/setup-node@v7
|
|
24
|
+
with:
|
|
25
|
+
node-version: ${{ matrix.node-version }}
|
|
26
|
+
registry-url: 'https://registry.npmjs.org'
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: yarn install --frozen-lockfile
|
|
30
|
+
|
|
31
|
+
- name: Run tests
|
|
32
|
+
run: yarn test
|
|
33
|
+
|
|
34
|
+
- name: Publish to NPM
|
|
35
|
+
run: npm publish --access public
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Update dependencies, commit them and create a new tag
|
|
2
|
+
name: Update dependencies
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
schedule:
|
|
6
|
+
- cron: '30 6 * * *' # every day at 06:30 UTC
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
update:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
strategy:
|
|
16
|
+
matrix:
|
|
17
|
+
node-version: [26]
|
|
18
|
+
steps:
|
|
19
|
+
- name: Check out repository
|
|
20
|
+
uses: actions/checkout@v7
|
|
21
|
+
|
|
22
|
+
- name: Set up Node ${{ matrix.node-version }}
|
|
23
|
+
uses: actions/setup-node@v7
|
|
24
|
+
with:
|
|
25
|
+
node-version: ${{ matrix.node-version }}
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: yarn install --frozen-lockfile
|
|
29
|
+
|
|
30
|
+
- name: Update dependencies
|
|
31
|
+
run: yarn upgrade
|
|
32
|
+
|
|
33
|
+
- name: Commit files
|
|
34
|
+
run: |
|
|
35
|
+
if [ -z "$(git status --porcelain)" ]; then
|
|
36
|
+
echo "No changes detected, nothing to commit."
|
|
37
|
+
exit 0
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
echo "Changes detected, committing them."
|
|
41
|
+
git config user.name "github-actions[bot]"
|
|
42
|
+
git config user.email "{user.id}+{user.login}[bot]@users.noreply.github.com"
|
|
43
|
+
git add -A
|
|
44
|
+
git commit -m "chore: update dependencies"
|
|
45
|
+
npm version patch -m "chore: version %s"
|
|
46
|
+
git push
|
package/.husky/pre-commit
CHANGED
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A flexible, fast and developer friendly Data Server for [Static Suite](https://www.drupal.org/project/static_suite).
|
|
4
4
|
|
|
5
|
-
- flexible: it honors the structure of Static Suite's data directory,
|
|
5
|
+
- flexible: it honors the structure of Static Suite's data directory, not imposing any opinionated structure. Every directory and its contents can be retrieved as simple arrays, and therefore queried using common [array functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) like `filter()`, `find()`, `forEach()`, etc.
|
|
6
6
|
- fast: on a cold start, ~20k json files are usually loaded in ~2 seconds. Queries take ~1 ms, depending on their complexity. Once queries are cached, it executes ~150k queries per second.
|
|
7
7
|
- developer friendly: when run in `dev` mode, changes made to queries or hooks (more on this later) are automatically reloaded. Queries are easy to create (they are just a function) and debug using a HTTP endpoint.
|
|
8
8
|
|
package/dist/http/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A flexible, fast and developer friendly Data Server for [Static Suite](https://www.drupal.org/project/static_suite).
|
|
4
4
|
|
|
5
|
-
- flexible: it honors the structure of Static Suite's data directory,
|
|
5
|
+
- flexible: it honors the structure of Static Suite's data directory, not imposing any opinionated structure. Every directory and its contents can be retrieved as simple arrays, and therefore queried using common [array functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) like `filter()`, `find()`, `forEach()`, etc.
|
|
6
6
|
- fast: on a cold start, ~20k json files are usually loaded in ~2 seconds. Queries take ~1 ms, depending on their complexity. Once queries are cached, it executes ~150k queries per second.
|
|
7
7
|
- developer friendly: when run in `dev` mode, changes made to queries or hooks (more on this later) are automatically reloaded. Queries are easy to create (they are just a function) and debug using a HTTP endpoint.
|
|
8
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dump.d.ts","sourceRoot":"","sources":["../../../src/http/routes/dump.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAK5C,QAAA,MAAM,SAAS,GAAI,KAAK,OAAO,EAAE,KAAK,QAAQ,KAAG,IAShD,CAAC;
|
|
1
|
+
{"version":3,"file":"dump.d.ts","sourceRoot":"","sources":["../../../src/http/routes/dump.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAK5C,QAAA,MAAM,SAAS,GAAI,KAAK,OAAO,EAAE,KAAK,QAAQ,KAAG,IAShD,CAAC;AAeF,QAAA,MAAM,eAAe,GAAU,KAAK,OAAO,EAAE,KAAK,QAAQ,KAAG,OAAO,CAAC,IAAI,CAExE,CAAC;AAEF,QAAA,MAAM,QAAQ,GAAU,KAAK,OAAO,EAAE,KAAK,QAAQ,KAAG,OAAO,CAAC,IAAI,CAEjE,CAAC;AASF,QAAA,MAAM,gBAAgB,GAAI,KAAK,OAAO,EAAE,KAAK,QAAQ,KAAG,IAIvD,CAAC;AAEF,QAAA,MAAM,iBAAiB,GAAI,KAAK,OAAO,EAAE,KAAK,QAAQ,KAAG,IAQxD,CAAC;AAEF,OAAO,EACL,SAAS,EACT,eAAe,EACf,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,GAClB,CAAC"}
|
package/dist/http/routes/dump.js
CHANGED
|
@@ -22,10 +22,6 @@ exports.dumpIndex = dumpIndex;
|
|
|
22
22
|
const dumpAction = async (req, res, incremental) => {
|
|
23
23
|
const dump = await dump_1.dumpManager.dump({ incremental });
|
|
24
24
|
const dumpAsJson = (0, object_1.jsonify)(dump);
|
|
25
|
-
const args = req.query;
|
|
26
|
-
if (args?.noDiff !== undefined) {
|
|
27
|
-
delete dumpAsJson.diff;
|
|
28
|
-
}
|
|
29
25
|
res.status(200);
|
|
30
26
|
res.set({ 'Content-Type': 'application/json' });
|
|
31
27
|
res.send(dumpAsJson);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Diff } from '../diff/diff.types';
|
|
2
1
|
/**
|
|
3
2
|
* Service that dumps resolved data (with resolved includes) into a dump directory.
|
|
4
3
|
*/
|
|
@@ -63,10 +62,6 @@ export type Dump = {
|
|
|
63
62
|
oldPublicUrl: string | null;
|
|
64
63
|
newPublicUrl: null;
|
|
65
64
|
}>;
|
|
66
|
-
/**
|
|
67
|
-
* The diff used to generate this dump.
|
|
68
|
-
*/
|
|
69
|
-
diff: Diff;
|
|
70
65
|
};
|
|
71
66
|
export type DumpMetadata = {
|
|
72
67
|
current: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dump.types.d.ts","sourceRoot":"","sources":["../../../../src/lib/store/dump/dump.types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"dump.types.d.ts","sourceRoot":"","sources":["../../../../src/lib/store/dump/dump.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE;QAAE,WAAW,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExD;;;;;;;OAOG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG;IACjB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,OAAO,EAAE,GAAG,CACV,MAAM,EACN;QAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAC7D,CAAC;IAEF;;;;;OAKG;IACH,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,YAAY,EAAE,IAAI,CAAA;KAAE,CAAC,CAAC;CAC3E,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dumpManager.d.ts","sourceRoot":"","sources":["../../../../src/lib/store/dump/dumpManager.ts"],"names":[],"mappings":"AASA,OAAO,EAAQ,WAAW,EAAE,MAAM,cAAc,CAAC;AAqKjD,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"dumpManager.d.ts","sourceRoot":"","sources":["../../../../src/lib/store/dump/dumpManager.ts"],"names":[],"mappings":"AASA,OAAO,EAAQ,WAAW,EAAE,MAAM,cAAc,CAAC;AAqKjD,eAAO,MAAM,WAAW,EAAE,WA8EzB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@static-suite/static-suite-data-server",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8",
|
|
4
4
|
"description": "A flexible, fast and developer friendly Data Server for Static Suite",
|
|
5
5
|
"main": "./dist/lib/index.js",
|
|
6
6
|
"typings": "./dist/lib/index.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"lint": "eslint .",
|
|
39
39
|
"docs": "yarn typedoc --out docs src/lib/",
|
|
40
40
|
"prettier-format": "prettier --config .prettierrc 'src/**/*.ts' --write",
|
|
41
|
-
"test": "jest
|
|
41
|
+
"test": "jest",
|
|
42
42
|
"copy-http-files-to-src": "node ./scripts/copy-http-files-to-src.mjs",
|
|
43
43
|
"copy-http-files-to-dist": "mkdir -p ./dist/http/ && cp -r ./src/http/public/ ./dist/http/ && cp -r ./src/http/views/ ./dist/http/ && cp README.md ./dist/http/",
|
|
44
44
|
"prepare": "husky"
|
package/src/http/routes/dump.ts
CHANGED
|
@@ -22,10 +22,6 @@ const dumpAction = async (
|
|
|
22
22
|
): Promise<void> => {
|
|
23
23
|
const dump = await dumpManager.dump({ incremental });
|
|
24
24
|
const dumpAsJson: any = jsonify(dump);
|
|
25
|
-
const args: any = req.query;
|
|
26
|
-
if (args?.noDiff !== undefined) {
|
|
27
|
-
delete dumpAsJson.diff;
|
|
28
|
-
}
|
|
29
25
|
|
|
30
26
|
res.status(200);
|
|
31
27
|
res.set({ 'Content-Type': 'application/json' });
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Diff } from '../diff/diff.types';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* Service that dumps resolved data (with resolved includes) into a dump directory.
|
|
5
3
|
*/
|
|
@@ -65,11 +63,6 @@ export type Dump = {
|
|
|
65
63
|
* deleted. We keep the same structure for both updated and deleted items.
|
|
66
64
|
*/
|
|
67
65
|
deleted: Map<string, { oldPublicUrl: string | null; newPublicUrl: null }>;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* The diff used to generate this dump.
|
|
71
|
-
*/
|
|
72
|
-
diff: Diff;
|
|
73
66
|
};
|
|
74
67
|
|
|
75
68
|
export type DumpMetadata = {
|