Skip to content

Commit

Permalink
feat(delme): v1
Browse files Browse the repository at this point in the history
  • Loading branch information
Dwlad90 committed Oct 9, 2024
1 parent 3316497 commit 5aa4187
Show file tree
Hide file tree
Showing 26 changed files with 226 additions and 72 deletions.
37 changes: 19 additions & 18 deletions .github/workflows/napi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ permissions:
push:
branches:
- master
tags-ignore:
- '**'
tags:
- "*.*.*"
- "*.*.*-*.*"
paths-ignore:
- '**/*.md'
- LICENSE
Expand Down Expand Up @@ -282,10 +283,10 @@ jobs:
runs-on: ubuntu-latest
needs:
- build
- benchmark
- test-macOS-windows-binding
- test-linux-x64-gnu-binding
- test-linux-x64-musl-binding
# - benchmark
# - test-macOS-windows-binding
# - test-linux-x64-gnu-binding
# - test-linux-x64-musl-binding
steps:
- uses: actions/checkout@v4
- name: Setup environment
Expand All @@ -298,22 +299,22 @@ jobs:
run: pnpm run --filter @stylexswc/rs-compiler artifacts
- name: Move and list artifacts
run: |
mv crates/stylex-rs-compiler/npm/*/*.node crates/stylex-rs-compiler/dist
ls -R crates/stylex-rs-compiler/dist
- name: Prepare artifacts
run: |
sed -i "s|require('@stylexswc/rs-compiler-[^']*')|require('@stylexswc/rs-compiler')|g" crates/stylex-rs-compiler/dist/index.js
shell: bash
git diff
ls -R crates/stylex-rs-compiler/npm/*
# - name: Move and list artifacts
# run: |
# cp crates/stylex-rs-compiler/npm/*/*.node crates/stylex-rs-compiler/dist
# ls -R crates/stylex-rs-compiler/dist
- name: Publish
run: |
if git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$";
then
if [[ "${{ github.ref }}" =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
pnpm publish -r --access public
elif git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+";
then
pnpm publish -r --access public --no-git-checks --report-summary --dry-run
elif [[ "${{ github.ref }}" =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+-.*$ ]]; then
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
pnpm publish -r --tag next --access public
pnpm publish -r --tag next --access public --no-git-checks --report-summary --dry-run
cat ./pnpm-publish-summary.json
else
echo "Not a release, skipping publish"
fi
Expand Down
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This project is organized into several packages:

**Core:**

* [`rs-compiler`](https://github.com/dwlad90/stylex-swc-plugin/tree/master/crates/rs-compiler) -
* [`rs-compiler`](https://github.com/dwlad90/stylex-swc-plugin/tree/master/crates/stylex-rs-compiler) -
Rust-based [`napi-rs`](https://napi.rs/) compiler for transforming StyleX code.

**Integration:**
Expand Down Expand Up @@ -60,11 +60,11 @@ This project is organized into several packages:
* [`swc-plugin`](https://github.com/dwlad90/stylex-swc-plugin/tree/master/crates/stylex-swc-plugin) -
Unofficial SWC implementation of the native
[StyleX](https://github.com/facebook/stylex) plugin. The new alternative is
[`rs-compiler`](https://github.com/dwlad90/stylex-swc-plugin/tree/master/crates/rs-compiler)
[`rs-compiler`](https://github.com/dwlad90/stylex-swc-plugin/tree/master/crates/stylex-rs-compiler)

**Integration:**

* [`nextjs-swc-plugin`](https://github.com/dwlad90/stylex-swc-plugin/tree/master/packages/nextjs-plugin) -
* [`nextjs-swc-plugin`](https://github.com/dwlad90/stylex-swc-plugin/tree/master/packages/nextjs-swc-plugin) -
Wrapper for
[`Next.JS config`](https://nextjs.org/docs/app/api-reference/next-config-js)
that inject the StyleX SWC plugin to webpack processing. The new alternative
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs-example/next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @type {import('next').NextConfig} */
const path = require('path');
/** @type {import('next').NextConfig} */
const stylexPlugin = require('@stylexswc/nextjs-plugin');
const rootDir = __dirname;

Expand Down
21 changes: 21 additions & 0 deletions crates/stylex-rs-compiler/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Vladislav Buinovski

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
5 changes: 0 additions & 5 deletions crates/stylex-rs-compiler/dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@

/* auto-generated by NAPI-RS */

export interface TransformOutput {
code: string
map?: string
output?: string
}
export interface StyleXModuleResolution {
type: string
rootDir?: string
Expand Down
21 changes: 21 additions & 0 deletions crates/stylex-rs-compiler/npm/darwin-arm64/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Vladislav Buinovski

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
7 changes: 4 additions & 3 deletions crates/stylex-rs-compiler/npm/darwin-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"name": "@stylexswc/rs-compiler-darwin-arm64",
"version": "0.3.0-rc.1",
"private": true,
"private": false,
"os": [
"darwin"
],
"cpu": [
"arm64"
],
"main": "@stylexswc/rs-compiler.darwin-arm64.node",
"main": "rs-compiler.darwin-arm64.node",
"files": [
"@stylexswc/rs-compiler.darwin-arm64.node"
"LICENSE",
"rs-compiler.darwin-arm64.node"
],
"description": "NAPI-RS compiler for transform StyleX code",
"keywords": [
Expand Down
21 changes: 21 additions & 0 deletions crates/stylex-rs-compiler/npm/darwin-x64/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Vladislav Buinovski

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
7 changes: 4 additions & 3 deletions crates/stylex-rs-compiler/npm/darwin-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"name": "@stylexswc/rs-compiler-darwin-x64",
"version": "0.3.0-rc.1",
"private": true,
"private": false,
"os": [
"darwin"
],
"cpu": [
"x64"
],
"main": "@stylexswc/rs-compiler.darwin-x64.node",
"main": "rs-compiler.darwin-x64.node",
"files": [
"@stylexswc/rs-compiler.darwin-x64.node"
"LICENSE",
"rs-compiler.darwin-x64.node"
],
"description": "NAPI-RS compiler for transform StyleX code",
"keywords": [
Expand Down
21 changes: 21 additions & 0 deletions crates/stylex-rs-compiler/npm/linux-arm64-gnu/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Vladislav Buinovski

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
7 changes: 4 additions & 3 deletions crates/stylex-rs-compiler/npm/linux-arm64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"name": "@stylexswc/rs-compiler-linux-arm64-gnu",
"version": "0.3.0-rc.1",
"private": true,
"private": false,
"os": [
"linux"
],
"cpu": [
"arm64"
],
"main": "@stylexswc/rs-compiler.linux-arm64-gnu.node",
"main": "rs-compiler.linux-arm64-gnu.node",
"files": [
"@stylexswc/rs-compiler.linux-arm64-gnu.node"
"LICENSE",
"rs-compiler.linux-arm64-gnu.node"
],
"description": "NAPI-RS compiler for transform StyleX code",
"keywords": [
Expand Down
21 changes: 21 additions & 0 deletions crates/stylex-rs-compiler/npm/linux-x64-gnu/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Vladislav Buinovski

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
7 changes: 4 additions & 3 deletions crates/stylex-rs-compiler/npm/linux-x64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"name": "@stylexswc/rs-compiler-linux-x64-gnu",
"version": "0.3.0-rc.1",
"private": true,
"private": false,
"os": [
"linux"
],
"cpu": [
"x64"
],
"main": "@stylexswc/rs-compiler.linux-x64-gnu.node",
"main": "rs-compiler.linux-x64-gnu.node",
"files": [
"@stylexswc/rs-compiler.linux-x64-gnu.node"
"LICENSE",
"rs-compiler.linux-x64-gnu.node"
],
"description": "NAPI-RS compiler for transform StyleX code",
"keywords": [
Expand Down
21 changes: 21 additions & 0 deletions crates/stylex-rs-compiler/npm/linux-x64-musl/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Vladislav Buinovski

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
7 changes: 4 additions & 3 deletions crates/stylex-rs-compiler/npm/linux-x64-musl/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"name": "@stylexswc/rs-compiler-linux-x64-musl",
"version": "0.3.0-rc.1",
"private": true,
"private": false,
"os": [
"linux"
],
"cpu": [
"x64"
],
"main": "@stylexswc/rs-compiler.linux-x64-musl.node",
"main": "rs-compiler.linux-x64-musl.node",
"files": [
"@stylexswc/rs-compiler.linux-x64-musl.node"
"LICENSE",
"rs-compiler.linux-x64-musl.node"
],
"description": "NAPI-RS compiler for transform StyleX code",
"keywords": [
Expand Down
Loading

1 comment on commit 5aa4187

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.

Benchmark suite Current: 5aa4187 Previous: de08aed Ratio
page 277.44257292522315 ops/sec (±9.595107139703032%) 469.600017246113 ops/sec (±8.096129780715113%) 1.69

This comment was automatically generated by workflow using github-action-benchmark.

CC: @Dwlad90

Please sign in to comment.