Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
bstaruk committed Aug 9, 2021
2 parents 66c273c + 8b17bbc commit e8217e1
Show file tree
Hide file tree
Showing 25 changed files with 342 additions and 143 deletions.
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,5 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{ejs,htm,html}]
indent_size = 4

[*.md]
trim_trailing_whitespace = false
1 change: 0 additions & 1 deletion .stylelintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ module.exports = {
5,
{ ignore: ['blockless-at-rules', 'pseudo-classes'] },
],
'scss/at-extend-no-missing-placeholder': null,
},
};
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,15 @@
[![dependencies status](https://david-dm.org/bstaruk/starbase/status.svg)](https://david-dm.org/bstaruk/starbase)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fbstaruk%2Fstarbase.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fbstaruk%2Fstarbase?ref=badge_shield)

starbase is a production-ready website boilerplate built with webpack 5, modern JS (via Babel) & Sass that enables developers to get up and running in minutes using some of the most powerful front-end tools available in 2021:
starbase is a production-ready website boilerplate built with webpack 5, Babel 7 & Sass that enables developers to get up and running in minutes using some of the most powerful front-end tools available in 2021:

* [Node.js](https://github.com/nodejs/node), [webpack 5](https://github.com/webpack/webpack) & [webpack-dev-server](https://github.com/webpack/webpack-dev-server)
* [Babel 7](https://github.com/babel/babel) w/ [ESLint](https://github.com/eslint/eslint) & [Prettier](https://github.com/prettier/prettier)
* [Sass](https://github.com/sass) w/ [stylelint](https://github.com/stylelint/stylelint)

The primary mission is to be small in scope so that it may be easily extended and customized, or used as a learning tool for developers who are trying to become familiar with webpack 5, Sass and/or modern JS.

## License

starbase is open source and free software, so you may to do whatever you wish with it -- commercially or personally. You can buy me a beer next time you're in Boston, star the project and tell a friend, or you can erase all signs of origin and tell your coworkers that you made it yourself. It's all good!

## Using starbase

### Getting Started
## Getting Started

After completing the steps below, you will be ready to begin using starbase:

Expand Down Expand Up @@ -100,3 +94,7 @@ If you want to remove these for any reason, perform the following steps:
starbase is setup to run with assets referenced via relative paths so generated `.html` files can be opened without needing a deployment. If you plan on deploying to a web server, it'll be a good idea to set the `publicPath` in `/webpack/webpack.config.base.js`.

This variable should be set to `/` if the app will run at the root of a domain or subdomain, or to `/folderName` (example) if it'll be deployed to a subfolder.

## License

starbase is open source and free software, so you may to do whatever you wish with it -- commercially or personally. You can buy me a beer next time you're in Boston, star the project and tell a friend, or you can erase all signs of origin and tell your coworkers that you made it yourself. It's all good!
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "starbase",
"version": "3.2.0",
"version": "3.2.1",
"author": "Brian Staruk <[email protected]>",
"contributors": [
{
Expand Down
4 changes: 1 addition & 3 deletions src/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@
/* Unordered Imports */
@import 'styles/footer';
@import 'styles/header';
@import 'styles/heading';
@import 'styles/link';
@import 'styles/rich-text';
@import 'styles/main';
@import 'styles/repo-details';
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
216 changes: 173 additions & 43 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,53 +1,183 @@
<!DOCTYPE html>
<html class="no-js">

<head>
<meta charset="UTF-8">
<title>starbase - a modern website boilerplate for web developers</title>
<meta name="description" content="starbase is an open source website boilerplate built with webpack 5, modern JS (via Babel) &amp; Sass">
<title>starbase - it has electrolytes</title>
<meta name="description"
content="starbase is a production-ready website boilerplate built with webpack 5, Babel 7 & Sass">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#fefefe">
</head>

<body>
<!-- header -->
<header role="banner" class="header">
<div class="header__brand">
<img src="assets/starbase.png" alt="starbase logo" class="header__image" />
<h1 class="header__title">starbase</h1>
</div>
<p>starbase is an open source website boilerplate built with <a class="link link--red" href="https://github.com/webpack/webpack" title="webpack on github">webpack 5</a>, modern JS (via <a class="link link--orange" href="https://github.com/babel/babel" title="babel on github">Babel</a>) &amp; <a class="link link--green" href="https://github.com/sass" title="sass on github">Sass</a>.
</header>

<!-- main content area -->
<main class="rich-text">
<section>
<h2>Why it's here</h2>
<p>starbase was created in early 2017, shortly after webpack 2 was released and it became clear that my favorite development boilerplates were not being maintained or upgraded to the latest versions of the technologies they were built to utilize.</p>
<p>The primary mission of starbase is to provide an elegant but simple baseline development process that generates clean, production-ready assets while being bloat-free and easy to maintain.</p>
</section>

<section>
<h2>What it does</h2>
<p>starbase enables developers to spin up new projects and begin coding within minutes instead of hours. It is ready, right out of the box, to watch your code during development and can handle production builds when you're ready to integrate and/or deploy.</p>
<p>The <code>start</code> command uses <a class="link link--blue" href="https://github.com/webpack/webpack-dev-server" title="webpack-dev-server on github">webpack-dev-server</a> to serve up your project on a development server (localhost) which will recompile and lint as you modify the source. You can even access this web server via LAN, with a static IP, for testing your app on multiple devices.</p>
<p>The <code>build</code> command will compile production-ready (linted, minified &amp; optimized) assets that can be integrated into your CMS theme or used as a standalone static website.</p>
</section>

<section>
<h2>Who it's for</h2>
<p>starbase is open source and completely free for personal or commercial use. It is a personal project-- a living code styleguide and outlet for technical exploration that you can make your own if you dig it. Pick it up, check it out and make it do a barrel roll.</p>
<p>If you encounter any problems along the way, please be sure to <a class="link link--purple" href="https://github.com/bstaruk/starbase/issues" title="report an issue with starbase on github">report an issue</a> on GitHub and it'll likely be taken care of faster than you think!</p>
</section>

<section id="repo-details" data-owner="bstaruk" data-repo="starbase">
<h3>Who's using it</h3>
<p>Loading...</p>
<p class="repo-details__description">The information above was loaded asynchronously from GitHub using fetch. Fetch polyfills are included with the app so it'll still work perfectly with older browsers.</p>
</section>
</main>

<!-- footer -->
<footer role="contentinfo" class="footer">
<p>crafted in boston by <a class="h-card" href="https://brian.staruk.net" title="continue to brian.staruk.net">brian staruk</a> | <a href="https://github.com/bstaruk/starbase" title="learn more about starbase on github">starbase on github</a></p>
</footer>
<!-- header -->
<header role="banner" class="header">
<div class="header__brand">
<img src="assets/starbase.png" alt="starbase logo" class="header__image" />
<h1 class="header__title">starbase</h1>
</div>
<p>starbase is a production-ready website boilerplate built with webpack 5, Babel 7 & Sass that enables developers
to get up and running in minutes using some of the most powerful front-end tools available in 2021:</p>
<ul class="header__features">
<li><a href="https://github.com/nodejs/node">Node.js</a>, <a href="https://github.com/webpack/webpack">webpack
5</a> & <a href="https://github.com/webpack/webpack-dev-server">webpack-dev-server</a></li>
<li><a href="https://github.com/babel/babel">Babel 7</a> w/ <a href="https://github.com/eslint/eslint">ESLint</a>
& <a href="https://github.com/prettier/prettier">Prettier</a></li>
<li><a href="https://github.com/sass">Sass</a> w/ <a href="https://github.com/stylelint/stylelint">stylelint</a>
</li>
</ul>
<p>The primary mission is to be small in scope so that it may be easily extended and customized, or used as a
learning tool for developers who are trying to become familiar with webpack 5, Sass and/or modern JS.</p>
</header>

<!-- main content area -->
<main class="main">
<section>
<h2>Getting Started</h2>
<p>After completing the steps below, you will be ready to begin using starbase:</p>
<ul>
<li>Install <a href="https://nodejs.org">Node.js</a> (latest
LTS recommended)</li>
<li>Clone starbase into your project root directory</li>
<li>Install dependencies by running <code>npm install</code> in your project root directory</li>
</li>
</ul>

<h3>Local Development</h3>
<p>starbase uses <a href="https://github.com/webpack/webpack-dev-server">webpack-dev-server</a>
to serve up your project at <a href="http://localhost:8080">http://localhost:8080</a> for
streamlined and
convenient development.</p>

<p>After running <code>npm run start</code> in the project root, your <code>/src</code> code will be served
at the url above and
watched for changes. As you modify code in <code>/src</code>, the project will be recompiled and your
browser will
refresh to show the latest changes.</p>

<pre>cd /path/to/starbase
npm run start</pre>

<h3>Building for Production</h3>
<p>Use <code>npm run build</code> in your project root to run a production build.</p>
<p>Production builds compile & minify your assets into <code>/dist</code> for distribution and/or
integration into
whatever codebase you'll be using these assets in.</p>

<pre>cd /path/to/starbase
npm run build</pre>
</section>

<section>
<h2>Features & Configurations</h2>
<h3>JS & Sass linting</h3>
<p>starbase uses <a href="http://eslint.org/">ESLint</a> for Javascript (ES6) linting
and <a href="https://github.com/stylelint/stylelint">stylelint</a> for Sass
linting to encourage consistent
code throughout your project. The configs (<code>/.eslintrc.js</code> and <code>/.stylelintrc.js</code>
respectively) include a
solid foundation to build upon, utilizing the most popular industry-standardized plugins such as
<a href="https://www.npmjs.com/package/eslint-config-airbnb">eslint-config-airbnb</a> and
<a href="https://github.com/bjankord/stylelint-config-sass-guidelines">stylelint-config-sass-guidelines</a>.
</p>

<h3>Prettier JS Formatting</h3>
<p>starbase uses <a href="https://github.com/prettier/prettier">Prettier</a> to
enforce and simplify code
consistency. If you use VS Code, check out the <a
href="https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode">Prettier VS Code
extension</a>.</p>

<h3>HTML Webpack Plugin</h3>
<p>starbase uses <a href="https://github.com/jantimon/html-webpack-plugin">HTML
Webpack Plugin</a>, which enables webpack to
handle assets that are linked from within our HTML templates, such as images and embedded videos. It
also makes sure our generated <code>.js</code> & <code>.css</code> files are included where they need to
be.</p>
<p>Open the webpack configs if you need to add more pages -- and be sure to check out the plugin
documentation to learn about the more advanced features such as <code>.ejs</code> and environment
variable support.</p>

<h3>Asset Hashing (Cache Busting)</h3>
<p>The assets generated by starbase are <a href="https://webpack.js.org/guides/caching/">hashed</a> as a
cache-busting
mechanism. Hashes are generated via file contents so they will only change when the files themselves
have changed.</p>
<p>This feature ships with webpack (and the loaders we use), so removing it is pretty straightforward. Open
the webpack configs and remove the hashes from the filenames, which should look something like this:
<code>.[hash:8]</code>.
</p>
<p>Removing hashing for production builds is not recommended.</p>

<h3>Build-Time Cleanup</h3>
<p>starbase is setup to clear all contents of <code>/dist</code> (where compiled assets are piped into)
during each <code>npm run build</code>. If you'd like to remove this part of the build process, perform
the following steps:</p>
<ol>
<li>remove <code>CleanWebpackPlugin</code> from the plugins array in
<code>/webpack/webpack.config.prod.js</code>
</li>
<li>remove <code>CleanWebpackPlugin</code> as a requirement at the top of
<code>/webpack/webpack.config.prod.js</code>
</li>
<li>remove the <code>CleanWebpackPlugin</code> dependency from <code>/package.json</code></li>
</ol>
<p>Removing the cleanup process means that deleted assets in <code>/src</code> will not be deleted in
<code>/dist</code>
until you
manually do so. I recommend keeping the cleanup process intact unless you have a specific reason not to,
such as having un-managed assets in <code>/dist</code>.
</p>

<h3>Fetch & Promise Polyfills</h3>
<p>Because starbase was built to accommodate ES6 & CommonJS (and not jQuery) it is assumed that you'll be
using <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API">fetch</a> for
asynchronous
requests.</p>
<p>Fetch is supported in all modern browsers, but some old dogs still don't support it and that's what we
need the <a href="https://github.com/stefanpenner/es6-promise">es6-promise</a> &
<a href="https://github.com/github/fetch">whatwg-fetch</a> polyfills for.
</p>
<p>If you want to remove these for any reason, perform the following steps:</p>
<ol>
<li>remove <code>es6-promise</code> & <code>whatwg-fetch</code> from <code>/package.json</code></li>
<li>remove the relevant imports in <code>/src/app.js</code></li>
</ol>
</section>

<section>
<h2>Notes & Considerations</h2>

<h3>Root Path</h3>
<p>starbase is setup to run with assets referenced via relative paths so generated <code>.html</code> files
can be opened without needing a deployment. If you plan on deploying to a web server, it'll be a good
idea to set the <code>publicPath</code> in <code>/webpack/webpack.config.base.js</code>.</p>
<p>This variable should be set to <code>/</code> if the app will run at the root of a domain or subdomain,
or to <code>/folderName</code> (example) if it'll be deployed to a subfolder.</p>
</section>

<section>
<h2>License</h2>
<p>starbase is open source and free software, so you may to do whatever you wish with it -- commercially or
personally. You can buy me a beer next time you're in Boston, star the project and tell a friend, or you
can erase all signs of origin and tell your coworkers that you made it yourself. It's all good!</p>
</section>

<section id="repo-details" data-owner="bstaruk" data-repo="starbase">
<h2>Who's using it</h2>
<p>Loading...</p>
<p class="repo-details__description">The information above was loaded asynchronously from GitHub using
fetch. Fetch polyfills are included with the app so it'll still work perfectly with older browsers.</p>
</section>
</main>

<!-- footer -->
<footer role="contentinfo" class="footer">
<p>crafted in boston by <a class="h-card" href="https://brian.staruk.net" title="continue to brian.staruk.net">brian
staruk</a> | <a href="https://github.com/bstaruk/starbase" title="learn more about starbase on github">starbase
on github</a></p>
</footer>
</body>

</html>
13 changes: 13 additions & 0 deletions src/styles/_fonts.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@font-face {
font-family: 'PT Sans';
font-style: normal;
font-weight: normal;
src: url('assets/fonts/PTSans-Regular.woff2') format('woff2'), url('assets/fonts/PTSans-Regular.woff') format('woff');
}

@font-face {
font-family: 'PT Serif';
font-style: normal;
font-weight: normal;
src: url('assets/fonts/PTSerif-Regular.woff2') format('woff2'), url('assets/fonts/PTSerif-Regular.woff') format('woff');
}
4 changes: 2 additions & 2 deletions src/styles/_root.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
}

body {
background-color: $color-white;
color: $color-dark-grey;
background-color: $color-background;
color: $color-foreground;
font-family: $font-sans;
font-size: 0.95rem;
line-height: 1.4;
Expand Down
22 changes: 12 additions & 10 deletions src/styles/_vars.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
/* Colors */
$color-white: #fefefe;
$color-silver: #ccc;
$color-grey: #888;
$color-dark-grey: #333;
$color-red: #cc283d;
$color-orange: #ee763a;
$color-green: #2ba667;
$color-blue: #2472be;
$color-purple: #861bbb;
/* Dracula Colors */
$color-background: #282a36;
$color-selection: #44475a;
$color-foreground: #f8f8f2;
$color-comment: #6272a4;
$color-cyan: #8be9fd;
$color-green: #50fa7b;
$color-orange: #ffb86c;
$color-pink: #ff79c6;
$color-purple: #bd93f9;
$color-red: #f55;
$color-yellow: #f1fa8c;

/* Fonts */
$font-sans: 'PT Sans', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
Expand Down
11 changes: 11 additions & 0 deletions src/styles/atoms/code.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
%code {
background-color: $color-selection;
font-size: 0.85em;
padding: 0 0.25rem;
}

%pre {
background-color: $color-selection;
font-size: 0.9em;
padding: 0.5rem;
}
20 changes: 20 additions & 0 deletions src/styles/atoms/heading.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
%heading {
font-family: $font-serif;
font-weight: normal;
}

%heading--h1 {
font-size: 1.875rem;
}

%heading--h2 {
font-size: 1.5rem;
}

%heading--h3 {
font-size: 1.25rem;
}

%heading--h4 {
font-size: 1.125rem;
}
15 changes: 15 additions & 0 deletions src/styles/atoms/link.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
%link {
text-decoration: underline;

&:hover {
text-decoration: none;
}
}

%link--green {
color: $color-green;
}

%link--comment {
color: $color-comment;
}
Loading

0 comments on commit e8217e1

Please sign in to comment.