Skip to content

Commit

Permalink
add split-generator
Browse files Browse the repository at this point in the history
  • Loading branch information
nathancahill committed Mar 28, 2021
1 parent 44f01eb commit 9aac228
Show file tree
Hide file tree
Showing 33 changed files with 8,166 additions and 18 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: github pages

on:
push:
branches:
- master

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v2

- run: yarn build
- run: yarn workspace split-generator run build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./packages/split-generator/public
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
dist/
node_modules/
yarn-error.log
public/bundle.*
10 changes: 10 additions & 0 deletions packages/split-generator/.dependabot/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 1

update_configs:
- package_manager: "javascript"
directory: "/"
update_schedule: "live"
automerged_updates:
- match:
update_type: "all"
target_branch: master
3 changes: 3 additions & 0 deletions packages/split-generator/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules/*
/dist/*
/public/*
14 changes: 14 additions & 0 deletions packages/split-generator/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"env": {
"browser": true,
"jest": true
},
"extends": ["airbnb-base", "prettier"],
"rules": {
"import/no-extraneous-dependencies": [
"error",
{ "devDependencies": true }
],
"no-new": 0
}
}
17 changes: 17 additions & 0 deletions packages/split-generator/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- run: yarn install
- run: yarn run test
env:
CI: true
105 changes: 105 additions & 0 deletions packages/split-generator/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# 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
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://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/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
public/*.js*
public/*.css*

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
1 change: 1 addition & 0 deletions packages/split-generator/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public/
1 change: 1 addition & 0 deletions packages/split-generator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# mapgrid-svelte-tailwind
48 changes: 48 additions & 0 deletions packages/split-generator/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "split-generator",
"private": true,
"version": "1.0.0",
"repository": "[email protected]:nathancahill/split.git",
"author": "Nathan Cahill <[email protected]>",
"license": "MIT",
"devDependencies": {
"@fullhuman/postcss-purgecss": "^4.0.3",
"@rollup/plugin-commonjs": "^18.0.0",
"@rollup/plugin-node-resolve": "^11.2.1",
"autoprefixer": "^10.2.5",
"eslint": "^7.23.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-import": "^2.22.1",
"jest": "^26.6.3",
"postcss": "^8.2.8",
"postcss-load-config": "^3.0.1",
"prettier": "^2.2.1",
"rollup": "^2.43.0",
"rollup-plugin-css-only": "^3.1.0",
"rollup-plugin-livereload": "^2.0.0",
"rollup-plugin-svelte": "^7.1.0",
"rollup-plugin-terser": "^7.0.2",
"sirv-cli": "^1.0.11",
"svelte": "^3.35.0",
"svelte-preprocess": "^4.7.0",
"tailwindcss": "^2.0.4"
},
"scripts": {
"build": "NODE_ENV=production rollup -c",
"watch": "rollup -cw",
"format": "prettier --write \"**/*.js\" \"**/*.json\"",
"lint": "eslint .",
"test": "jest && yarn run lint",
"serve": "sirv public --single --dev"
},
"dependencies": {
"@tailwindcss/forms": "^0.3.2",
"less": "^4.1.1",
"qs": "^6.10.1",
"split-grid": "^1.0.9",
"split.js": "^1.6.2",
"svelte-prismjs": "^1.0.1",
"svelte-spa-router": "^3.1.0"
}
}
21 changes: 21 additions & 0 deletions packages/split-generator/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* eslint-disable global-require */
const purgecss = require('@fullhuman/postcss-purgecss')({
content: ['./src/**/*.html', './src/**/*.svelte'],

safelist: [/svelte-/],

defaultExtractor: content =>
content
.match(/[A-Za-z0-9-_:./]+/g)
.map(c => (c.startsWith('class:') ? c.substring(6) : c)) || [],
})

const plugins = [require('tailwindcss'), require('autoprefixer')]

if (process.env.NODE_ENV === 'production') {
plugins.push(purgecss)
}

module.exports = {
plugins,
}
8 changes: 8 additions & 0 deletions packages/split-generator/prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
printWidth: 80,
trailingComma: 'all',
tabWidth: 4,
semi: false,
singleQuote: true,
arrowParens: 'avoid',
}
Binary file added packages/split-generator/public/horizontal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions packages/split-generator/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/bundle.css">
</head>
<body>
<script src="/bundle.js"></script>
</body>
</html>
Binary file added packages/split-generator/public/vertical.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions packages/split-generator/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import commonjs from '@rollup/plugin-commonjs'
import resolve from '@rollup/plugin-node-resolve'
import svelte from 'rollup-plugin-svelte'
import livereload from 'rollup-plugin-livereload'
import { terser } from 'rollup-plugin-terser'
import sveltePreprocess from 'svelte-preprocess'
import css from 'rollup-plugin-css-only'

const prod = process.env.NODE_ENV === 'production'
const watch = process.env.ROLLUP_WATCH

export default {
input: 'src/index.js',
output: {
file: 'public/bundle.js',
format: 'iife',
},
plugins: [
svelte({
preprocess: sveltePreprocess({
postcss: true,
}),
compilerOptions: {
dev: !prod,
},
}),
css({
output: 'bundle.css',
}),
resolve({
dedupe: ['svelte', 'svelte/internal'],
browser: true,
}),
commonjs(),
!!watch && livereload(),
!!prod && terser(),
],
}
19 changes: 19 additions & 0 deletions packages/split-generator/src/App.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<style global lang="less">
/*! purgecss start ignore */
@tailwind base;
@tailwind components;
/*! purgecss end ignore */
@tailwind utilities;
/*! purgecss start ignore */
@import 'src/less/markdown';
/*! purgecss end ignore */
</style>

<script>
import Dashboard from './Dashboard.svelte'
import 'prismjs/components/prism-jsx.min'
</script>

<Dashboard />
Loading

0 comments on commit 9aac228

Please sign in to comment.