Skip to content

Commit

Permalink
✨ Integrate build system for easier contribution
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto committed Mar 6, 2020
1 parent 605db07 commit faee7a1
Show file tree
Hide file tree
Showing 16 changed files with 3,461 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"presets": [
[
"@babel/env",
{
"modules": false
}
]
]
}
30 changes: 30 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# http://EditorConfig.org

# top-most EditorConfig file
root = true

# Default
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing-whitespace = true
indent_style = space
indent_size = 4

# Exceptions
[{*.{yaml,yml,sh,jscsrc,scss},package.json,.*rc}]
indent_size = 2

[*.{json,scss}]
max_line_length = 1000

[Sites.xml]
indent_size = 1

[*.{note,md,edit,read}]
trim_trailing-whitespace = false

[Makefile]
indent_style = tab
indent_size = 1
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
Build/
Packages/
**/Public/
**/Resources/Private/Templates/
*.noLinter.*
16 changes: 16 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": ["prettier"],
"plugins": ["prettier"],
"parserOptions": {
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"env": {
"es6": true
},
"rules": {
"prettier/prettier": "error"
}
}
16 changes: 15 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
/.babelrc export-ignore
/.editorconfig export-ignore
/.eslintignore export-ignore
/.eslintrc export-ignore
/.gitattributes export-ignore
/.github export-ignore
/.gitignore export-ignore
/.jshintrc export-ignore
/.nvmrc export-ignore
/.prettierignore export-ignore
/.prettierrc export-ignore
/.stylelintrc export-ignore
/.yarnclean export-ignore
/CODE_OF_CONDUCT.md export-ignore
/Configuration/Gulp.yaml export-ignore
/package.json export-ignore
/postcss.config.js export-ignore
/rollup.config.js export-ignore
/yarn.lock export-ignore
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_modules
14 changes: 14 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"passfail": false,
"undef": true,
"unused": true,
"asi": true,
"browser": true,
"predef": ["$", "Carbon", "console", "jQuery", "require"],
"esversion": 6,
"eqeqeq": false,
"eqnull": false,
"loopfunc": false,
"smarttabs": false,
"-W041": false
}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
13
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
composer.json
*.noLinter.*
49 changes: 49 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"overrides": [
{
"files": "*.json",
"options": {
"tabWidth": 4,
"printWidth": 1000
}
},
{
"files": "package.json",
"options": {
"tabWidth": 2
}
},
{
"files": ["*.yaml", "*.yml", ".prettierrc"],
"options": {
"tabWidth": 2,
"singleQuote": true
}
},
{
"files": [
"*.js",
"*.jsx",
"*.mjs",
"*.mjsx",
"*.ts",
"*.tsx",
"*.mts",
"*.mtsx",
"*.vue",
"*.mvue"
],
"options": {
"tabWidth": 4,
"printWidth": 120,
"singleQuote": true
}
},
{
"files": "*.scss",
"options": {
"printWidth": 300
}
}
]
}
48 changes: 48 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"ignoreFiles": [
"**/Public/**",
"**/Private/Templates/**",
"node_modules/**",
"**/*.noLinter.*"
],
"extends": "stylelint-config-standard",
"plugins": [
"stylelint-scss"
],
"rules": {
"block-closing-brace-newline-after": ["always", {
ignoreAtRules: ["if", "else"]
}],
"declaration-colon-newline-after": null,
"at-rule-empty-line-before": null,
"at-rule-no-unknown": null,
"no-descending-specificity": null,
"no-duplicate-selectors": [ true, { "severity": "warning" }],
"max-empty-lines": 3,
"max-nesting-depth": 5,
"no-invalid-double-slash-comments": true,
"font-family-no-missing-generic-family-keyword": null,
"property-no-unknown": [true, {
ignoreProperties: [
"box","box-item",
"grid-kiss",
"font-range","min-font-size","max-font-size","lower-font-range","upper-font-range",
"font-awesome",
"size","min-size","max-size",
"border-top-radius","border-right-radius","border-bottom-radius","border-left-radius",
"tap-highlight-color","touch-callout"
]
}],
"selector-pseudo-class-no-unknown": [true, {
"ignorePseudoClasses": [
"at-least","at-most","between","exactly"
]
}],
"selector-pseudo-element-no-unknown": [true, {
"ignorePseudoElements": [
"track","thumb"
]
}],
"selector-type-no-unknown": null
}
}
44 changes: 44 additions & 0 deletions .yarnclean
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Exclude some needed stuff
!browser-sync-ui/lib/plugins/history
!postcss-assets
!assets

# test directories
__tests__
test
tests
powered-test

# asset directories
docs
doc
website
*/**/assets

# examples
example
examples

# code coverage directories
coverage
.nyc_output

# build scripts
Makefile
Gulpfile.js
Gruntfile.js

# configs
.tern-project
.gitattributes
.editorconfig
.*ignore
.eslintrc
.jshintrc
.flowconfig
.documentup.json
.yarn-metadata.json

# misc
*.gz
*.md
46 changes: 46 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "jonnitto.prettyembedhelper",
"description": "Dependencies for Jonnitto.PrettyEmbedHelper",
"license": "GPL-3.0-or-later",
"private": true,
"repository": {
"type": "git",
"url": "git://github.com/jonnitto/Jonnitto.PrettyEmbedHelper.git"
},
"browserslist": [
"> 0.5%",
"last 2 versions",
"Firefox ESR",
"ie 11",
"not ie <= 10",
"not ie_mob <= 10",
"not bb <= 10",
"not op_mob <= 12.1"
],
"devDependencies": {
"@babel/core": "^7.8.7",
"@babel/preset-env": "^7.8.7",
"autoprefixer": "^9.7.4",
"cssnano": "^4.1.10",
"postcss-banner": "^3.0.1",
"postcss-cli": "^7.1.0",
"postcss-sort-media-queries": "^1.31.21",
"postcss-url": "^8.0.0",
"regenerator": "^0.14.2",
"rollup": "^1.32.1",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-license": "^0.13.0",
"rollup-plugin-terser": "^5.2.0",
"sass": "^1.26.2"
},
"scripts": {
"build:js": "rollup -c",
"build:css:scss": "sass --embed-sources Resources/Private/Assets:Resources/Public/Styles",
"build:css:postcss": "postcss --map --replace Resources/Public/Styles/*.css",
"build:css": "yarn build:css:scss && yarn build:css:postcss",
"build": "yarn build:css | yarn build:js",
"start": "yarn build",
"watch": "rollup -c --watch"
},
"dependencies": {}
}
24 changes: 24 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const composer = require('./composer');

const AUTHOR = composer.authors[0].name;
const BANNER_CONTENT = `${composer.extra.neos['package-key']} - created by ${AUTHOR}
@link ${composer.homepage}
Copyright 2016-${parseInt(new Date().getFullYear(), 10)} ${AUTHOR}
Licensed under ${composer.license}`;

module.exports = {
plugins: {
'postcss-sort-media-queries': true,
'postcss-url': {
url: 'inline'
},
autoprefixer: true,
cssnano: {
preset: ['default', { discardComments: { removeAll: true } }]
},
'postcss-banner': {
important: true,
banner: BANNER_CONTENT
}
}
};
57 changes: 57 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import babel from 'rollup-plugin-babel';
import { terser } from 'rollup-plugin-terser';
import license from 'rollup-plugin-license';
import composer from './composer.json';

const AUTHOR = composer.authors[0].name;
const BANNER_CONTENT = `${composer.extra.neos['package-key']} - created by ${AUTHOR}
@link ${composer.homepage}
Copyright 2019-${parseInt(new Date().getFullYear(), 10)} ${AUTHOR}
Licensed under ${composer.license}`;

export default [
{
input: 'Resources/Private/Assets/Main.js',
plugins: [
babel(),
terser({
output: {
comments: false
}
}),
license({
banner: {
content: BANNER_CONTENT,
commentStyle: 'ignored'
}
})
],
output: {
sourcemap: true,
file: 'Resources/Public/Scripts/Main.js',
format: 'iife'
}
},
{
input: 'Resources/Private/Assets/Backend.js',
plugins: [
babel(),
terser({
output: {
comments: false
}
}),
license({
banner: {
content: BANNER_CONTENT,
commentStyle: 'ignored'
}
})
],
output: {
sourcemap: true,
file: 'Resources/Public/Scripts/Backend.js',
format: 'iife'
}
}
];
Loading

0 comments on commit faee7a1

Please sign in to comment.