Refactor tailwind configuration
This commit is contained in:
parent
4bc533a656
commit
9e9476f9a4
|
|
@ -5,14 +5,14 @@ Project setup is based on [cookiecutter-django](https://github.com/cookiecutter/
|
||||||
## Run for development
|
## Run for development
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# run tailwind cli (on project root folder!)
|
|
||||||
npm run tailwind
|
|
||||||
|
|
||||||
# run vue vite dev server
|
# run vue vite dev server
|
||||||
cd client && npm run dev
|
cd client && npm run dev
|
||||||
|
|
||||||
# reset db and run django dev server
|
# reset db and run django dev server
|
||||||
./prepare_server.sh
|
./prepare_server.sh
|
||||||
|
|
||||||
|
# run tailwind cli (for tailwind support on django templates)
|
||||||
|
cd client && npm run tailwind
|
||||||
```
|
```
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
@ -61,7 +61,7 @@ npm run dev
|
||||||
|
|
||||||
### General part
|
### General part
|
||||||
|
|
||||||
Cypress and TailwindCSS ist installed for client and server, so there is this package.json on the project root directory
|
Cypress is installed for client and server, so there is this package.json on the project root directory
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# in project root directory
|
# in project root directory
|
||||||
|
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
{
|
|
||||||
"name": "Using fixtures to represent data",
|
|
||||||
"email": "hello@cypress.io",
|
|
||||||
"body": "Fixtures are a great way to mock data for responses to routes"
|
|
||||||
}
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
// https://docs.cypress.io/api/introduction/api.html
|
|
||||||
|
|
||||||
describe('My First Test', () => {
|
|
||||||
it('visits the app root url', () => {
|
|
||||||
cy.visit('/')
|
|
||||||
cy.contains('h1', 'You did it!')
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
/* eslint-env node */
|
|
||||||
// ***********************************************************
|
|
||||||
// This example plugins/index.ts can be used to load plugins
|
|
||||||
//
|
|
||||||
// You can change the location of this file or turn off loading
|
|
||||||
// the plugins file with the 'pluginsFile' configuration option.
|
|
||||||
//
|
|
||||||
// You can read more here:
|
|
||||||
// https://on.cypress.io/plugins-guide
|
|
||||||
// ***********************************************************
|
|
||||||
|
|
||||||
// This function is called when a project is opened or re-opened (e.g. due to
|
|
||||||
// the project's config changing)
|
|
||||||
|
|
||||||
export default ((on, config) => {
|
|
||||||
// `on` is used to hook into various events Cypress emits
|
|
||||||
// `config` is the resolved Cypress config
|
|
||||||
return config
|
|
||||||
}) as Cypress.PluginConfig
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"extends": "@vue/tsconfig/tsconfig.node.json",
|
|
||||||
"include": ["./**/*"],
|
|
||||||
"compilerOptions": {
|
|
||||||
"module": "CommonJS",
|
|
||||||
"preserveValueImports": false,
|
|
||||||
"types": ["node", "cypress/types/cypress"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
// ***********************************************
|
|
||||||
// This example commands.js shows you how to
|
|
||||||
// create various custom commands and overwrite
|
|
||||||
// existing commands.
|
|
||||||
//
|
|
||||||
// For more comprehensive examples of custom
|
|
||||||
// commands please read more here:
|
|
||||||
// https://on.cypress.io/custom-commands
|
|
||||||
// ***********************************************
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// -- This is a parent command --
|
|
||||||
// Cypress.Commands.add('login', (email, password) => { ... })
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// -- This is a child command --
|
|
||||||
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// -- This is a dual command --
|
|
||||||
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// -- This will overwrite an existing command --
|
|
||||||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
// ***********************************************************
|
|
||||||
// This example support/index.js is processed and
|
|
||||||
// loaded automatically before your test files.
|
|
||||||
//
|
|
||||||
// This is a great place to put global configuration and
|
|
||||||
// behavior that modifies Cypress.
|
|
||||||
//
|
|
||||||
// You can change the location of this file or turn off
|
|
||||||
// automatically serving support files with the
|
|
||||||
// 'supportFile' configuration option.
|
|
||||||
//
|
|
||||||
// You can read more here:
|
|
||||||
// https://on.cypress.io/configuration
|
|
||||||
// ***********************************************************
|
|
||||||
|
|
||||||
// Import commands.js using ES2015 syntax:
|
|
||||||
import './commands'
|
|
||||||
|
|
||||||
// Alternatively you can use CommonJS syntax:
|
|
||||||
// require('./commands')
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"extends": "@vue/tsconfig/tsconfig.web.json",
|
|
||||||
"include": ["./integration/**/*", "./support/**/*"],
|
|
||||||
"compilerOptions": {
|
|
||||||
"isolatedModules": false,
|
|
||||||
"target": "es5",
|
|
||||||
"lib": ["es5", "dom"],
|
|
||||||
"types": ["cypress"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -4,10 +4,12 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vue-tsc --noEmit && vite build && cp ./dist/index.html ../server/vbv_lernwelt/templates/vue/index.html && cp -r ./dist/static/vue ../server/vbv_lernwelt/static/",
|
"build": "vue-tsc --noEmit && vite build && cp ./dist/index.html ../server/vbv_lernwelt/templates/vue/index.html && cp -r ./dist/static/vue ../server/vbv_lernwelt/static/",
|
||||||
|
"build:tailwind": "tailwindcss -i tailwind.css -o ../server/vbv_lernwelt/static/css/tailwind.css --minify",
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"coverage": "vitest run --coverage",
|
"coverage": "vitest run --coverage",
|
||||||
"typecheck": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
|
"typecheck": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
|
||||||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
|
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
||||||
|
"tailwind": "tailwindcss -i tailwind.css -o ../server/vbv_lernwelt/static/css/tailwind.css --watch"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@headlessui/vue": "^1.6.4",
|
"@headlessui/vue": "^1.6.4",
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
module.exports = {
|
||||||
|
plugins: {
|
||||||
|
tailwindcss: {},
|
||||||
|
autoprefixer: {},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
@import "../../../../server/vbv_lernwelt/static/css/tailwind.css";
|
|
||||||
|
|
@ -5,7 +5,7 @@ import {setupI18n} from './i18n'
|
||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
import router from './router'
|
import router from './router'
|
||||||
|
|
||||||
import '@/assets/styles/index.scss'
|
import '../tailwind.css'
|
||||||
|
|
||||||
const i18n = setupI18n()
|
const i18n = setupI18n()
|
||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@ const colors = require('tailwindcss/colors')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
content: [
|
content: [
|
||||||
'./client/index.html',
|
'./index.html',
|
||||||
'./client/src/**/*.{vue,js,ts,jsx,tsx}',
|
'./src/**/*.{vue,js,ts,jsx,tsx}',
|
||||||
'./server/vbv_lernwelt/**/*.{html,js}',
|
'../server/vbv_lernwelt/**/*.{html,js}',
|
||||||
],
|
],
|
||||||
theme: {
|
theme: {
|
||||||
fontFamily: {
|
fontFamily: {
|
||||||
|
|
@ -2,19 +2,16 @@
|
||||||
"name": "vbv_lernwelt_cypress",
|
"name": "vbv_lernwelt_cypress",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npm install --prefix client && npm run build --prefix client && npm run build:tailwind",
|
"build": "npm install --prefix client && npm run build --prefix client && npm run build:tailwind --prefix client",
|
||||||
"build:tailwind": "tailwindcss -i ./tailwind/input.css -o ./server/vbv_lernwelt/static/css/tailwind.css --minify",
|
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"cypress:open": "cypress open",
|
"cypress:open": "cypress open",
|
||||||
"cypress:run": "cypress run",
|
"cypress:run": "cypress run",
|
||||||
"cypress:ci": "cypress run --config baseUrl=http://localhost:8001",
|
"cypress:ci": "cypress run --config baseUrl=http://localhost:8001",
|
||||||
"cypress:ci:open": "cypress open --config baseUrl=http://localhost:8001",
|
"cypress:ci:open": "cypress open --config baseUrl=http://localhost:8001"
|
||||||
"tailwind": "tailwindcss -i ./tailwind/input.css -o ./server/vbv_lernwelt/static/css/tailwind.css --watch"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tailwindcss/forms": "^0.5.2",
|
"@tailwindcss/forms": "^0.5.2",
|
||||||
"@tailwindcss/typography": "^0.5.2",
|
"@tailwindcss/typography": "^0.5.2",
|
||||||
"cypress": "^9.4.1",
|
"cypress": "^9.4.1"
|
||||||
"tailwindcss": "^3.0.24"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue