@seyuna/postcss 0.0.1-dev.9 → 1.0.0-canary.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/release.yml +19 -134
- package/CHANGELOG.md +13 -0
- package/dist/at-rules/dark.d.ts +1 -1
- package/dist/at-rules/dark.js +20 -5
- package/dist/at-rules/light.d.ts +1 -1
- package/dist/at-rules/light.js +20 -5
- package/package.json +16 -5
- package/release.config.mjs +32 -0
- package/src/at-rules/dark.ts +27 -6
- package/src/at-rules/light.ts +27 -6
|
@@ -1,156 +1,41 @@
|
|
|
1
|
-
name:
|
|
1
|
+
name: Release
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
5
|
branches:
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
- dev
|
|
9
|
-
workflow_dispatch:
|
|
6
|
+
- main
|
|
7
|
+
- canary
|
|
10
8
|
|
|
11
9
|
permissions:
|
|
12
10
|
contents: write
|
|
11
|
+
issues: write
|
|
12
|
+
pull-requests: write
|
|
13
13
|
id-token: write
|
|
14
14
|
|
|
15
15
|
jobs:
|
|
16
|
-
|
|
17
|
-
name:
|
|
16
|
+
release:
|
|
17
|
+
name: Semantic Release
|
|
18
18
|
runs-on: ubuntu-latest
|
|
19
|
-
outputs:
|
|
20
|
-
version: ${{ steps.version.outputs.version }}
|
|
21
|
-
|
|
22
19
|
steps:
|
|
23
|
-
-
|
|
24
|
-
uses: actions/checkout@v4
|
|
25
|
-
|
|
26
|
-
- name: Read version from package.json
|
|
27
|
-
id: version
|
|
28
|
-
run: |
|
|
29
|
-
VERSION=$(node -p "require('./package.json').version")
|
|
30
|
-
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
31
|
-
|
|
32
|
-
- name: Set up Node.js
|
|
33
|
-
uses: actions/setup-node@v4
|
|
34
|
-
with:
|
|
35
|
-
node-version: 20
|
|
36
|
-
registry-url: https://registry.npmjs.org
|
|
37
|
-
|
|
38
|
-
- name: Install dependencies
|
|
39
|
-
run: npm ci
|
|
40
|
-
|
|
41
|
-
- name: Build TypeScript
|
|
42
|
-
run: npm run build
|
|
43
|
-
|
|
44
|
-
- name: List dist contents before upload
|
|
45
|
-
run: ls -l dist
|
|
46
|
-
|
|
47
|
-
- name: Upload build artifact
|
|
48
|
-
uses: actions/upload-artifact@v4
|
|
20
|
+
- uses: actions/checkout@v4
|
|
49
21
|
with:
|
|
50
|
-
|
|
51
|
-
path: dist
|
|
22
|
+
fetch-depth: 0
|
|
52
23
|
|
|
53
|
-
|
|
54
|
-
name: Publish to npm
|
|
55
|
-
runs-on: ubuntu-latest
|
|
56
|
-
needs: build
|
|
57
|
-
|
|
58
|
-
steps:
|
|
59
|
-
- name: Checkout repository
|
|
60
|
-
uses: actions/checkout@v4
|
|
61
|
-
|
|
62
|
-
- name: Set up Node.js
|
|
24
|
+
- name: Setup Node.js with npm auth
|
|
63
25
|
uses: actions/setup-node@v4
|
|
64
26
|
with:
|
|
65
27
|
node-version: 20
|
|
66
|
-
registry-url: https://registry.npmjs.org
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
name: plugin-dist
|
|
72
|
-
path: dist
|
|
73
|
-
|
|
74
|
-
- name: Authenticate with npm
|
|
75
|
-
run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
|
|
76
|
-
|
|
77
|
-
- name: Determine npm tag
|
|
78
|
-
id: tag
|
|
79
|
-
run: |
|
|
80
|
-
BRANCH="${GITHUB_REF##*/}"
|
|
81
|
-
if [ "$BRANCH" = "stable" ]; then
|
|
82
|
-
echo "tag=latest" >> $GITHUB_OUTPUT
|
|
83
|
-
else
|
|
84
|
-
echo "tag=$BRANCH" >> $GITHUB_OUTPUT
|
|
85
|
-
fi
|
|
28
|
+
registry-url: https://registry.npmjs.org/
|
|
29
|
+
scope: "@seyuna"
|
|
30
|
+
always-auth: true
|
|
31
|
+
env:
|
|
32
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
86
33
|
|
|
87
34
|
- name: Install dependencies
|
|
88
35
|
run: npm ci
|
|
89
36
|
|
|
90
|
-
- name:
|
|
91
|
-
id: version_check
|
|
92
|
-
run: |
|
|
93
|
-
PKG_NAME=$(node -p "require('./package.json').name")
|
|
94
|
-
PKG_VERSION=$(node -p "require('./package.json').version")
|
|
95
|
-
if npm view "$PKG_NAME@$PKG_VERSION" > /dev/null 2>&1; then
|
|
96
|
-
echo "exists=true" >> $GITHUB_OUTPUT
|
|
97
|
-
else
|
|
98
|
-
echo "exists=false" >> $GITHUB_OUTPUT
|
|
99
|
-
fi
|
|
100
|
-
|
|
101
|
-
- name: Publish package
|
|
102
|
-
if: steps.version_check.outputs.exists != 'true'
|
|
103
|
-
run: npm publish --access public --tag ${{ steps.tag.outputs.tag }}
|
|
104
|
-
|
|
105
|
-
release:
|
|
106
|
-
name: Create GitHub Release
|
|
107
|
-
runs-on: ubuntu-latest
|
|
108
|
-
needs: [build, publish]
|
|
109
|
-
|
|
110
|
-
steps:
|
|
111
|
-
- name: Checkout repository
|
|
112
|
-
uses: actions/checkout@v4
|
|
113
|
-
|
|
114
|
-
- name: Download build artifact
|
|
115
|
-
uses: actions/download-artifact@v4
|
|
116
|
-
with:
|
|
117
|
-
name: plugin-dist
|
|
118
|
-
path: dist
|
|
119
|
-
|
|
120
|
-
- name: Generate changelog
|
|
121
|
-
run: |
|
|
122
|
-
last_tag=$(git tag --sort=-creatordate | grep '^v' | grep -v "v${{ needs.build.outputs.version }}" | head -n 1)
|
|
123
|
-
|
|
124
|
-
if [ -z "$last_tag" ]; then
|
|
125
|
-
changelog=$(git log --merges --pretty=format:"* %s (%h)")
|
|
126
|
-
else
|
|
127
|
-
changelog=$(git log "$last_tag"..HEAD --merges --pretty=format:"* %s (%h)")
|
|
128
|
-
fi
|
|
129
|
-
|
|
130
|
-
{
|
|
131
|
-
echo "Automated release for version v${{ needs.build.outputs.version }}"
|
|
132
|
-
echo ""
|
|
133
|
-
echo "## Changes"
|
|
134
|
-
echo ""
|
|
135
|
-
echo "$changelog"
|
|
136
|
-
} > RELEASE_NOTES.md
|
|
137
|
-
|
|
138
|
-
- name: Check if GitHub release exists
|
|
139
|
-
id: release_check
|
|
140
|
-
run: |
|
|
141
|
-
if gh release view "v${{ needs.build.outputs.version }}" >/dev/null 2>&1; then
|
|
142
|
-
echo "exists=true" >> $GITHUB_OUTPUT
|
|
143
|
-
else
|
|
144
|
-
echo "exists=false" >> $GITHUB_OUTPUT
|
|
145
|
-
fi
|
|
146
|
-
env:
|
|
147
|
-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
148
|
-
|
|
149
|
-
- name: Create GitHub Release
|
|
150
|
-
if: steps.release_check.outputs.exists != 'true'
|
|
151
|
-
run: |
|
|
152
|
-
gh release create "v${{ needs.build.outputs.version }}" \
|
|
153
|
-
--title "v${{ needs.build.outputs.version }}" \
|
|
154
|
-
--notes-file RELEASE_NOTES.md
|
|
37
|
+
- name: Run Semantic Release
|
|
155
38
|
env:
|
|
156
|
-
|
|
39
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
40
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
41
|
+
run: npx semantic-release
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# [1.0.0-canary.2](https://github.com/seyuna-corp/seyuna-postcss/compare/v1.0.0-canary.1...v1.0.0-canary.2) (2025-08-08)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* added os mode selectors to dark and light at-rules ([aab8f42](https://github.com/seyuna-corp/seyuna-postcss/commit/aab8f42f05d8bfedf45b19352134254f2da4d9f0))
|
|
7
|
+
|
|
8
|
+
# 1.0.0-canary.1 (2025-08-07)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* Clone all child nodes inside [@rules](https://github.com/rules) to prevent them from being detached ([6697d34](https://github.com/seyuna-corp/seyuna-postcss/commit/6697d34e604b1de1f319eee060604c4efc201251))
|
package/dist/at-rules/dark.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AtRule } from "postcss";
|
|
2
2
|
export default function dark(atRule: AtRule): void;
|
package/dist/at-rules/dark.js
CHANGED
|
@@ -3,11 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = dark;
|
|
4
4
|
const postcss_1 = require("postcss");
|
|
5
5
|
function dark(atRule) {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const clonedNodes = [];
|
|
7
|
+
// Clone all child nodes so we can reuse them
|
|
8
|
+
atRule.each((node) => {
|
|
9
|
+
clonedNodes.push(node.clone());
|
|
10
|
+
});
|
|
11
|
+
// Create `[data-mode="dark"] &` rule
|
|
12
|
+
const dataAttrRule = new postcss_1.Rule({
|
|
8
13
|
selector: `[data-mode="dark"] &`,
|
|
9
|
-
nodes: atRule.nodes, // move children inside
|
|
10
14
|
});
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
clonedNodes.forEach((node) => dataAttrRule.append(node.clone()));
|
|
16
|
+
// Create `@media (prefers-color-scheme: dark)` wrapper
|
|
17
|
+
const mediaAtRule = new postcss_1.AtRule({
|
|
18
|
+
name: "media",
|
|
19
|
+
params: "(prefers-color-scheme: dark)",
|
|
20
|
+
});
|
|
21
|
+
const mediaRule = new postcss_1.Rule({
|
|
22
|
+
selector: `&`,
|
|
23
|
+
});
|
|
24
|
+
clonedNodes.forEach((node) => mediaRule.append(node.clone()));
|
|
25
|
+
mediaAtRule.append(mediaRule);
|
|
26
|
+
// Replace original @dark rule with both new rules
|
|
27
|
+
atRule.replaceWith(dataAttrRule, mediaAtRule);
|
|
13
28
|
}
|
package/dist/at-rules/light.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AtRule } from "postcss";
|
|
2
2
|
export default function light(atRule: AtRule): void;
|
package/dist/at-rules/light.js
CHANGED
|
@@ -3,11 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = light;
|
|
4
4
|
const postcss_1 = require("postcss");
|
|
5
5
|
function light(atRule) {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const clonedNodes = [];
|
|
7
|
+
// Clone all child nodes so we can reuse them
|
|
8
|
+
atRule.each((node) => {
|
|
9
|
+
clonedNodes.push(node.clone());
|
|
10
|
+
});
|
|
11
|
+
// Create `[data-mode="light"] &` rule
|
|
12
|
+
const dataAttrRule = new postcss_1.Rule({
|
|
8
13
|
selector: `[data-mode="light"] &`,
|
|
9
|
-
nodes: atRule.nodes, // move children inside
|
|
10
14
|
});
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
clonedNodes.forEach((node) => dataAttrRule.append(node.clone()));
|
|
16
|
+
// Create `@media (prefers-color-scheme: light)` wrapper
|
|
17
|
+
const mediaAtRule = new postcss_1.AtRule({
|
|
18
|
+
name: "media",
|
|
19
|
+
params: "(prefers-color-scheme: light)",
|
|
20
|
+
});
|
|
21
|
+
const mediaRule = new postcss_1.Rule({
|
|
22
|
+
selector: `&`,
|
|
23
|
+
});
|
|
24
|
+
clonedNodes.forEach((node) => mediaRule.append(node.clone()));
|
|
25
|
+
mediaAtRule.append(mediaRule);
|
|
26
|
+
// Replace original @light rule with both new rules
|
|
27
|
+
atRule.replaceWith(dataAttrRule, mediaAtRule);
|
|
13
28
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seyuna/postcss",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "1.0.0-canary.2",
|
|
4
4
|
"description": "Seyuna UI's postcss plugin",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"build": "tsc"
|
|
9
|
-
"prepare": "npm run build"
|
|
8
|
+
"build": "tsc"
|
|
10
9
|
},
|
|
11
10
|
"keywords": [
|
|
12
11
|
"postcss",
|
|
@@ -14,12 +13,24 @@
|
|
|
14
13
|
"seyuna"
|
|
15
14
|
],
|
|
16
15
|
"license": "MIT",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/seyuna-corp/seyuna-postcss.git"
|
|
19
|
+
},
|
|
17
20
|
"peerDependencies": {
|
|
18
21
|
"postcss": "^8.5.6"
|
|
19
22
|
},
|
|
20
23
|
"devDependencies": {
|
|
24
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
25
|
+
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
26
|
+
"@semantic-release/exec": "^7.1.0",
|
|
27
|
+
"@semantic-release/git": "^10.0.1",
|
|
28
|
+
"@semantic-release/github": "^11.0.3",
|
|
29
|
+
"@semantic-release/npm": "^12.0.2",
|
|
30
|
+
"@semantic-release/release-notes-generator": "^14.0.3",
|
|
21
31
|
"@types/node": "^20.0.0",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
32
|
+
"postcss": "^8.5.6",
|
|
33
|
+
"semantic-release": "^24.2.7",
|
|
34
|
+
"typescript": "^5.0.0"
|
|
24
35
|
}
|
|
25
36
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @type {import('semantic-release').GlobalConfig}
|
|
3
|
+
*/
|
|
4
|
+
export default {
|
|
5
|
+
branches: [{ name: "canary", prerelease: "canary" }, "main"],
|
|
6
|
+
plugins: [
|
|
7
|
+
"@semantic-release/commit-analyzer",
|
|
8
|
+
"@semantic-release/release-notes-generator",
|
|
9
|
+
["@semantic-release/changelog", { changelogFile: "CHANGELOG.md" }],
|
|
10
|
+
[
|
|
11
|
+
"@semantic-release/exec", // Runs build before publishing
|
|
12
|
+
{
|
|
13
|
+
prepareCmd: "npm run build",
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"@semantic-release/npm", // Publishes to npm
|
|
18
|
+
{
|
|
19
|
+
npmPublish: true,
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"@semantic-release/git", // Commits updated files
|
|
24
|
+
{
|
|
25
|
+
assets: ["package.json", "package-lock.json", "CHANGELOG.md"],
|
|
26
|
+
message:
|
|
27
|
+
"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
"@semantic-release/github", // Creates GitHub release
|
|
31
|
+
],
|
|
32
|
+
};
|
package/src/at-rules/dark.ts
CHANGED
|
@@ -1,12 +1,33 @@
|
|
|
1
|
-
import { Rule,
|
|
1
|
+
import { Rule, AtRule, ChildNode } from "postcss";
|
|
2
2
|
|
|
3
3
|
export default function dark(atRule: AtRule) {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const clonedNodes: ChildNode[] = [];
|
|
5
|
+
|
|
6
|
+
// Clone all child nodes so we can reuse them
|
|
7
|
+
atRule.each((node: ChildNode) => {
|
|
8
|
+
clonedNodes.push(node.clone());
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
// Create `[data-mode="dark"] &` rule
|
|
12
|
+
const dataAttrRule = new Rule({
|
|
6
13
|
selector: `[data-mode="dark"] &`,
|
|
7
|
-
nodes: atRule.nodes, // move children inside
|
|
8
14
|
});
|
|
9
15
|
|
|
10
|
-
|
|
11
|
-
|
|
16
|
+
clonedNodes.forEach((node) => dataAttrRule.append(node.clone()));
|
|
17
|
+
|
|
18
|
+
// Create `@media (prefers-color-scheme: dark)` wrapper
|
|
19
|
+
const mediaAtRule = new AtRule({
|
|
20
|
+
name: "media",
|
|
21
|
+
params: "(prefers-color-scheme: dark)",
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const mediaRule = new Rule({
|
|
25
|
+
selector: `&`,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
clonedNodes.forEach((node) => mediaRule.append(node.clone()));
|
|
29
|
+
mediaAtRule.append(mediaRule);
|
|
30
|
+
|
|
31
|
+
// Replace original @dark rule with both new rules
|
|
32
|
+
atRule.replaceWith(dataAttrRule, mediaAtRule);
|
|
12
33
|
}
|
package/src/at-rules/light.ts
CHANGED
|
@@ -1,12 +1,33 @@
|
|
|
1
|
-
import { Rule,
|
|
1
|
+
import { Rule, AtRule, ChildNode } from "postcss";
|
|
2
2
|
|
|
3
3
|
export default function light(atRule: AtRule) {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const clonedNodes: ChildNode[] = [];
|
|
5
|
+
|
|
6
|
+
// Clone all child nodes so we can reuse them
|
|
7
|
+
atRule.each((node: ChildNode) => {
|
|
8
|
+
clonedNodes.push(node.clone());
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
// Create `[data-mode="light"] &` rule
|
|
12
|
+
const dataAttrRule = new Rule({
|
|
6
13
|
selector: `[data-mode="light"] &`,
|
|
7
|
-
nodes: atRule.nodes, // move children inside
|
|
8
14
|
});
|
|
9
15
|
|
|
10
|
-
|
|
11
|
-
|
|
16
|
+
clonedNodes.forEach((node) => dataAttrRule.append(node.clone()));
|
|
17
|
+
|
|
18
|
+
// Create `@media (prefers-color-scheme: light)` wrapper
|
|
19
|
+
const mediaAtRule = new AtRule({
|
|
20
|
+
name: "media",
|
|
21
|
+
params: "(prefers-color-scheme: light)",
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const mediaRule = new Rule({
|
|
25
|
+
selector: `&`,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
clonedNodes.forEach((node) => mediaRule.append(node.clone()));
|
|
29
|
+
mediaAtRule.append(mediaRule);
|
|
30
|
+
|
|
31
|
+
// Replace original @light rule with both new rules
|
|
32
|
+
atRule.replaceWith(dataAttrRule, mediaAtRule);
|
|
12
33
|
}
|