@salty-css/react 0.0.1-alpha.51 → 0.0.1-alpha.53
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/README.md +30 -6
- package/package.json +2 -2
package/README.md
CHANGED
@@ -12,17 +12,26 @@ In the world of frontend dev is there anything saltier than CSS? Salty CSS is bu
|
|
12
12
|
|
13
13
|
## Get started
|
14
14
|
|
15
|
-
### TL;DR
|
16
|
-
|
17
15
|
- Initialize: `npx salty-css init [directory]`
|
18
16
|
- Create component: `npx salty-css generate [filePath]`
|
19
17
|
- Build: `npx salty-css build [directory]`
|
20
18
|
|
21
|
-
###
|
19
|
+
### Packages
|
20
|
+
|
21
|
+
- [React](#react) → `npm install @salty-css/react`
|
22
|
+
- [Next.js](#nextjs) → `npm install @salty-css/next`
|
23
|
+
- [Vite](#vite) → `npm install @salty-css/vite`
|
24
|
+
- [Webpack](https://www.npmjs.com/package/@salty-css/webpack) → `npm install @salty-css/webpack`
|
25
|
+
- [Core](https://www.npmjs.com/package/@salty-css/react) → `npm install @salty-css/core`
|
26
|
+
- [ESLint](https://www.npmjs.com/package/@salty-css/eslint-plugin-core) → `npm install @salty-css/eslint-plugin-core`
|
27
|
+
|
28
|
+
[View React example](#example-dynamic-form-with-react)
|
29
|
+
|
30
|
+
### Add Salty CSS to your project with `salty-css` CLI
|
22
31
|
|
23
32
|
#### Initialize Salty CSS for a project
|
24
33
|
|
25
|
-
In your existing repository run `npx salty-css init [directory]` which installs required salty-css packages to the current directory and creates project files to the provided directory. Directory can be left blank if you want files to be created to the current directory. Init will also create `.saltyrc` which contains some metadata for future CLI commands.
|
34
|
+
In your existing repository run `npx salty-css init [directory]` which installs required salty-css packages to the current directory, detects framework in use (current support for vite and next.js) and creates project files to the provided directory. Directory can be left blank if you want files to be created to the current directory. Init will also create `.saltyrc` which contains some metadata for future CLI commands.
|
26
35
|
|
27
36
|
#### Create components
|
28
37
|
|
@@ -43,12 +52,27 @@ To ease the pain of package updates all Salty CSS packages can be updated with `
|
|
43
52
|
1. Install related dependencies: `npm i @salty-css/core @salty-css/react`
|
44
53
|
2. Create `salty.config.ts` to your app directory
|
45
54
|
|
55
|
+
#### Next.js
|
56
|
+
|
57
|
+
1. First check the instructions for [React](#react)
|
58
|
+
2. For Next.js support install `npm i -D @salty-css/next`
|
59
|
+
3. Add Salty CSS plugin to next.js config
|
60
|
+
|
61
|
+
- **Next.js 15:** In `next.config.ts` add import for salty plugin `import { withSaltyCss } from '@salty-css/next';` and then add `withSaltyCss` to wrap your nextConfig export like so `export default withSaltyCss(nextConfig);`
|
62
|
+
- **Next.js 14 and older:** In `next.config.js` add import for salty plugin `const { withSaltyCss } = require('@salty-css/next');` and then add `withSaltyCss` to wrap your nextConfig export like so `module.exports = withSaltyCss(nextConfig);`
|
63
|
+
|
64
|
+
4. Make sure that `salty.config.ts` and `next.config.ts` are in the same folder!
|
65
|
+
5. Build `saltygen` directory by running your app once or with cli `npx salty-css build [directory]`
|
66
|
+
6. Import global styles from `saltygen/index.css` to some global css file with `@import 'insert_path_to_index_css';`.
|
67
|
+
|
46
68
|
#### Vite
|
47
69
|
|
48
|
-
1. First check the instructions for React
|
70
|
+
1. First check the instructions for [React](#react)
|
49
71
|
2. For Vite support install `npm i -D @salty-css/vite`
|
50
|
-
3. In `vite.config
|
72
|
+
3. In `vite.config` add import for salty plugin `import { saltyPlugin } from '@salty-css/vite';` and then add `saltyPlugin(__dirname)` to your vite configuration plugins
|
51
73
|
4. Make sure that `salty.config.ts` and `vite.config.ts` are in the same folder!
|
74
|
+
5. Build `saltygen` directory by running your app once or with cli `npx salty-css build [directory]`
|
75
|
+
6. Import global styles from `saltygen/index.css` to some global css file with `@import 'insert_path_to_index_css';`.
|
52
76
|
|
53
77
|
### Create components
|
54
78
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salty-css/react",
|
3
|
-
"version": "0.0.1-alpha.
|
3
|
+
"version": "0.0.1-alpha.53",
|
4
4
|
"main": "./dist/index.js",
|
5
5
|
"module": "./dist/index.mjs",
|
6
6
|
"typings": "./dist/index.d.ts",
|
@@ -41,7 +41,7 @@
|
|
41
41
|
}
|
42
42
|
},
|
43
43
|
"dependencies": {
|
44
|
-
"@salty-css/core": "^0.0.1-alpha.
|
44
|
+
"@salty-css/core": "^0.0.1-alpha.53",
|
45
45
|
"clsx": ">=2.x",
|
46
46
|
"react": ">=19.x || >=18.3.x"
|
47
47
|
}
|