Skip to content

Commit 1c48683

Browse files
authored
Hoist oxide/crates to just crates (#13333)
* move `oxide/crates` to `crates` * ignore `target/` folder * ensure pnpm points to `crates` instead of `oxide/crates` * ensure all paths point to `crates` instead of `oxide/crates` * update `oxide/crates` -> `crates` path in workflows * use correct path in .prettierignore * rename `crates/core` to `crates/oxide` * remove oxide folder * fix test script to run `cargo test` directly
1 parent fee039d commit 1c48683

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+81
-102
lines changed

.github/workflows/ci.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ jobs:
4747
uses: actions/cache@v3
4848
with:
4949
path: |
50-
./oxide/target/
51-
./oxide/crates/node/*.node
52-
./oxide/crates/node/index.js
53-
./oxide/crates/node/index.d.ts
54-
key: ${{ runner.os }}-oxide-${{ hashFiles('./oxide/crates/**/*') }}
50+
./target/
51+
./crates/node/*.node
52+
./crates/node/index.js
53+
./crates/node/index.d.ts
54+
key: ${{ runner.os }}-oxide-${{ hashFiles('./crates/**/*') }}
5555

5656
- name: Install dependencies
5757
run: pnpm install

.github/workflows/release.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ env:
1616
APP_NAME: tailwindcss-oxide
1717
NODE_VERSION: 20
1818
PNPM_VERSION: ^8.15.0
19-
OXIDE_LOCATION: ./oxide/crates/node
19+
OXIDE_LOCATION: ./crates/node
2020

2121
jobs:
2222
build:
@@ -104,10 +104,10 @@ jobs:
104104
with:
105105
path: |
106106
./oxide/target/
107-
./oxide/crates/node/*.node
108-
./oxide/crates/node/index.js
109-
./oxide/crates/node/index.d.ts
110-
key: ${{ runner.os }}-${{ matrix.target }}-oxide-${{ hashFiles('./oxide/crates/**/*') }}
107+
./crates/node/*.node
108+
./crates/node/index.js
109+
./crates/node/index.d.ts
110+
key: ${{ runner.os }}-${{ matrix.target }}-oxide-${{ hashFiles('./crates/**/*') }}
111111

112112
- name: Install Node.JS
113113
uses: actions/setup-node@v3
@@ -189,10 +189,10 @@ jobs:
189189
with:
190190
path: |
191191
./oxide/target/
192-
./oxide/crates/node/*.node
193-
./oxide/crates/node/index.js
194-
./oxide/crates/node/index.d.ts
195-
key: ${{ runner.os }}-${{ matrix.target }}-oxide-${{ hashFiles('./oxide/crates/**/*') }}
192+
./crates/node/*.node
193+
./crates/node/index.js
194+
./crates/node/index.d.ts
195+
key: ${{ runner.os }}-${{ matrix.target }}-oxide-${{ hashFiles('./crates/**/*') }}
196196

197197
- name: Install dependencies
198198
run: pnpm install --ignore-scripts --filter=!./playgrounds/*

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ test-results/
66
playwright-report/
77
blob-report/
88
playwright/.cache/
9+
target/

.prettierignore

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
coverage/
22
node_modules/
33
pnpm-lock.yaml
4-
oxide/target/
5-
oxide/crates/node/index.d.ts
6-
oxide/crates/node/index.js
4+
target/
5+
crates/node/index.d.ts
6+
crates/node/index.js
77
.next
88
.fingerprint

oxide/Cargo.lock renamed to Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

oxide/crates/node/Cargo.toml renamed to crates/node/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ crate-type = ["cdylib"]
1010
# Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
1111
napi = { version = "2.13.1", default-features = false, features = ["napi4"] }
1212
napi-derive = "2.13.0"
13-
tailwindcss-core = { path = "../core" }
13+
tailwindcss-oxide = { path = "../oxide" }
1414
rayon = "1.5.3"
1515

1616
[build-dependencies]
File renamed without changes.

oxide/crates/node/npm/android-arm-eabi/package.json renamed to crates/node/npm/android-arm-eabi/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",
7-
"directory": "oxide/crates/node/npm/android-arm-eabi"
7+
"directory": "crates/node/npm/android-arm-eabi"
88
},
99
"os": [
1010
"android"

oxide/crates/node/npm/android-arm64/package.json renamed to crates/node/npm/android-arm64/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",
7-
"directory": "oxide/crates/node/npm/android-arm64"
7+
"directory": "crates/node/npm/android-arm64"
88
},
99
"os": [
1010
"android"

oxide/crates/node/npm/darwin-arm64/package.json renamed to crates/node/npm/darwin-arm64/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",
7-
"directory": "oxide/crates/node/npm/darwin-arm64"
7+
"directory": "crates/node/npm/darwin-arm64"
88
},
99
"os": [
1010
"darwin"

oxide/crates/node/npm/darwin-x64/package.json renamed to crates/node/npm/darwin-x64/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",
7-
"directory": "oxide/crates/node/npm/darwin-x64"
7+
"directory": "crates/node/npm/darwin-x64"
88
},
99
"os": [
1010
"darwin"

oxide/crates/node/npm/freebsd-x64/package.json renamed to crates/node/npm/freebsd-x64/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",
7-
"directory": "oxide/crates/node/npm/freebsd-x64"
7+
"directory": "crates/node/npm/freebsd-x64"
88
},
99
"os": [
1010
"freebsd"

oxide/crates/node/npm/linux-arm-gnueabihf/package.json renamed to crates/node/npm/linux-arm-gnueabihf/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",
7-
"directory": "oxide/crates/node/npm/linux-arm-gnueabihf"
7+
"directory": "crates/node/npm/linux-arm-gnueabihf"
88
},
99
"os": [
1010
"linux"

oxide/crates/node/npm/linux-arm64-gnu/package.json renamed to crates/node/npm/linux-arm64-gnu/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",
7-
"directory": "oxide/crates/node/npm/linux-arm64-gnu"
7+
"directory": "crates/node/npm/linux-arm64-gnu"
88
},
99
"os": [
1010
"linux"

oxide/crates/node/npm/linux-arm64-musl/package.json renamed to crates/node/npm/linux-arm64-musl/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",
7-
"directory": "oxide/crates/node/npm/linux-arm64-musl"
7+
"directory": "crates/node/npm/linux-arm64-musl"
88
},
99
"os": [
1010
"linux"

oxide/crates/node/npm/linux-x64-gnu/package.json renamed to crates/node/npm/linux-x64-gnu/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",
7-
"directory": "oxide/crates/node/npm/linux-x64-gnu"
7+
"directory": "crates/node/npm/linux-x64-gnu"
88
},
99
"os": [
1010
"linux"

oxide/crates/node/npm/linux-x64-musl/package.json renamed to crates/node/npm/linux-x64-musl/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",
7-
"directory": "oxide/crates/node/npm/linux-x64-musl"
7+
"directory": "crates/node/npm/linux-x64-musl"
88
},
99
"os": [
1010
"linux"

oxide/crates/node/npm/win32-x64-msvc/package.json renamed to crates/node/npm/win32-x64-msvc/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",
7-
"directory": "oxide/crates/node/npm/win32-x64-msvc"
7+
"directory": "crates/node/npm/win32-x64-msvc"
88
},
99
"os": [
1010
"win32"

oxide/crates/node/package.json renamed to crates/node/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",
7-
"directory": "oxide/crates/node"
7+
"directory": "crates/node"
88
},
99
"main": "index.js",
1010
"types": "index.d.ts",
File renamed without changes.

oxide/crates/node/src/lib.rs renamed to crates/node/src/lib.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ pub struct ChangedContent {
1212
pub extension: String,
1313
}
1414

15-
impl From<ChangedContent> for tailwindcss_core::ChangedContent {
15+
impl From<ChangedContent> for tailwindcss_oxide::ChangedContent {
1616
fn from(changed_content: ChangedContent) -> Self {
17-
tailwindcss_core::ChangedContent {
17+
tailwindcss_oxide::ChangedContent {
1818
file: changed_content.file.map(PathBuf::from),
1919
content: changed_content.content,
2020
}
@@ -45,12 +45,12 @@ pub struct ScanOptions {
4545

4646
#[napi]
4747
pub fn clear_cache() {
48-
tailwindcss_core::clear_cache();
48+
tailwindcss_oxide::clear_cache();
4949
}
5050

5151
#[napi]
5252
pub fn scan_dir(args: ScanOptions) -> ScanResult {
53-
let result = tailwindcss_core::scan_dir(tailwindcss_core::ScanOptions {
53+
let result = tailwindcss_oxide::scan_dir(tailwindcss_oxide::ScanOptions {
5454
base: args.base,
5555
globs: args.globs.unwrap_or(false),
5656
});
@@ -85,5 +85,5 @@ pub enum Parsing {
8585

8686
#[napi]
8787
pub fn scan_files(input: Vec<ChangedContent>, strategy: u8) -> Vec<String> {
88-
tailwindcss_core::scan_files(input.into_iter().map(Into::into).collect(), strategy)
88+
tailwindcss_oxide::scan_files(input.into_iter().map(Into::into).collect(), strategy)
8989
}

oxide/crates/core/Cargo.toml renamed to crates/oxide/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "tailwindcss-core"
2+
name = "tailwindcss-oxide"
33
version = "0.1.0"
44
edition = "2021"
55

oxide/crates/core/benches/parse_candidates.rs renamed to crates/oxide/benches/parse_candidates.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use criterion::{black_box, criterion_group, criterion_main, Criterion};
2-
use tailwindcss_core::parser::Extractor;
2+
use tailwindcss_oxide::parser::Extractor;
33

44
pub fn criterion_benchmark(c: &mut Criterion) {
55
fn parse(input: &[u8]) {

oxide/crates/core/benches/scan_files.rs renamed to crates/oxide/benches/scan_files.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use criterion::{criterion_group, criterion_main, Criterion};
22
use std::path::PathBuf;
3-
use tailwindcss_core::{scan_files, ChangedContent, Parsing, IO};
3+
use tailwindcss_oxide::{scan_files, ChangedContent, Parsing, IO};
44

55
pub fn criterion_benchmark(c: &mut Criterion) {
66
// current_dir will be set to ./crates/core
File renamed without changes.

oxide/crates/core/fuzz/Cargo.lock renamed to crates/oxide/fuzz/Cargo.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

oxide/crates/core/fuzz/Cargo.toml renamed to crates/oxide/fuzz/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "tailwindcss-core-fuzz"
2+
name = "tailwindcss-oxide-fuzz"
33
version = "0.0.0"
44
publish = false
55
edition = "2021"
@@ -10,7 +10,7 @@ cargo-fuzz = true
1010
[dependencies]
1111
libfuzzer-sys = "0.4"
1212

13-
[dependencies.tailwindcss-core]
13+
[dependencies.tailwindcss-oxide]
1414
path = ".."
1515

1616
# Prevent this from interfering with workspaces

oxide/crates/core/fuzz/fuzz_targets/parsing.rs renamed to crates/oxide/fuzz/fuzz_targets/parsing.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
use libfuzzer_sys::fuzz_target;
44
use std::path::PathBuf;
5-
use tailwindcss_core::candidate::scan_files;
6-
use tailwindcss_core::candidate::Candidate;
7-
use tailwindcss_core::location::Location;
5+
use tailwindcss_oxide::candidate::scan_files;
6+
use tailwindcss_oxide::candidate::Candidate;
7+
use tailwindcss_oxide::location::Location;
88

99
// fuzz_target!(|data: &[u8]| {
1010
// if let Ok(s) = std::str::from_utf8(data) {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

oxide/crates/core/tests/auto_content.rs renamed to crates/oxide/tests/auto_content.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ mod auto_content {
33
use std::fs;
44
use std::process::Command;
55

6-
use tailwindcss_core::*;
6+
use tailwindcss_oxide::*;
77
use tempfile::tempdir;
88

99
fn scan(paths_with_content: &[(&str, Option<&str>)]) -> (Vec<String>, Vec<String>) {

oxide/.gitignore

-1
This file was deleted.

oxide/README.md

-1
This file was deleted.

oxide/package.json

-20
This file was deleted.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"lint": "prettier --check . && turbo lint",
2626
"build": "turbo build --filter=!./playgrounds/*",
2727
"dev": "turbo dev --filter=!./playgrounds/*",
28-
"test": "pnpm test --prefix=oxide && vitest run",
28+
"test": "cargo test && vitest run",
2929
"test:ui": "pnpm run --filter=tailwindcss test:ui",
3030
"tdd": "vitest",
3131
"bench": "vitest bench",

0 commit comments

Comments
 (0)