Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasMaros committed May 23, 2023
0 parents commit 37c57ec
Show file tree
Hide file tree
Showing 17 changed files with 1,369 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"presets": [
[
"@babel/preset-env",
{
"useBuiltIns": "usage",
"corejs": 3
}
]
],
"plugins": ["@babel/plugin-transform-runtime"]
}
26 changes: 26 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
node_version: &node_version 'lts'
source_dir: &source_dir debuggable
version: 2.1
orbs:
gh: gebruederheitz/wordpress-deployment@1
workflows:
version: 2
test-and-build:
jobs:
- gh/test:
name: test
context: slack-secrets
node_modules_path: node_modules
node_version: *node_version
package_lock_path: package-lock.json
source_dir: *source_dir
- gh/build_assets:
name: build
context: slack-secrets
requires:
- test
checkout: true
build_task_name: ci-build
node_version: *node_version
package_lock_path: package-lock.json
source_dir: *source_dir
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/*
node_modules/*

27 changes: 27 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"env": {
"browser": true,
"es6": true,
},
"extends": [
"eslint:recommended",
"plugin:prettier/recommended",
"prettier"
],
"rules": {
"indent": ["error", 4, { "SwitchCase": 1 }],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "single"],
"semi": ["error", "always"],
"react/prop-types": "off",
"react/react-in-jsx-scope": "off",
"react/display-name": "off",
"prettier/prettier": "error"
},
"parser": "@babel/eslint-parser",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2021
},
"plugins": ["prettier", "@babel"]
}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/
.idea/

.npmrc
yarn-error.log

dist/
11 changes: 11 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.eslintignore
.eslintrc
.postcssrc
.prettierrc
.rollup.config.js
.stylelintrc
.yarnrc.yaml
Gulpfile.esm.js

demo/
test/
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
17 changes: 17 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"singleQuote": true,
"tabWidth": 4,
"trailingComma": "es5",
"useTabs": false,
"overrides": [
{
"files": [
"scss/wordpress/_blocks.scss",
"scss/editor/_elements.scss"
],
"options": {
"printWidth": 200
}
}
]
}
14 changes: 14 additions & 0 deletions .release-it.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
git:
commitMessage: "[chore] Release v${version}"
requireBranch: main
github:
release: true
web: true
releaseName: "${version}: "
npm:
publish: true
hooks:
before:init:
- make test
- make build
after:release: "echo Successfully released ${name} v${version} to ${repo.repository} and NPM."
65 changes: 65 additions & 0 deletions .rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import babel from '@rollup/plugin-babel';
// import commonjs from '@rollup/plugin-commonjs';
// import resolve from '@rollup/plugin-node-resolve';

function serve() {
let server;
function toExit() {
if (server) server.kill(0);
}
return {
writeBundle() {
if (server) return;
server = require('child_process').spawn(
'npm',
['run', `start`, '--', '--dev'],
{
stdio: ['ignore', 'inherit', 'inherit'],
shell: true,
}
);

process.on('SIGTERM', toExit);
process.on('exit', toExit);
},
};
}

const babelConfig = (bundledHelpers = false) => ({
babelrc: false,
exclude: [/\/core-js\//, 'node_modules/**'],
sourceMaps: true,
inputSourceMap: true,
babelHelpers: bundledHelpers ? 'bundled' : 'runtime',
presets: [
[
'@babel/preset-env',
{
useBuiltIns: 'usage',
corejs: 3,
}
],
],
plugins: bundledHelpers ? [] : [
'@babel/plugin-transform-runtime',
],
});

export default [
{
external: [
/@babel\/runtime/,
],
input: 'src/index.js',
output: {
file: 'dist/index.mjs',
format: 'esm',
sourcemap: true,
},
plugins: [
// resolve(),
babel(babelConfig()),
// commonjs(),
],
},
];
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npmPublishAccess: "public"
Loading

0 comments on commit 37c57ec

Please sign in to comment.