Skip to content

Commit 355383a

Browse files
authored
Merge pull request #142 from readium/npm-upgrade
Npm upgrade
2 parents b1392b9 + fbe0465 commit 355383a

4 files changed

Lines changed: 3347 additions & 4123 deletions

File tree

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,46 @@ There is no external implementation of Readium CSS so far.
4646

4747
Consequently, if you are encountering rendering issues with Readium (iOS apps, Android apps, or the Readium Chrome App), please report them on the [github section dedicated to the proper Readium project](https://github.com/readium) (readium-js, readium-shared-js, readium-sdk, etc.).
4848

49+
## Development
50+
51+
Active development is pulled in branch `develop` first, and then made available in the main branch when sufficiently tested and deemed stable.
52+
53+
### Init
54+
55+
Building and testing are relying on npm packages and scripts. To initialize your clone/fork, first install dev dependencies:
56+
57+
```
58+
npm install
59+
```
60+
61+
In case you’re encountering an error with Puppeteer, make sure you’re using at least Node v.20.11.1 – it might work with an earlier version but only the latest LTS as of March 21, 2024 has been tested.
62+
63+
Then create reference bitmaps for visual regression testing:
64+
65+
```
66+
npm run test:ref
67+
```
68+
69+
### Build
70+
71+
To transpile all stylesheets using PostCSS:
72+
73+
```
74+
npm run build
75+
```
76+
77+
To test the updated styles and catch visual regression bugs:
78+
79+
```
80+
npm run test
81+
```
82+
83+
To update reference bitmaps after a bugfix:
84+
85+
```
86+
npm run test:approve
87+
```
88+
4989
## Docs
5090

5191
Documentation [can be accessed in docs](docs).

css/postcss.config.js

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,36 +19,33 @@ module.exports = (ctx) => ({
1919
"message": "Please remove empty comments."
2020
}]
2121
, "number-max-precision": 4
22-
, "unit-blacklist": [ ["pt"], {
22+
, "unit-disallowed-list": [ ["pt"], {
2323
"message": "Sorry, this unit is not allowed. Please use another one."
2424
, "severity": "error"
2525
}]
2626
, "custom-property-pattern": [ "(RS|USER)__.+", {
2727
"message": "It looks like you’re using a CSS variable prefix which is not supported. It should either start with “--RS__” or “--USER__”."
2828
, "severity": "error"
2929
}]
30-
, "selector-max-empty-lines": 0
3130
, "color-hex-length": [ "long", {
3231
"message": "We recommend using long color HEX to prevent unexpected issues."
3332
}]
3433
, "font-family-name-quotes": [ "always-where-recommended", {
3534
"message": "If looks like there are spaces or digits in your “font-family”, please use quotes."
3635
}]
3736
, "function-url-quotes": "always"
38-
, "number-leading-zero": "always"
39-
, "number-no-trailing-zeros": true
4037
, "length-zero-no-unit": [ true, {
4138
"message": "The value of this property being 0, you don’t need an unit. Please remove it."
4239
}]
43-
, "unit-case": "lower"
40+
, "selector-type-case": "lower"
41+
, "function-name-case": "lower"
42+
, "value-keyword-case": "lower"
4443
, "selector-attribute-quotes": "always"
4544
, "comment-whitespace-inside": "always"
46-
, "max-empty-lines": 1
47-
, "indentation": [ 2, {
48-
"message": "You should use 2 spaces to indent."
49-
}]
45+
, "at-rule-empty-line-before": "always"
46+
, "comment-empty-line-before": "always"
47+
, "rule-empty-line-before": "always"
5048
, "no-duplicate-at-import-rules": true
51-
, "no-extra-semicolons": true
5249
, "no-invalid-double-slash-comments": [ true, {
5350
"message": "It looks like you’re using single-line JS comments. This is CSS, you can’t use that."
5451
, "severity": "error"
@@ -57,13 +54,6 @@ module.exports = (ctx) => ({
5754
"message": "We’re using Vanilla CSS with PostCSS and our current configuration doesn’t allow nesting selectors as in LESS or SASS."
5855
, "severity": "error"
5956
}]
60-
, "string-quotes": "double"
61-
, "declaration-bang-space-before": [ "always", {
62-
"message": "Please put a space before !important as it will improve readability."
63-
}]
64-
, "block-closing-brace-newline-after": "always"
65-
, "block-opening-brace-newline-after": "always"
66-
, "selector-list-comma-newline-after": "always-multi-line"
6757
}
6858
}
6959
}),
@@ -234,10 +224,6 @@ module.exports = (ctx) => ({
234224
],
235225
"unspecified-properties-position": "bottomAlphabetical"
236226
}),
237-
require("postcss-clean")({
238-
advanced: false,
239-
roundingPrecision: 3
240-
}),
241227
require("postcss-header")({
242228
header: `/*\n * Readium CSS (v. ${version})\n * Developers: Jiminy Panoz \n * Copyright (c) 2017. Readium Foundation. All rights reserved.\n * Use of this source code is governed by a BSD-style license which is detailed in the\n * LICENSE file present in the project repository where this source code is maintained.\n*/`
243229
})

0 commit comments

Comments
 (0)