Skip to content

Commit 239a6d1

Browse files
author
Bart Veneman
committed
init commit
1 parent ec2e02a commit 239a6d1

File tree

10 files changed

+3354
-2
lines changed

10 files changed

+3354
-2
lines changed

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3+
4+
name: NPM Publish
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: 20
18+
- run: npm install --ignore-scripts --no-audit --no-fund
19+
- run: npm test
20+
21+
publish-npm:
22+
needs: build
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-node@v4
27+
with:
28+
cache: "npm"
29+
registry-url: https://registry.npmjs.org/
30+
- run: npm install --ignore-scripts --no-audit --no-fund
31+
- run: npm run build
32+
- run: npm publish
33+
env:
34+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.github/workflows/test.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Tests
5+
6+
on:
7+
push:
8+
branches: [main]
9+
pull_request:
10+
branches: [main]
11+
12+
jobs:
13+
test:
14+
name: Unit tests
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Use Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
cache: 'npm'
22+
- name: Install dependencies
23+
run: npm install --ignore-scripts --no-audit --no-fund
24+
- name: Unit tests
25+
run: npm test
26+
- name: Check types
27+
run: npm run check
28+
- name: Lint JS
29+
run: npx oxlint@latest -D perf
30+
- name: Build package
31+
run: npm run build
32+
env:
33+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
34+
- name: 'Publint'
35+
run: 'npx --yes publint'
36+
- name: Upload coverage reports to Codecov
37+
uses: codecov/codecov-action@v4.0.1
38+
with:
39+
token: ${{ secrets.CODECOV_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
coverage
2+
dist
3+
node_modules

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
# css-layers
2-
Discover the composition of your CSS @layers
1+
# CSS Layers
2+
3+
Discover the composition of your CSS `@layer`s
4+
5+
WORK IN PROGRESS | CHECK BACK SOON

index.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import * as csstree from 'css-tree'
2+
3+
export function resolve_ast(ast) {
4+
5+
}
6+
7+
/**
8+
*
9+
* @param {string} css
10+
* @returns
11+
*/
12+
export function resolve(css) {
13+
let ast = csstree.parse(css, {
14+
positions: true,
15+
parseAtrulePrelude: true,
16+
parseRulePrelude: false,
17+
parseValue: false,
18+
parseCustomProperty: false,
19+
});
20+
return resolve_ast(ast);
21+
}

0 commit comments

Comments
 (0)