Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Bart Veneman committed Nov 10, 2024
1 parent ec2e02a commit 239a6d1
Show file tree
Hide file tree
Showing 10 changed files with 3,354 additions and 2 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: NPM Publish

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install --ignore-scripts --no-audit --no-fund
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: "npm"
registry-url: https://registry.npmjs.org/
- run: npm install --ignore-scripts --no-audit --no-fund
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
cache: 'npm'
- name: Install dependencies
run: npm install --ignore-scripts --no-audit --no-fund
- name: Unit tests
run: npm test
- name: Check types
run: npm run check
- name: Lint JS
run: npx oxlint@latest -D perf
- name: Build package
run: npm run build
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: 'Publint'
run: 'npx --yes publint'
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
coverage
dist
node_modules
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# css-layers
Discover the composition of your CSS @layers
# CSS Layers

Discover the composition of your CSS `@layer`s

WORK IN PROGRESS | CHECK BACK SOON
21 changes: 21 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import * as csstree from 'css-tree'

export function resolve_ast(ast) {

}

/**
*
* @param {string} css
* @returns
*/
export function resolve(css) {
let ast = csstree.parse(css, {
positions: true,
parseAtrulePrelude: true,
parseRulePrelude: false,
parseValue: false,
parseCustomProperty: false,
});
return resolve_ast(ast);
}
Loading

0 comments on commit 239a6d1

Please sign in to comment.