Skip to content

Commit 3ef3b4f

Browse files
committed
Updates, Actions, and more
1 parent eebc83b commit 3ef3b4f

File tree

8 files changed

+1143
-3
lines changed

8 files changed

+1143
-3
lines changed

.github/workflows/npm-publish.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish to npm
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
id-token: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '20.x'
20+
registry-url: 'https://registry.npmjs.org'
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Publish to npm
26+
run: npm publish --provenance --access public
27+
env:
28+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
29+
30+

.github/workflows/test.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '20.x'
19+
20+
- name: Install dependencies
21+
run: npm ci
22+
23+
- name: Run linter
24+
run: npm run lint
25+
26+
- name: Run example
27+
run: npm run example
28+
29+
- name: Compare example output with expected
30+
run: |
31+
if ! diff -u example/dist/output.css example/dist/output.expected.css; then
32+
echo "Error: Generated output doesn't match expected output!"
33+
exit 1
34+
fi
35+
echo "✓ Example output matches expected output"
36+
37+

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
node_modules/
2-
example/dist/
32
.DS_Store

eslint.config.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module.exports = [
2+
{
3+
ignores: ['node_modules/**', 'example/dist/**']
4+
},
5+
{
6+
languageOptions: {
7+
ecmaVersion: 'latest',
8+
sourceType: 'commonjs',
9+
globals: {
10+
require: 'readonly',
11+
module: 'readonly',
12+
process: 'readonly',
13+
__dirname: 'readonly',
14+
__filename: 'readonly',
15+
exports: 'readonly',
16+
console: 'readonly'
17+
}
18+
},
19+
rules: {
20+
'indent': ['error', 2],
21+
'quotes': ['error', 'single'],
22+
'semi': ['error', 'always']
23+
}
24+
}
25+
];
26+
27+

example/dist/output.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
:root {
2+
--bs-brand-color: #ff4757;
3+
--bs-fg: #333;
4+
--bs-bg: #ccc;
5+
--ignored: 42px;
6+
7+
color: light-dark(var(--bs-fg), var(--bs-bg));
8+
}
9+
10+
@supports (background: paint(squircle)) {
11+
@property --squircle-radius {
12+
syntax: '<length>';
13+
inherits: false;
14+
initial-value: 16px;
15+
}
16+
}
17+
18+
.button {
19+
color: var(--bs-brand-color);
20+
border-radius: var(--squircle-radius, 8px);
21+
padding: var(--ignored);
22+
}

example/dist/output.expected.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
:root {
2+
--bs-brand-color: #ff4757;
3+
--bs-fg: #333;
4+
--bs-bg: #ccc;
5+
--ignored: 42px;
6+
7+
color: light-dark(var(--bs-fg), var(--bs-bg));
8+
}
9+
10+
@supports (background: paint(squircle)) {
11+
@property --squircle-radius {
12+
syntax: '<length>';
13+
inherits: false;
14+
initial-value: 16px;
15+
}
16+
}
17+
18+
.button {
19+
color: var(--bs-brand-color);
20+
border-radius: var(--squircle-radius, 8px);
21+
padding: var(--ignored);
22+
}

0 commit comments

Comments
 (0)