Skip to content

Commit b36d5ae

Browse files
authored
postcss-custom-media & css-tokenizer & media query parser (#627)
* init * init * consume a token * consume a comment * add reader * tweaks * postcss interop * wip * consume number * fix * fixes * more tests * basic tokenizer * fixes and docs * some more bits * some more bits * getting somewhere * string tokens * almost there * should be complete, text coverage up next * add context * fix * add parser error reporting * fixes and more tests * more tests * fixes * more tests * still more tests * still more tests * fix && more tests * more tests * more tests * docs * wip * postcss-custom-media * wip * fixes * fixes * fixes * cleanup whitespace * bring back old tests * more tests and fixes * update lock file * remove todo comment * fix 'or' conditions * correctly prefix with not * better code structure * fix negation for older browsers * cleanup * update test files * merge * media query list parser (#659) * wip * wip * wip * wip * wip * finish range * more work * lint * fix ranges * more work * media lists * finish parser * toJSON * add a test suite * more tests * wip * lint * more tests * wip * fix range parsing * docs * add ancestry utility * fixes * fixes * allow parsing from tokens * add some convenience methods * fixes * more migration * more convenience methods * more type predicates * wip * fix * fix * finish up * lets get rid of those build errors * fixes * fixes * increase test coverage * fix + more test coverage * getter -> method * fix build + more test coverage * export and more test coverage
1 parent 551a72c commit b36d5ae

File tree

407 files changed

+35355
-1543
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

407 files changed

+35355
-1543
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -47,49 +47,24 @@ jobs:
4747
with:
4848
node-version: ${{ matrix.node }}
4949

50-
- name: env
51-
run: |
52-
echo 'DIST_RESTORE_KEYS<<EOF' >> $GITHUB_ENV
53-
echo "$(git --no-pager log -9 --skip 1 --no-merges --pretty=format:'%H--test-dist-${{ matrix.node }}-${{ matrix.os }}')" >> $GITHUB_ENV
54-
echo 'EOF' >> $GITHUB_ENV
55-
echo "COMMIT_SHA=$(git --no-pager log -1 --no-merges --pretty=format:'%H')" >> $GITHUB_ENV
56-
echo "BUILD_AND_TEST_ALL_PACKAGES=$(echo ${{ github.event.inputs.run_index }})" >> $GITHUB_ENV
57-
58-
- name: previous build artifacts cache
59-
uses: actions/cache@v3.0.11
60-
with:
61-
path: |
62-
.cached-commit
63-
cli/*/dist/**
64-
experimental/*/dist/**
65-
packages/*/dist/**
66-
plugin-packs/*/dist/**
67-
plugins/*/dist/**
68-
key: ${{ env.COMMIT_SHA }}--test-dist-${{ matrix.node }}-${{ matrix.os }}
69-
restore-keys: ${{ env.DIST_RESTORE_KEYS }}
70-
7150
- name: npm ci
7251
run: |
7352
npm ci --ignore-scripts
7453
75-
- name: determine modified workspaces
76-
run: |
77-
echo "MODIFIED_WORKSPACES=$(node './.github/bin/modified-workspaces/log-modified-workspaces.mjs')" >> $GITHUB_ENV
78-
7954
# Build, lint and PostCSS Tape tests must all work and pass :
8055
# - with exact dependencies from package-lock.json
8156
# - without requiring postinstall scripts from dependencies to run
8257
- name: build
8358
run: |
84-
npm run build --if-present $MODIFIED_WORKSPACES
59+
npm run build --if-present
8560
8661
- name: lint
87-
run: npm run lint --if-present $MODIFIED_WORKSPACES
62+
run: npm run lint --if-present
8863
if: matrix.is_base_node_version && matrix.is_base_os_version
8964

9065
# Basic tests
9166
- name: test
92-
run: npm run test --if-present $MODIFIED_WORKSPACES
67+
run: npm run test --if-present
9368
env:
9469
ENABLE_ANNOTATIONS_FOR_NODE: ${{ matrix.is_base_node_version }}
9570
ENABLE_ANNOTATIONS_FOR_OS: ${{ matrix.is_base_os_version }}
@@ -99,14 +74,14 @@ jobs:
9974
- name: test:cli
10075
run: |
10176
npm install --ignore-scripts
102-
npm run test:cli --if-present $MODIFIED_WORKSPACES
77+
npm run test:cli --if-present
10378
10479
# Browser Tests
10580
# running "npm ci" again, but allowing scripts so that Chrome is installed
10681
- name: test:browser
10782
run: |
10883
npm ci
109-
npm run test:browser --if-present $MODIFIED_WORKSPACES
84+
npm run test:browser --if-present
11085
if: matrix.is_base_node_version && matrix.is_base_os_version
11186

11287
# E2E Tests
@@ -125,11 +100,5 @@ jobs:
125100
if: matrix.is_base_node_version && matrix.is_base_os_version
126101

127102
- name: test:deno
128-
run: npm run test:deno --if-present $MODIFIED_WORKSPACES
103+
run: npm run test:deno --if-present
129104
if: matrix.is_base_node_version && matrix.is_base_os_version
130-
131-
# record the current commit for the cache at the end of the job
132-
# must be the last step
133-
- name: record current commit
134-
run: |
135-
echo "$(git --no-pager log -1 --no-merges --pretty=format:'%H')" > .cached-commit

package-lock.json

Lines changed: 120 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
"node": "^14 || ^16 || >=18"
1010
},
1111
"workspaces": [
12+
"packages/css-tokenizer",
13+
"packages/css-parser-algorithms",
14+
"packages/media-query-list-parser",
1215
"packages/*",
1316
"plugins/postcss-progressive-custom-properties",
1417
"plugins/*",
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
package-lock.json
3+
yarn.lock
4+
*.result.css
5+
*.result.css.map
6+
*.result.json
7+
dist/*

packages/css-parser-algorithms/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v16.13.1
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### 1.0.0
2+
3+
- Initial version
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The MIT License (MIT)
2+
3+
Copyright 2022 Romain Menke, Antonio Laguna <antonio@laguna.es>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)