2.2.1 • Published 3 months ago

plasttic v2.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

Plasttic

Plasttic Web Workflow

A methodology based Front-End development environment for Static Sites.

npmNPM DownloadsLICENSEVOLTATwitter Follow


About


Welcome! 🖖

Plasttic Web Workflow is a methodology based professional Front-End development environment for Static Sites: HTML and CSS/PostCSS boilerplate, CSS Reset, Atomic Design System, Typescript/Javascript, Dev Server/Build Tool, File structure, Conventions & Best Practices.

This is not a Bundler nor a Framework, though it has some of the features of a Bundler, and it includes tools and rules that will improve the development process and produce quality code, it's built to support a different development process.

This workflow is intended to be open, allowing the developer to adopt or customize the methodology with the objective of producing accessible, scalable and robust interfaces.

Note: The files installed are not empty. The reason is that, by creating a template, it's easier to demonstrate the methodology, concepts and conventions, and even building upon the existing code.

Workflow

Dev Server, Build Tool, File/Folder Structure, HTML Boilerplate, CSS Reset, Templates, Atomic Design CSS, Print CSS, ES Modules, Typescript, PostCSS, CSS Styling, HTML/CSS/JS Minification, Conventions, Linting, Testing, Image Optimization (Soon!)


Related projects


Table of Contents


Methodology


  • Core Fundamentals
  • Best Practices/Conventions
  • Performance/Core Web Vitals
  • Separation of Concerns
  • Documentation
  • Design System/Atomic Design
  • BEM Methodology
  • CSS Reset
  • HTML Boilerplate
  • Semantic HTML/Accessibility
  • Progressive Enhancement
  • CSS/Postcss
  • Typescript/Javascript
  • Code Conventions/Linting
  • Debug/Test

Start


Quick Start

(cd into your projects folder)
npx create-plasttic
cd <project-name>
npm run start
  1. Creates a folder with the project name you defined
  2. Downloads and installs the latest version of Plasttic Web Workflow
  3. Installs all the project dependencies, Git hooks (Linting pre-commit), Playwright install

Typescript


  • npm run start installs Typescript globally *although it is installed as a devDependency, the Dev Scripts may not work as expected if you do not install it globally also.
  • TS-Reset is installed by default. If you wish to disable it, delete the reset.d.ts file.
  • Linting: Prettier ESLint (requires some configuration: see the plugin page and the Plasttic VSCode settings). Install ESLint to provide error and warning messages in the files.

Development


  • Run npm run dev to start the dev server on http://localhost:8000 *
  • Run npm run build when you are ready to publish *

  • *Source folder: src/, Dev folder: dev/, Build folder: dist/

Customizing


(Note: The files installed are not empty. The reason is that, by creating a template, it's easier to demonstrate the methodology, concepts and conventions, and even building upon the existing code.)

  • Search for "TODO:" in comments, relative to info that needs to be changed or checked. After, change it to "DONE:". If using VS Code, use the Todo Tree extension or TODO Highlight
  • If .##gitignore## exists, rename it to .gitignore and customize to your project info.
  • :warning: Do not delete, rename or move files in the root folder. Do not delete, move or rename folders in the src folder, except the templates folder. Do not delete or move the following files in assets folder: js/scripts.ts (you can rename to scripts.js), js/modules/module.ts (at least one file name.ts/.js must exist), css/styles.css and css/print.css (do not rename this CSS files) - this files must exist, even if empty. If not used, delete the corresponding tag in the HTML page. :warning:

Development with https


  • Step 1: Run mkdir certs
  • Step 2: Run cd certs
  • Step 3: Install certificate with mkcert
  • Step 4: Check certificate filenames and/or path in the file browser-sync.cjs
  • Step 5: Run npm run dev:ssl to start the dev server on https://localhost:8000

Libraries


  • TS-Reset (If you wish to disable it, delete the reset.d.ts file.)
  • Zod

Linting


(Extends the editor File Type rules, .editorconfig and VS Code settings)

Files *UsageResultConfigPluginReferences
Prettierhtml, css, md, jsonOn Save, Build Script, Pre Commit, PluginErrors, Warnings and Fix.prettierrc, .prettierignorePrettier
ESLintjs, ts (src/tests)On Save, Build Script, Pre Commit, PluginsErrors, Warnings and Fix.eslintrc.cjs, .eslintignorePrettier + ESLint, ESLint **Airbnb, Airbnb Typescript, Wes Bos ESLint Setup
StylelintcssOn Save, Build Script, Pre Commit, PluginWarnings, Limited fixes and CSS sorting.stylelintrc.jsonStylelint

*all linting is done on the src folder, except for ESLint that also lints the tests folder.
**see Typescript

Testing


AboutUsageFolders *NotesPlugins
JestUnit nad Integration testingBuild tool, Pull Request, Terminal (npx jest)dev, ci, reportsTypescript support, Jest CLIJest
PlaywrightEnd-to-End testingBuild tool, Pull Request, Terminaldev, ci, reportsPlaywright Test for VSCode
LighthouseWeb Core Vitalsnpm run test:vitals:page --page=page.htmlreports
UnlighthouseLighthouse website testingnpm run test:vitals:site --url=https://example.comreports **

*This folders are inside the tests root folder separated by test app. For Jest and Playwright, the tests placed on the ci folder will run automatically on npm run build and on pull request and the dev folder is were individual tests are placed to run from the terminal with npx jest.
**The Unlighthouse reports folder .unlighthouse is located in the root directory.


Manual Install (Clone)

  • Step 1: Copy the repository git clone https://github.com/tojeiro-me/Plasttic.git
  • Step 2: Move the the contents of the package folder into your <project-folder>
  • Step 3: Run cd <project-folder>
  • Step 4: Rename .##gitignore## to .gitignore
  • Step 5: Run npm run start
    • Installs the needed dependencies
    • Installs Husky Git Hooks
    • Initializes Playwright
  • Step 6: Run npm run dev to start the dev server on http://localhost:8000 *
  • Step 7: Run npm run build when you are ready to publish *

  • *Source folder: src/, Dev folder: dev/, Build folder: dist/

Templates


Documentation


  • File Comments
  • Check docs folder :construction:
  • Documentation website (Soon!)

Please check the CHANGELOG for major or breaking changes

Links


  • Website :construction:
  • Documentation (Soon!)

Follow


TwitterMastodonGithub


License



Plasttic

3.0.0-alpha.0

3 months ago

2.2.1

10 months ago

2.2.0

10 months ago

2.1.9

10 months ago

2.1.8

10 months ago

2.1.7

10 months ago

2.1.6

10 months ago

2.1.5

10 months ago

2.1.4

10 months ago

2.1.3

11 months ago

2.1.2

11 months ago

2.1.1

11 months ago

2.1.0

11 months ago

2.0.8

11 months ago

2.0.7

11 months ago

2.0.6

11 months ago

2.0.5

11 months ago

2.0.4

11 months ago

2.0.3

11 months ago

2.0.2

11 months ago

2.0.1

11 months ago

2.0.0

11 months ago