-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a210ed
commit 1a31210
Showing
25 changed files
with
1,013 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
auto-install-peers=false | ||
link-workspace-packages=true | ||
package-manager-strict-version=true | ||
package-manager-strict-version=false | ||
update-notifier=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.7.6 | ||
system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/// <reference types="nativewind/types" /> | ||
|
||
// NOTE: This file should not be edited and should be committed with your source code. It is generated by NativeWind. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { StyleSheet, Text, View } from 'react-native'; | ||
|
||
import './global.css'; | ||
|
||
export function NativeWindView() { | ||
return ( | ||
<View style={styles.container}> | ||
<View className="bg-red-500"> | ||
<Text className="text-white">Hello, World!</Text> | ||
</View> | ||
</View> | ||
); | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
alignItems: 'center', | ||
marginVertical: 16, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** @type {import('tailwindcss').Config} */ | ||
module.exports = { | ||
content: ['./src/*.{js,jsx,ts,tsx}'], | ||
presets: [require('nativewind/preset')], | ||
theme: { | ||
extend: {}, | ||
fontFamily: { | ||
mono: ['monospace'], | ||
}, | ||
}, | ||
plugins: [], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"extends": "@react-native/typescript-config/tsconfig.json", | ||
"compilerOptions": { | ||
"jsxImportSource": "nativewind", | ||
"module": "ES2022" // for dynamic imports & top-level await | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# @callstack/repack-plugin-nativewind |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<p align="center"> | ||
<img src="https://raw.githubusercontent.com/callstack/repack/HEAD/logo.png"> | ||
</p> | ||
<p align="center"> | ||
A toolkit to build your React Native application with Rspack or Webpack. | ||
</p> | ||
|
||
--- | ||
|
||
[![Build Status][build-badge]][build] | ||
[![Version][version-badge]][version] | ||
[![MIT License][license-badge]][license] | ||
[![PRs Welcome][prs-welcome-badge]][prs-welcome] | ||
[![Code of Conduct][coc-badge]][coc] | ||
|
||
`@callstack/repack-plugin-nativewind` is a plugin for `@callstack/repack` that integrates [NativeWind](https://github.com/nativewind/nativewind) into your React Native projects. | ||
|
||
## About | ||
|
||
Use NativeWind in Re.Pack projects. | ||
|
||
## Installation | ||
|
||
```sh | ||
npm install -D @callstack/repack-plugin-nativewind | ||
``` | ||
|
||
## Usage | ||
|
||
### Plugin | ||
|
||
To add the plugin to your Re.Pack configuration follow this guide: https://www.nativewind.dev/getting-started/react-native | ||
|
||
- Follow step 1, 2, and 5 (and optionally 7) | ||
- At step 3 and 4, instead of editing `babel.config.js` (which is not used) or changing Metro config (again, not used) update your `rspack.config.js` or `webpack.config.js` as follows: | ||
|
||
```js | ||
import { NativeWindPlugin } from "@callstack/repack-plugin-nativewind"; | ||
|
||
export default (env) => { | ||
// ... | ||
return { | ||
// ... | ||
plugins: [ | ||
// ... | ||
new NativeWindPlugin({ | ||
input: "./global.css", | ||
}), | ||
], | ||
}; | ||
}; | ||
``` | ||
|
||
### Loader | ||
|
||
The plugin also comes with it's own loader, which you can use on it's own inside `rspack.config.js` or `webpack.config.js` like this: | ||
|
||
```js | ||
export default (env) => { | ||
// ... | ||
return { | ||
// ... | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.ts$/, | ||
use: { | ||
loader: "@callstack/repack-plugin-nativewind/loader", | ||
options: { | ||
babelPlugins: [ | ||
[ | ||
"@babel/plugin-syntax-typescript", | ||
{ isTSX: false, allowNamespaces: true }, | ||
], | ||
"nativewind/babel", | ||
], | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
}; | ||
}; | ||
``` | ||
|
||
--- | ||
|
||
Check out our website at https://re-pack.dev for more info and documentation or our GitHub: https://github.com/callstack/repack. | ||
|
||
<!-- badges --> | ||
|
||
[callstack-readme-with-love]: https://callstack.com/?utm_source=github.com&utm_medium=referral&utm_campaign=react-native-paper&utm_term=readme-with-love | ||
[build-badge]: https://img.shields.io/github/workflow/status/callstack/repack/CI/main?style=flat-square | ||
[build]: https://github.com/callstack/repack/actions/workflows/main.yml | ||
[version-badge]: https://img.shields.io/npm/v/@callstack/repack-plugin-nativewind?style=flat-square | ||
[version]: https://www.npmjs.com/package/@callstack/repack-plugin-nativewind | ||
[license-badge]: https://img.shields.io/npm/l/@callstack/repack-plugin-nativewind?style=flat-square | ||
[license]: https://github.com/callstack/repack/blob/master/LICENSE | ||
[prs-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square | ||
[prs-welcome]: ./CONTRIBUTING.md | ||
[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square | ||
[coc]: https://github.com/callstack/repack/blob/master/CODE_OF_CONDUCT.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from '../dist/loader.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('../dist/loader.js'); |
Oops, something went wrong.