Skip to content

Commit

Permalink
Merge pull request #192 from quoid/v4.0.0
Browse files Browse the repository at this point in the history
macOS v4.x iOS v1.x
  • Loading branch information
quoid authored Jan 6, 2022
2 parents aa8c4b0 + f6ef422 commit b8b8a7f
Show file tree
Hide file tree
Showing 166 changed files with 60,142 additions and 4,180 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/node_modules/
/public/build/
codemirror/
25 changes: 20 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
}
],
"globals": {
"safari": "writable",
"_safari": "readonly"
"_browser": "writable",
"browser": "readonly"
},
"rules": {
"array-bracket-spacing": [
Expand All @@ -39,6 +39,7 @@
}
],
"dot-notation": "error",
"eqeqeq": ["error", "smart"],
"indent": [
"error",
4,
Expand All @@ -57,12 +58,23 @@
"before": true
}
],
"no-bitwise": "error",
"no-mixed-operators": "error",
"no-unused-vars": [
"error",
{
"args": "none"
}
],
"no-use-before-define": [
"error",
{
"classes": true,
"functions": false,
"variables": true
}
],
"no-var": "error",
"object-curly-spacing": [
"error",
"never"
Expand All @@ -75,6 +87,7 @@
"error",
"before"
],
"prefer-const": "error",
"quotes": [
"error",
"double"
Expand All @@ -86,13 +99,15 @@
"omitLastInOneLineBlock": true
}
],
"space-before-function-paren": ["error", {
"anonymous": "never",
"named": "never",
"asyncArrow": "never"
}],
"space-in-parens": [
"error",
"never"
],
"require-jsdoc": [
"off"
],
"jsx-a11y/a11y-missing-attribute": "off"
}
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ehthumbs.db
Thumbs.db

/node_modules/
/public/build/
/public/*/build/
/temp/

# xcode
Expand Down
7 changes: 6 additions & 1 deletion .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"extends": "stylelint-config-standard",
"extends": [
"stylelint-config-standard",
"stylelint-config-html/svelte"
],
"rules": {
"comment-empty-line-before": [
"always",
Expand All @@ -8,6 +11,8 @@
}
],
"indentation": 4,
"no-descending-specificity": null,
"selector-class-pattern": null,
"selector-pseudo-class-no-unknown": [
true,
{
Expand Down
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"eslint.validate": [
"svelte"
],
"stylelint.validate": [
"css",
"postcss",
"svelte"
],
"svelte.plugin.svelte.compilerWarnings": {
"a11y-missing-attribute": "error"
},
Expand Down
160 changes: 135 additions & 25 deletions README.md

Large diffs are not rendered by default.

61 changes: 61 additions & 0 deletions etc/app_ios/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next
30 changes: 30 additions & 0 deletions etc/app_ios/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# static-website-builder

### Requirements:
- [node](https://nodejs.org/en/)
- [gulp](https://gulpjs.com)

### Installation:
1. Have the requirements installed on your local machine
1. Clone this repository locally
1. Navigate to where you cloned this repository
1. Run `npm install`

### Usage:
- `npm run server` starts the dev server
- **Only edit files with the `src` folder**
- Navigate to `http://localhost:8888` to view output
- LiveReload *is* enabled
- `npm run build` builds the website to the `output` folder
- **Do *not* rely on the server command to build the website**
- `npm run clean` cleans the output folder
- **The clean task is built into *both* the server and build commands**, you won't need to often run this command

### Features
- autoprefixing for css
- @import enabled for css
- minifying of css content
- inlining and compression of all files (css, js, svgs, etc...)
- easy deployment to Netlify
- build command = `npm run build`
- publish directory = `output/`
125 changes: 125 additions & 0 deletions etc/app_ios/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
const { dest, parallel, series, src, watch } = require("gulp");
var assets = require("postcss-assets");
const atImport = require("postcss-import");
const autoprefixer = require("autoprefixer");
const connect = require("gulp-connect");
const del = require("del");
const htmlmin = require("gulp-htmlmin");
const inline = require("gulp-inline-source");
const nano = require("cssnano");
const nunjucksRender = require("gulp-nunjucks-render");
const postcss = require("gulp-postcss");
const sourcemaps = require("gulp-sourcemaps");

const sourcePath = "./src";
const outputPath = "./output";

function clean() {
// delete all files at the output path, except .gitignore
const paths = [
`${outputPath}/**/*`
];
return del(paths);
}

function css() {
// NODE_ENV production is set when using the "npm run build" command
// if NODE_ENV === production, no sourcemaps and minify the css
if (process.env.NODE_ENV != "production") {
return src(`${sourcePath}/css/_main.css`)
.pipe(sourcemaps.init())
.pipe(postcss([
atImport(),
assets(),
autoprefixer({overrideBrowserslist: ["defaults"]})
]))
.pipe(sourcemaps.write())
.pipe(dest(outputPath));
} else {
return src(`${sourcePath}/css/_main.css`)
.pipe(postcss([
atImport(),
assets(),
autoprefixer({overrideBrowserslist: ["defaults"]}),
nano()
]))
.pipe(dest(outputPath));
}
}

function js() {
// copy over the javascript files, as is
return src(`${sourcePath}/js/**/*.js`)
.pipe(dest(`${outputPath}/js/`));
}

function html() {
// set a var for whether or not we are in dev mode
// development var will be false when running the npm run build command
// during development we will NOT inline css or js files
// that way we can properly debug
// on builds everything will inlined to a single html file
var development = true;
var ignore = ["css", "js"];
if (process.env.NODE_ENV === "production") {
development = false;
ignore = [];
}
return src(`${sourcePath}/index.html`)
.pipe(nunjucksRender({
// pass custom data to nunjucks for use throughout template(s)
// can use custom data from package.json (ex. title)
data: {
development: development,
title: process.env.npm_package_websiteTitle
},
path: `${sourcePath}/html`
}))
.pipe(inline({
compress: true,
ignore: ignore
}))
.pipe(htmlmin({
collapseWhitespace: true,
minifyJS: false,
removeComments: true
}))
.pipe(dest(outputPath))
.pipe(connect.reload());
}

function complete() {
// delete all the files at the output path except the index.html file
// this is a separate function than the clean function above because
// on the intial clean we want to remove EVERYTHING
// on the build complete, we want to leave the index.html
const paths = [
`${outputPath}/**/*`,
`!${outputPath}/index.html`
];
return del(paths);
}

function server(cb) {
connect.server({
root: outputPath,
livereload: true,
port: 8888
});
cb();
}

function watcher(cb) {
const paths = [
`${sourcePath}/**/*.html`,
`${sourcePath}/**/*.css`,
`${sourcePath}/**/*.js`,
`${sourcePath}/**/*.svg`
];
watch(paths, series(css, js, html));
cb();
}

exports.build = series(clean, css, js, html, complete);
exports.clean = clean;
exports.server = series(clean, css, js, html, parallel(server, watcher));
4 changes: 4 additions & 0 deletions etc/app_ios/output/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
Loading

0 comments on commit b8b8a7f

Please sign in to comment.