chore: initial

This commit is contained in:
cha0s 2020-07-11 21:58:37 -05:00
commit ac22f12635
13 changed files with 5355 additions and 0 deletions

25
.eslint.defaults.js Normal file
View File

@ -0,0 +1,25 @@
const config = {
globals: {
process: true,
AVOCADO_CLIENT: true,
AVOCADO_SERVER: true,
},
rules: {
'babel/object-curly-spacing': 'off',
'brace-style': ['error', 'stroustrup'],
'no-bitwise': ['error', {int32Hint: true}],
'no-plusplus': 'off',
'no-underscore-dangle': 'off',
'padded-blocks': ['error', {classes: 'always'}],
yoda: 'off',
},
settings: {
'import/resolver': {
webpack: {
config: `${__dirname}/webpack.config.js`,
},
},
},
};
module.exports = config;

3
.eslintrc.js Normal file
View File

@ -0,0 +1,3 @@
const neutrino = require('neutrino');
module.exports = neutrino().eslintrc();

119
.gitignore vendored Normal file
View File

@ -0,0 +1,119 @@
# 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/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# 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
.parcel-cache
# Next.js build output
.next
out
# 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
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
# Neutrino build directory
build

5
.mocharc.js Normal file
View File

@ -0,0 +1,5 @@
const neutrino = require('neutrino');
process.env.NODE_ENV = process.env.NODE_ENV || 'test';
module.exports = neutrino().mocha();

12
.neutrinorc.js Normal file
View File

@ -0,0 +1,12 @@
const airbnbBase = require('@neutrinojs/airbnb-base');
const mocha = require('@neutrinojs/mocha');
module.exports = {
options: {},
use: [
airbnbBase({
baseConfig: require('./.eslint.defaults'),
}),
mocha(),
],
};

0
README.md Normal file
View File

11
lerna.json Normal file
View File

@ -0,0 +1,11 @@
{
"packages": [
"packages/*"
],
"version": "0.0.0",
"hoist": true,
"stream": true,
"bootstrap": {
"npmClientArgs": ["--no-package-lock"]
}
}

23
package.json Normal file
View File

@ -0,0 +1,23 @@
{
"name": "shrub-neut",
"version": "1.0.0",
"main": "build/index.js",
"license": "MIT",
"module": "src/index.js",
"scripts": {
"build": "webpack --mode production",
"test": "mocha",
"lint": "eslint --cache --format codeframe --ext mjs,js src test"
},
"devDependencies": {
"@neutrinojs/airbnb-base": "^9.2.0",
"@neutrinojs/library": "^9.2.0",
"@neutrinojs/mocha": "^9.2.0",
"eslint": "^7",
"glob": "^7.1.6",
"mocha": "^7",
"neutrino": "^9.2.0",
"webpack": "^4",
"webpack-cli": "^3"
}
}

View File

@ -0,0 +1,13 @@
{
"name": "@shrub/http",
"version": "1.0.0",
"description": "> TODO: description",
"author": "cha0s <git@cha0s.io>",
"homepage": "",
"license": "UNLICENSED",
"main": "dist/index.js",
"repository": {
"type": "git",
"url": "git@git.i12e.cha0s.io:cha0s/shrub.git"
}
}

View File

@ -0,0 +1,2 @@
const foo = { 1: 2, 3: 4 };
export default { ...foo, 3: 5 };

View File

@ -0,0 +1,7 @@
import assert from 'assert';
describe('simple', () => {
it('should be sane', () => {
assert.equal(true, !false);
});
});

30
webpack.config.js Normal file
View File

@ -0,0 +1,30 @@
const glob = require('glob');
const neutrino = require('neutrino');
const library = require('@neutrinojs/library');
const neutrinoConfig = require('./.neutrinorc');
const lerna = require('./lerna.json');
const packagePaths = lerna.packages.reduce((r, pattern) => r.concat(glob.sync(pattern)), []);
const packageConfigs = packagePaths.map((path) => {
// eslint-disable-next-line global-require, import/no-dynamic-require
const {name} = require(`./${path}/package.json`);
const root = `${__dirname}/${path}`;
return neutrino({
...neutrinoConfig,
options: {
...neutrinoConfig.options,
output: 'dist',
root,
},
use: neutrinoConfig.use.concat([
library({
name,
}),
]),
}).webpack();
});
module.exports = packageConfigs;

5105
yarn.lock Normal file

File diff suppressed because it is too large Load Diff