chore: convert tailwind to ts/esm
This commit is contained in:
parent
fd1f7fd08b
commit
fdd7022b5c
@ -1,9 +1,9 @@
|
|||||||
const { join } = require('path');
|
import { join } from 'path';
|
||||||
const { createGlobPatternsForDependencies } = require('@nx/react/tailwind');
|
import { createGlobPatternsForDependencies } from '@nx/react/tailwind';
|
||||||
const theme = require('../../libs/tailwindcss-config/src/theme');
|
import { theme } from '@vegaprotocol/tailwindcss-config';
|
||||||
const vegaCustomClasses = require('../../libs/tailwindcss-config/src/vega-custom-classes');
|
import { vegaCustomClasses } from '@vegaprotocol/tailwindcss-config';
|
||||||
|
|
||||||
module.exports = {
|
export default {
|
||||||
content: [
|
content: [
|
||||||
join(__dirname, 'src/**/*.{js,ts,jsx,tsx}'),
|
join(__dirname, 'src/**/*.{js,ts,jsx,tsx}'),
|
||||||
'libs/ui-toolkit/src/utils/shared.ts',
|
'libs/ui-toolkit/src/utils/shared.ts',
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
const { join } = require('path');
|
import { join } from 'path';
|
||||||
const { createGlobPatternsForDependencies } = require('@nx/react/tailwind');
|
import { createGlobPatternsForDependencies } from '@nx/react/tailwind';
|
||||||
const theme = require('../../libs/tailwindcss-config/src/theme');
|
import { theme } from '@vegaprotocol/tailwindcss-config';
|
||||||
const vegaCustomClasses = require('../../libs/tailwindcss-config/src/vega-custom-classes');
|
import { vegaCustomClasses } from '@vegaprotocol/tailwindcss-config';
|
||||||
|
|
||||||
module.exports = {
|
export default {
|
||||||
content: [
|
content: [
|
||||||
join(__dirname, 'src/**/*.{js,ts,jsx,tsx}'),
|
join(__dirname, 'src/**/*.{js,ts,jsx,tsx}'),
|
||||||
'libs/ui-toolkit/src/utils/shared.ts',
|
'libs/ui-toolkit/src/utils/shared.ts',
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
const { join } = require('path');
|
import { join } from 'path';
|
||||||
const { createGlobPatternsForDependencies } = require('@nx/next/tailwind');
|
import { createGlobPatternsForDependencies } from '@nx/next/tailwind';
|
||||||
const theme = require('../../libs/tailwindcss-config/src/theme');
|
import { theme } from '@vegaprotocol/tailwindcss-config';
|
||||||
const vegaCustomClasses = require('../../libs/tailwindcss-config/src/vega-custom-classes');
|
import { vegaCustomClasses } from '@vegaprotocol/tailwindcss-config';
|
||||||
|
|
||||||
module.exports = {
|
export default {
|
||||||
content: [
|
content: [
|
||||||
join(__dirname, 'pages/**/*.{js,ts,jsx,tsx}'),
|
join(__dirname, 'pages/**/*.{js,ts,jsx,tsx}'),
|
||||||
join(__dirname, 'client-pages/**/*.{js,ts,jsx,tsx}'),
|
join(__dirname, 'client-pages/**/*.{js,ts,jsx,tsx}'),
|
||||||
|
@ -13,6 +13,18 @@
|
|||||||
{
|
{
|
||||||
"files": ["*.js", "*.jsx"],
|
"files": ["*.js", "*.jsx"],
|
||||||
"rules": {}
|
"rules": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": ["*.json"],
|
||||||
|
"parser": "jsonc-eslint-parser",
|
||||||
|
"rules": {
|
||||||
|
"@nx/dependency-checks": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"ignoredFiles": ["{projectRoot}/rollup.config.{js,ts,mjs,mts}"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
29
libs/tailwindcss-config/.swcrc
Normal file
29
libs/tailwindcss-config/.swcrc
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"jsc": {
|
||||||
|
"target": "es2017",
|
||||||
|
"parser": {
|
||||||
|
"syntax": "typescript",
|
||||||
|
"decorators": true,
|
||||||
|
"dynamicImport": true
|
||||||
|
},
|
||||||
|
"transform": {
|
||||||
|
"decoratorMetadata": true,
|
||||||
|
"legacyDecorator": true
|
||||||
|
},
|
||||||
|
"keepClassNames": true,
|
||||||
|
"externalHelpers": true,
|
||||||
|
"loose": true
|
||||||
|
},
|
||||||
|
"module": {
|
||||||
|
"type": "es6"
|
||||||
|
},
|
||||||
|
"sourceMaps": true,
|
||||||
|
"exclude": [
|
||||||
|
"jest.config.ts",
|
||||||
|
".*\\.spec.tsx?$",
|
||||||
|
".*\\.test.tsx?$",
|
||||||
|
"./src/jest-setup.ts$",
|
||||||
|
"./**/jest-setup.ts$",
|
||||||
|
".*.js$"
|
||||||
|
]
|
||||||
|
}
|
@ -1,15 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
displayName: 'tailwindcss-config',
|
|
||||||
preset: '../../jest.preset.js',
|
|
||||||
globals: {},
|
|
||||||
transform: {
|
|
||||||
'^.+\\.[tj]s$': [
|
|
||||||
'ts-jest',
|
|
||||||
{
|
|
||||||
tsconfig: '<rootDir>/tsconfig.spec.json',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
moduleFileExtensions: ['ts', 'js', 'html'],
|
|
||||||
coverageDirectory: '../../coverage/libs/tailwindcss-config',
|
|
||||||
};
|
|
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"name": "@vegaprotocol/tailwindcss-config",
|
"name": "@vegaprotocol/tailwindcss-config",
|
||||||
"version": "0.0.5"
|
"version": "0.0.6"
|
||||||
}
|
}
|
||||||
|
@ -5,28 +5,37 @@
|
|||||||
"projectType": "library",
|
"projectType": "library",
|
||||||
"targets": {
|
"targets": {
|
||||||
"build": {
|
"build": {
|
||||||
"executor": "@nx/js:tsc",
|
"executor": "@nx/rollup:rollup",
|
||||||
"outputs": ["{options.outputPath}"],
|
"outputs": ["{options.outputPath}"],
|
||||||
"format": ["esm", "cjs"],
|
|
||||||
"options": {
|
"options": {
|
||||||
"outputPath": "dist/libs/tailwindcss-config",
|
"outputPath": "dist/libs/tailwindcss-config",
|
||||||
"main": "libs/tailwindcss-config/src/index.js",
|
"main": "libs/tailwindcss-config/src/index.ts",
|
||||||
"tsConfig": "libs/tailwindcss-config/tsconfig.lib.json",
|
"tsConfig": "libs/tailwindcss-config/tsconfig.lib.json",
|
||||||
"assets": ["libs/tailwindcss-config/*.md"]
|
"assets": [],
|
||||||
|
"project": "libs/tailwindcss-config/package.json",
|
||||||
|
"compiler": "swc",
|
||||||
|
"format": ["esm", "cjs"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"publish": {
|
||||||
|
"command": "node tools/scripts/publish.mjs tailwindcss-config {args.ver} {args.tag}",
|
||||||
|
"dependsOn": ["build"]
|
||||||
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
"executor": "@nx/eslint:lint",
|
"executor": "@nx/eslint:lint",
|
||||||
"outputs": ["{options.outputFile}"],
|
"outputs": ["{options.outputFile}"],
|
||||||
"options": {
|
"options": {
|
||||||
"lintFilePatterns": ["libs/tailwindcss-config/**/*.js"]
|
"lintFilePatterns": [
|
||||||
|
"libs/tailwindcss-config/**/*.ts",
|
||||||
|
"libs/tailwindcss-config/package.json"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
"executor": "@nx/jest:jest",
|
"executor": "@nx/jest:jest",
|
||||||
"outputs": ["{workspaceRoot}/coverage/libs/tailwindcss-config"],
|
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
||||||
"options": {
|
"options": {
|
||||||
"jestConfig": "libs/tailwindcss-config/jest.config.js"
|
"jestConfig": "libs/tailwindcss-config/jest.config.ts"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
const theme = require('./theme');
|
|
||||||
const themelite = require('./theme-lite');
|
|
||||||
const vegaCustomClasses = require('./vega-custom-classes');
|
|
||||||
const { VegaColours } = require('./vega-colours');
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
theme,
|
|
||||||
themelite,
|
|
||||||
plugins: [vegaCustomClasses],
|
|
||||||
VegaColours,
|
|
||||||
};
|
|
4
libs/tailwindcss-config/src/index.ts
Normal file
4
libs/tailwindcss-config/src/index.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export { theme } from './theme';
|
||||||
|
export { themeLite } from './theme-lite';
|
||||||
|
export { vegaCustomClasses } from './vega-custom-classes';
|
||||||
|
export { VegaColours } from './vega-colours';
|
@ -1,8 +1,8 @@
|
|||||||
const defaultTheme = require('tailwindcss/defaultTheme');
|
import defaultTheme from 'tailwindcss/defaultTheme';
|
||||||
const colors = require('tailwindcss/colors');
|
import colors from 'tailwindcss/colors';
|
||||||
const theme = require('./theme');
|
import { theme } from './theme';
|
||||||
|
|
||||||
module.exports = {
|
export const themeLite = {
|
||||||
...theme,
|
...theme,
|
||||||
colors: {
|
colors: {
|
||||||
...theme.colors,
|
...theme.colors,
|
@ -1,4 +1,4 @@
|
|||||||
module.exports = {
|
export const theme = {
|
||||||
screens: {
|
screens: {
|
||||||
xs: '500px',
|
xs: '500px',
|
||||||
sm: '640px',
|
sm: '640px',
|
@ -1,4 +1,4 @@
|
|||||||
const VegaColours = {
|
export const VegaColours = {
|
||||||
yellow: {
|
yellow: {
|
||||||
DEFAULT: '#D7FB50',
|
DEFAULT: '#D7FB50',
|
||||||
dark: '#9BE106',
|
dark: '#9BE106',
|
||||||
@ -32,7 +32,3 @@ const VegaColours = {
|
|||||||
400: '#626262',
|
400: '#626262',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
VegaColours,
|
|
||||||
};
|
|
@ -1,8 +1,8 @@
|
|||||||
const plugin = require('tailwindcss/plugin');
|
import plugin from 'tailwindcss/plugin';
|
||||||
const colors = require('tailwindcss/colors');
|
import colors from 'tailwindcss/colors';
|
||||||
const themelite = require('./theme-lite');
|
import { themeLite } from './theme-lite';
|
||||||
|
|
||||||
const vegaCustomClassesLite = plugin(function ({ addUtilities }) {
|
export const vegaCustomClassesLite = plugin(function ({ addUtilities }) {
|
||||||
addUtilities({
|
addUtilities({
|
||||||
'.percent-change-up::before': {
|
'.percent-change-up::before': {
|
||||||
content: ' ',
|
content: ' ',
|
||||||
@ -35,19 +35,19 @@ const vegaCustomClassesLite = plugin(function ({ addUtilities }) {
|
|||||||
textTransform: 'uppercase',
|
textTransform: 'uppercase',
|
||||||
textDecoration: 'none',
|
textDecoration: 'none',
|
||||||
backgroundColor: 'rgba(0, 143, 74, 0.1)',
|
backgroundColor: 'rgba(0, 143, 74, 0.1)',
|
||||||
border: `1px solid ${themelite.colors.darkerGreen}`,
|
border: `1px solid ${themeLite.colors.darkerGreen}`,
|
||||||
color: themelite.colors.darkerGreen,
|
color: themeLite.colors.darkerGreen,
|
||||||
'&:hover': {
|
'&:hover': {
|
||||||
backgroundColor: themelite.colors.darkerGreen,
|
backgroundColor: themeLite.colors.darkerGreen,
|
||||||
color: colors.white,
|
color: colors.white,
|
||||||
},
|
},
|
||||||
'&.selected': {
|
'&.selected': {
|
||||||
backgroundColor: themelite.colors.darkerGreen,
|
backgroundColor: themeLite.colors.darkerGreen,
|
||||||
color: colors.white,
|
color: colors.white,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'.buyButtonDark': {
|
'.buyButtonDark': {
|
||||||
color: themelite.colors.darkerGreen,
|
color: themeLite.colors.darkerGreen,
|
||||||
'&:hover': {
|
'&:hover': {
|
||||||
color: colors.black,
|
color: colors.black,
|
||||||
},
|
},
|
||||||
@ -59,19 +59,19 @@ const vegaCustomClassesLite = plugin(function ({ addUtilities }) {
|
|||||||
textTransform: 'uppercase',
|
textTransform: 'uppercase',
|
||||||
textDecoration: 'none',
|
textDecoration: 'none',
|
||||||
backgroundColor: 'rgba(255, 8, 126, 0.1)',
|
backgroundColor: 'rgba(255, 8, 126, 0.1)',
|
||||||
border: `1px solid ${themelite.colors.pink}`,
|
border: `1px solid ${themeLite.colors.pink}`,
|
||||||
color: themelite.colors.pink,
|
color: themeLite.colors.pink,
|
||||||
'&:hover': {
|
'&:hover': {
|
||||||
color: colors.white,
|
color: colors.white,
|
||||||
backgroundColor: themelite.colors.pink,
|
backgroundColor: themeLite.colors.pink,
|
||||||
},
|
},
|
||||||
'&.selected': {
|
'&.selected': {
|
||||||
backgroundColor: themelite.colors.pink,
|
backgroundColor: themeLite.colors.pink,
|
||||||
color: colors.white,
|
color: colors.white,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'.sellButtonDark': {
|
'.sellButtonDark': {
|
||||||
color: themelite.colors.pink,
|
color: themeLite.colors.pink,
|
||||||
'&:hover': {
|
'&:hover': {
|
||||||
color: colors.black,
|
color: colors.black,
|
||||||
},
|
},
|
||||||
@ -110,5 +110,3 @@ const vegaCustomClassesLite = plugin(function ({ addUtilities }) {
|
|||||||
// },
|
// },
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = vegaCustomClassesLite;
|
|
@ -1,8 +1,8 @@
|
|||||||
const plugin = require('tailwindcss/plugin');
|
import plugin from 'tailwindcss/plugin';
|
||||||
const colors = require('tailwindcss/colors');
|
import colors from 'tailwindcss/colors';
|
||||||
const theme = require('./theme');
|
import { theme } from './theme';
|
||||||
|
|
||||||
const vegaCustomClasses = plugin(function ({ addUtilities }) {
|
export const vegaCustomClasses = plugin(function ({ addUtilities }) {
|
||||||
addUtilities({
|
addUtilities({
|
||||||
'.calt': {
|
'.calt': {
|
||||||
fontFeatureSettings: "'calt'",
|
fontFeatureSettings: "'calt'",
|
||||||
@ -32,7 +32,7 @@ const vegaCustomClasses = plugin(function ({ addUtilities }) {
|
|||||||
'.dark .syntax-highlighter-wrapper .hljs': {
|
'.dark .syntax-highlighter-wrapper .hljs': {
|
||||||
background: theme.colors.vega.cdark[900],
|
background: theme.colors.vega.cdark[900],
|
||||||
color: theme.colors.vega.green.DEFAULT,
|
color: theme.colors.vega.green.DEFAULT,
|
||||||
border: 0,
|
border: '0',
|
||||||
},
|
},
|
||||||
'.syntax-highlighter-wrapper .hljs-literal': {
|
'.syntax-highlighter-wrapper .hljs-literal': {
|
||||||
color: theme.colors.vega.pink.DEFAULT,
|
color: theme.colors.vega.pink.DEFAULT,
|
||||||
@ -60,5 +60,3 @@ const vegaCustomClasses = plugin(function ({ addUtilities }) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = vegaCustomClasses;
|
|
@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"outDir": "../../dist/out-tsc",
|
|
||||||
"module": "commonjs",
|
|
||||||
"types": ["jest", "node"]
|
|
||||||
},
|
|
||||||
"include": ["**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"]
|
|
||||||
}
|
|
@ -47,7 +47,7 @@
|
|||||||
"@vegaprotocol/react-helpers": ["libs/react-helpers/src/index.ts"],
|
"@vegaprotocol/react-helpers": ["libs/react-helpers/src/index.ts"],
|
||||||
"@vegaprotocol/smart-contracts": ["libs/smart-contracts/src/index.ts"],
|
"@vegaprotocol/smart-contracts": ["libs/smart-contracts/src/index.ts"],
|
||||||
"@vegaprotocol/tailwindcss-config": [
|
"@vegaprotocol/tailwindcss-config": [
|
||||||
"libs/tailwindcss-config/src/index.js"
|
"libs/tailwindcss-config/src/index.ts"
|
||||||
],
|
],
|
||||||
"@vegaprotocol/tendermint": ["libs/tendermint/src/index.ts"],
|
"@vegaprotocol/tendermint": ["libs/tendermint/src/index.ts"],
|
||||||
"@vegaprotocol/trades": ["libs/trades/src/index.ts"],
|
"@vegaprotocol/trades": ["libs/trades/src/index.ts"],
|
||||||
|
Loading…
Reference in New Issue
Block a user