-
-
Notifications
You must be signed in to change notification settings - Fork 124
Example of twin inside an nx-workplace #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
mmlngl
wants to merge
5
commits into
ben-rogerson:master
Choose a base branch
from
mmlngl:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e366e07
Initial commit of start nx workspace
mmlngl 7c1250a
Added shared-ui lib with Button component example
mmlngl 3761008
Renamed shared-ui Project
mmlngl fb2650d
Successfully displayed shared components
mmlngl f8469de
Added a custom tailwind theme lib to the example
mmlngl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,3 +1,7 @@ | ||
| module.exports = { | ||
| projects: ['<rootDir>/apps/web', '<rootDir>/libs/shared-ui'], | ||
| projects: [ | ||
| '<rootDir>/apps/web', | ||
| '<rootDir>/libs/shared-ui', | ||
| '<rootDir>/libs/tailwind-config', | ||
| ], | ||
| }; |
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
nx-workspace-emotion/libs/shared-ui/babel-plugin-macros.config.js
This file contains hidden or 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,9 @@ | ||
| /* eslint-disable @typescript-eslint/no-var-requires */ | ||
| const { resolve } = require('path'); | ||
|
|
||
| module.exports = { | ||
| twin: { | ||
| preset: 'emotion', | ||
| config: resolve(__dirname, 'tailwind.config.js'), | ||
| }, | ||
| }; |
This file contains hidden or 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,4 @@ | ||
| module.exports = { | ||
| presets: ['@nrwl/react/babel', '@emotion/babel-preset-css-prop'], | ||
| plugins: ['babel-plugin-macros'], | ||
| }; |
This file contains hidden or 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 hidden or 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 @@ | ||
| module.exports = { | ||
| presets: [require('../tailwind-config')], | ||
| }; |
This file contains hidden or 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,5 @@ | ||
| { | ||
| "extends": ["../../.eslintrc.json"], | ||
| "ignorePatterns": ["!**/*"], | ||
| "rules": {} | ||
| } |
This file contains hidden or 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,7 @@ | ||
| # tailwind-config | ||
|
|
||
| This library was generated with [Nx](https://nx.dev). | ||
|
|
||
| ## Running unit tests | ||
|
|
||
| Run `nx test tailwind-config` to execute the unit tests via [Jest](https://jestjs.io). |
This file contains hidden or 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,14 @@ | ||
| module.exports = { | ||
| displayName: 'tailwind-config', | ||
| preset: '../../jest.preset.js', | ||
| globals: { | ||
| 'ts-jest': { | ||
| tsConfig: '<rootDir>/tsconfig.spec.json', | ||
| }, | ||
| }, | ||
| transform: { | ||
| '^.+\\.[tj]sx?$': 'ts-jest', | ||
| }, | ||
| moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], | ||
| coverageDirectory: '../../coverage/libs/tailwind-config', | ||
| }; |
This file contains hidden or 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,5 @@ | ||
| { | ||
| "name": "@nx-workspace-emotion/tailwind-config", | ||
| "version": "0.0.1", | ||
| "main": "src/index.js" | ||
| } |
This file contains hidden or 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,2 @@ | ||
| /* eslint-disable no-undef */ | ||
| module.exports = require('./lib/theme'); |
10 changes: 10 additions & 0 deletions
10
nx-workspace-emotion/libs/tailwind-config/src/lib/theme.js
This file contains hidden or 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,10 @@ | ||
| /* eslint-disable no-undef */ | ||
| module.exports = { | ||
| theme: { | ||
| extend: { | ||
| colors: { | ||
| zabadoo: 'blue', | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here's where we're defining a special variable, in this case, a brand colour called "zabadoo". |
||
| }, | ||
| }, | ||
| }, | ||
| }; | ||
This file contains hidden or 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,13 @@ | ||
| { | ||
| "extends": "../../tsconfig.base.json", | ||
| "files": [], | ||
| "include": [], | ||
| "references": [ | ||
| { | ||
| "path": "./tsconfig.lib.json" | ||
| }, | ||
| { | ||
| "path": "./tsconfig.spec.json" | ||
| } | ||
| ] | ||
| } |
11 changes: 11 additions & 0 deletions
11
nx-workspace-emotion/libs/tailwind-config/tsconfig.lib.json
This file contains hidden or 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,11 @@ | ||
| { | ||
| "extends": "./tsconfig.json", | ||
| "compilerOptions": { | ||
| "module": "commonjs", | ||
| "outDir": "../../dist/out-tsc", | ||
| "declaration": true, | ||
| "types": ["node"] | ||
| }, | ||
| "exclude": ["**/*.spec.ts"], | ||
| "include": ["**/*.ts"] | ||
| } |
15 changes: 15 additions & 0 deletions
15
nx-workspace-emotion/libs/tailwind-config/tsconfig.spec.json
This file contains hidden or 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,15 @@ | ||
| { | ||
| "extends": "./tsconfig.json", | ||
| "compilerOptions": { | ||
| "outDir": "../../dist/out-tsc", | ||
| "module": "commonjs", | ||
| "types": ["jest", "node"] | ||
| }, | ||
| "include": [ | ||
| "**/*.spec.ts", | ||
| "**/*.spec.tsx", | ||
| "**/*.spec.js", | ||
| "**/*.spec.jsx", | ||
| "**/*.d.ts" | ||
| ] | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Crucially, here's where we're using a custom value set in the theme.