Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dimaslz/preact-ts-tailwindcss


https://github.com/dimaslz/preact-ts-tailwindcss

Last synced: 5 days ago
JSON representation

Awesome Lists containing this project

README

        

# PREACT app with Typescript and Tailwind CSS
This is my basic setup to work with PREACT, built with [https://github.com/preactjs/preact-cli](https://github.com/preactjs/preact-cli) with some updates.

**NOTE**: This repository doesn't pretend to be the solution, just a help maybe, basic setup to start a project with [PREACT](https://preactjs.com/), last versions of TS and Tailwind.
Feel free to fork, I hope to help you :), feedback are welcome.

* Eslint: updated with https://github.com/developit/eslint-config-developit
* Move tests close to component
* Move CSS to SASS (.css files to .scss)
* Allow use .env files ([https://github.com/robinvdvleuten/preact-cli-plugin-env-vars](https://github.com/robinvdvleuten/preact-cli-plugin-env-vars))
* Commit linter ([https://www.conventionalcommits.org/en/v1.0.0/](https://www.conventionalcommits.org/en/v1.0.0/))

## CLI Commands
* `yarn install`: Installs dependencies

* `yarn dev`: Run a development, HMR server (by default is using port 8080, --port XXXX to change it)

* `yarn serve`: Run a production-like server

* `yarn build`: Production-ready build

* `yarn lint`: Pass TypeScript files using ESLint

* `yarn test`: Run Jest and Enzyme with
[`enzyme-adapter-preact-pure`](https://github.com/preactjs/enzyme-adapter-preact-pure) for
your tests

For detailed explanation on how things work, checkout the [CLI Readme](https://github.com/developit/preact-cli/blob/master/README.md).

## Setup ENV vars
```javascript
PREACT_APP_SECRET="my secret string"
```

use in your code as
```javascript
console.log("env variable", process.env.PREACT_APP_SECRET);
```

## Author
Dimas Lรณpez ยท FullStack Software Developer

๐Ÿฆ https://twitter.com/dimaslz

๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป https://dimaslz.dev

๐Ÿ“„ https://www.linkedin.com/in/dimaslopezzurita