penrose 0.3.1 → 0.4.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/.github/workflows/ci.yaml +9 -4
- package/.pre-commit-config.yaml +7 -5
- package/Makefile +2 -2
- package/devenv.nix +1 -1
- package/lib/__tests__/penrose.test.js +3 -21
- package/package.json +6 -6
- package/pnpm-workspace.yaml +3 -0
|
@@ -17,13 +17,18 @@ jobs:
|
|
|
17
17
|
sudo apt-get install -y -qq graphicsmagick
|
|
18
18
|
|
|
19
19
|
- name: Install Node
|
|
20
|
-
uses: actions/setup-node@
|
|
20
|
+
uses: actions/setup-node@v6.4.0
|
|
21
21
|
with:
|
|
22
22
|
node-version: 24.15.0
|
|
23
|
-
|
|
23
|
+
|
|
24
|
+
- uses: pnpm/action-setup@v6.0.6
|
|
25
|
+
name: Install pnpm
|
|
26
|
+
with:
|
|
27
|
+
version: 10.33.4
|
|
28
|
+
cache: true
|
|
24
29
|
|
|
25
30
|
- name: Install Node dependencies
|
|
26
|
-
run:
|
|
31
|
+
run: pnpm install --frozen-lockfile
|
|
27
32
|
|
|
28
33
|
- name: Run Node tests
|
|
29
|
-
run:
|
|
34
|
+
run: pnpm run test
|
package/.pre-commit-config.yaml
CHANGED
|
@@ -14,9 +14,11 @@ repos:
|
|
|
14
14
|
language: system
|
|
15
15
|
files: \.nix$
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
- repo: https://github.com/pre-commit/mirrors-prettier
|
|
18
|
+
rev: v3.1.0
|
|
19
|
+
hooks:
|
|
20
|
+
- id: prettier
|
|
21
|
+
alias: prettier-js
|
|
22
|
+
name: prettier (js)
|
|
23
|
+
args: [--parser, babel, --write]
|
|
21
24
|
files: ^(lib)/.*\.(js|jsx|cjs|mjs)$
|
|
22
|
-
pass_filenames: true
|
package/Makefile
CHANGED
|
@@ -25,10 +25,10 @@ bump-version:
|
|
|
25
25
|
echo "Must be one of: $(CYAN)$$VALID_BUMP$(RESET)"; \
|
|
26
26
|
exit 1; \
|
|
27
27
|
fi; \
|
|
28
|
-
|
|
28
|
+
pnpm version $$BUMP;
|
|
29
29
|
|
|
30
30
|
create-release:
|
|
31
|
-
@VERSION=$$(
|
|
31
|
+
@VERSION=$$(pnpm pkg get version --browser=false | tr -d '"'); \
|
|
32
32
|
gh release create $$VERSION;
|
|
33
33
|
|
|
34
34
|
# Prevent make from treating arguments to bump-version as targets
|
package/devenv.nix
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import Promise from 'bluebird';
|
|
3
3
|
import fs from 'fs-extra';
|
|
4
|
-
import
|
|
4
|
+
import {glob} from 'glob';
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import {describe, expect, test} from 'vitest';
|
|
7
7
|
import {Penrose} from '../penrose';
|
|
@@ -30,24 +30,6 @@ describe('Penrose', () => {
|
|
|
30
30
|
|
|
31
31
|
const penrose = new Penrose(config);
|
|
32
32
|
|
|
33
|
-
/**
|
|
34
|
-
*
|
|
35
|
-
* @param {Array} patterns
|
|
36
|
-
* @param {Object} options
|
|
37
|
-
* @returns {Promise}
|
|
38
|
-
*/
|
|
39
|
-
function multiGlob(patterns, options) {
|
|
40
|
-
let matches = [];
|
|
41
|
-
|
|
42
|
-
return Promise.mapSeries(patterns, function (pattern) {
|
|
43
|
-
return globPromise(pattern, options).then(function (files) {
|
|
44
|
-
matches = matches.concat(files);
|
|
45
|
-
});
|
|
46
|
-
}).then(() => {
|
|
47
|
-
return Promise.resolve(matches);
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
33
|
describe('resolvePath', () => {
|
|
52
34
|
test('Should return expected path if URI has scheme', () => {
|
|
53
35
|
const actual = penrose.resolvePath('public://dir/file.jpg');
|
|
@@ -169,7 +151,7 @@ describe('Penrose', () => {
|
|
|
169
151
|
test('Should create derivative images', async () => {
|
|
170
152
|
await fs.remove(path.join(dir, 'data/files/styles'));
|
|
171
153
|
|
|
172
|
-
const files = await
|
|
154
|
+
const files = await glob(
|
|
173
155
|
_.map(config.schemes, function (scheme) {
|
|
174
156
|
return scheme.path + '**/*';
|
|
175
157
|
}),
|
|
@@ -194,7 +176,7 @@ describe('Penrose', () => {
|
|
|
194
176
|
return penrose.createDerivative(task.style, task.src, task.dist);
|
|
195
177
|
});
|
|
196
178
|
|
|
197
|
-
const actual = await
|
|
179
|
+
const actual = await glob(
|
|
198
180
|
_.map(config.schemes, function (scheme) {
|
|
199
181
|
return scheme.path + 'styles/**/*';
|
|
200
182
|
}),
|
package/package.json
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "penrose",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Build derivative images",
|
|
5
5
|
"main": "lib/penrose.js",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git://github.com/netbek/penrose.git"
|
|
9
9
|
},
|
|
10
|
-
"scripts": {
|
|
11
|
-
"test": "vitest run"
|
|
12
|
-
},
|
|
13
10
|
"author": {
|
|
14
11
|
"name": "Hein Bekker",
|
|
15
12
|
"email": "hein@netbek.co.za",
|
|
@@ -23,7 +20,6 @@
|
|
|
23
20
|
"bluebird": "3.7.2",
|
|
24
21
|
"chalk": "4.1.2",
|
|
25
22
|
"fs-extra": "11.3.5",
|
|
26
|
-
"glob-promise": "6.0.7",
|
|
27
23
|
"lodash": "4.18.1",
|
|
28
24
|
"prettier": "3.8.3",
|
|
29
25
|
"replace-ext": "2.0.0",
|
|
@@ -35,8 +31,12 @@
|
|
|
35
31
|
"eslint": "8.57.1",
|
|
36
32
|
"eslint-config-prettier": "9.1.2",
|
|
37
33
|
"eslint-plugin-prettier": "5.5.5",
|
|
34
|
+
"glob": "13.0.6",
|
|
38
35
|
"npm-check-updates": "22.1.1",
|
|
39
36
|
"typescript": "6.0.3",
|
|
40
37
|
"vitest": "3.2.4"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"test": "vitest run"
|
|
41
41
|
}
|
|
42
|
-
}
|
|
42
|
+
}
|