chore: tidy

This commit is contained in:
cha0s 2021-03-23 13:02:18 -05:00
parent 8fcae6b41a
commit 3385daf8d8
16 changed files with 4 additions and 9351 deletions

View File

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

View File

@ -1,5 +0,0 @@
const neutrino = require('neutrino');
process.env.LATUS_LINTING = true;
module.exports = neutrino(require('./.neutrinorc')).eslintrc();

119
app/.gitignore vendored
View File

@ -1,119 +0,0 @@
# 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.*
/build
/latus.yml

View File

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

View File

@ -1,92 +0,0 @@
require('dotenv/config');
const airbnb = require('@neutrinojs/airbnb');
const clean = require('@neutrinojs/clean');
const copy = require('@neutrinojs/copy');
const mocha = require('@neutrinojs/mocha');
const node = require('@neutrinojs/node');
const {EnvironmentPlugin} = require('webpack');
const nodeExternals = require('webpack-node-externals');
module.exports = {
options: {
root: __dirname,
},
use: [
airbnb({
eslint: {
cache: false,
baseConfig: require('./.eslint.defaults'),
},
}),
clean({
cleanOnceBeforeBuildPatterns: ['**/*.hot-update.*'],
}),
copy({
patterns: [{
from: 'src/assets',
to: 'http',
}],
}),
mocha(),
node(),
(neutrino) => {
[
'components',
'context',
'fonts',
'hooks',
'images',
'scss',
].forEach((path) => {
neutrino.config.resolve.alias
.set(path, `${neutrino.options.source}/react/${path}`);
});
if (process.env.LATUS_LINTING) {
return;
}
neutrino.config.module
.rule('compile')
.use('babel')
.get('options').plugins.push(
[
'babel-plugin-webpack-alias',
{
config: `${__dirname}/webpack.config.js`,
},
],
);
neutrino.config
.plugin('environment')
.use(EnvironmentPlugin, [{
SIDE: 'server',
}]);
neutrino.config
.entry('index')
.prepend('@latus/core/start');
if ('production' !== neutrino.config.get('mode')) {
neutrino.config
.entry('index')
.prepend('dotenv/config');
neutrino.config
.plugin('start-server')
.tap((args) => {
const options = args[0];
const inspectArg = process.argv.find((arg) => -1 !== arg.indexOf('--inspect'));
if (inspectArg) {
options.nodeArgs.push(inspectArg);
}
const profArg = process.argv.find((arg) => -1 !== arg.indexOf('--prof'));
if (profArg) {
options.nodeArgs.push(profArg);
}
options.nodeArgs.push('--experimental-repl-await');
return args;
});
}
neutrino.config
.externals(nodeExternals({
}));
},
],
};

View File

@ -1,17 +0,0 @@
version: '2'
services:
redis:
image: redis:6
ports:
- 6380:6379
mysql:
image: mysql:8
command:
- '--default-authentication-plugin=mysql_native_password'
environment:
- MYSQL_DATABASE=db
- MYSQL_ROOT_PASSWORD=UNSAFE_DEV_PASSWORD
ports:
- 32342:3306

View File

@ -1,50 +0,0 @@
'@latus/core': {
up: [
'@latus/db',
'@latus/redis',
'@latus/user/session',
'@latus/user/passport',
'@latus/user/local',
'@latus/http',
'@latus/repl',
],
}
'@latus/db': {
models.decorate: [
'@latus/user/local',
],
docker: 'cached',
}
'@latus/governor': {}
'@latus/http': {
client.up: [
'@latus/socket/client',
'@latus/react/client',
],
request: [
'@latus/user/session',
'@latus/user/passport',
],
}
'@latus/react': {}
'@latus/redis': {
docker: 'cached',
}
'@latus/redis/session': {}
'@latus/repl': {}
'@latus/socket': {
authenticate: [
'@latus/user/session',
'@latus/user/passport',
],
connect: [
'@latus/socket',
],
packets.decorate: [
'@latus/governor',
]
}
'@latus/user/local': {}
'@latus/user/models': {}
'@latus/user/passport': {}
'@latus/user/session': {}

View File

@ -1,44 +0,0 @@
{
"name": "latus",
"version": "1.0.0",
"license": "MIT",
"scripts": {
"build": "webpack --mode production",
"clean": "rm -rf yarn.lock node_modules $(node -e \"process.stdout.write(require('./package.json').files.filter((file) => {const parts = file.split('/'); return 1 === parts.length || 'test' !== parts[0];}).join(' '));\") && yarn",
"docker": "yarn run build && docker build",
"lint": "eslint --cache --format codeframe --ext mjs,jsx,js src",
"repl": "rlwrap -C qmp socat STDIO UNIX:$(ls /tmp/latus-*.sock | tail -n 1)",
"start": "NODE_ENV=production node build/index.js",
"test": "mocha --watch src",
"watch": "webpack --hot --watch --mode development"
},
"dependencies": {
"@latus/core": "^1.0.0",
"@latus/db": "^1.0.0",
"@latus/governor": "^1.0.0",
"@latus/http": "^1.0.0",
"@latus/react": "^1.0.0",
"@latus/redis": "^1.0.0",
"@latus/repl": "^1.0.0",
"@latus/socket": "^1.0.0",
"@latus/user": "^1.0.0",
"dotenv": "8.2.0",
"react": "^17.0.1",
"react-hot-loader": "4.13.0"
},
"devDependencies": {
"@neutrinojs/airbnb": "^9.4.0",
"@neutrinojs/clean": "^9.1.0",
"@neutrinojs/copy": "^9.4.0",
"@neutrinojs/mocha": "^9.1.0",
"@neutrinojs/node": "^9.1.0",
"babel-plugin-webpack-alias": "^2.1.2",
"eslint": "^6",
"eslint-import-resolver-webpack": "^0.12.1",
"js-yaml": "3.14.0",
"neutrino": "^9.1.0",
"source-map-support": "0.5.19",
"webpack": "^4",
"webpack-cli": "^3"
}
}

View File

@ -1,3 +0,0 @@
module.exports = {
plugins: {},
};

View File

@ -1 +0,0 @@
process.stdout.write('Your application is starting...\n');

View File

@ -1,20 +0,0 @@
import {React} from '@latus/react';
import {hot} from 'react-hot-loader';
const App = () => (
<div className="app">
<h1>Latus react app</h1>
<p>Yay, you maaaaade it! :)</p>
<form action="/auth/local" method="post">
<input name="email" />
<input name="password" />
<input type="submit" />
</form>
</div>
);
export default {
hooks: {
'@latus/react/components': () => hot(module)(App),
},
};

View File

@ -1,28 +0,0 @@
require('source-map-support/register');
// Whilst the configuration object can be modified here, the recommended way of making
// changes is via the presets' options or Neutrino's API in `.neutrinorc.js` instead.
// Neutrino's inspect feature can be used to view/export the generated configuration.
const {Latus} = require('@latus/core');
const neutrino = require('neutrino');
if (process.env.LATUS_LINTING) {
// eslint-disable-next-line global-require
module.exports = neutrino(require('./.neutrinorc')).webpack();
}
else {
module.exports = new Promise((resolve, reject) => {
try {
const latus = Latus.create();
const configs = {
// eslint-disable-next-line global-require
app: require('./.neutrinorc'),
};
latus.invokeFlat('@latus/core/build', configs);
const webpackConfigs = Object.values(configs).map((config) => neutrino(config).webpack());
resolve(webpackConfigs);
}
catch (error) {
reject(error);
}
});
}

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,7 @@
**/*.js **/*.js
**/*.map **/*.map
!/.* !/.*
!/postcss.config.js
!/webpack.config.js
!src/**/*.js !src/**/*.js
!/test/**/*.js !/test/**/*.js

View File

@ -1,9 +1,6 @@
{ {
"name": "@avocado/package",
"version": "1.0.0", "version": "1.0.0",
"main": "index.js", "main": "index.js",
"author": "cha0s",
"license": "MIT",
"scripts": { "scripts": {
"build": "latus-build", "build": "latus-build",
"clean": "latus-build clean", "clean": "latus-build clean",
@ -19,7 +16,6 @@
], ],
"dependencies": {}, "dependencies": {},
"devDependencies": { "devDependencies": {
"@latus/build": "1.x", "@latus/build": "1.x"
"source-map-support": "0.5.19"
} }
} }

View File

@ -13,20 +13,6 @@
"watch": "lerna run watch --parallel" "watch": "lerna run watch --parallel"
}, },
"devDependencies": { "devDependencies": {
"@neutrinojs/airbnb": "^9.4.0", "lerna": "^3.22.1"
"@neutrinojs/banner": "^9.5.0",
"@neutrinojs/mocha": "^9.4.0",
"@neutrinojs/react": "^9.4.0",
"chai": "4.2.0",
"eslint": "^7",
"eslint-import-resolver-webpack": "0.13.0",
"glob": "7.1.6",
"lerna": "^3.22.1",
"mocha": "^8",
"neutrino": "^9.4.0",
"source-map-support": "0.5.19",
"webpack": "^4",
"webpack-cli": "^3",
"webpack-node-externals": "2.5.2"
} }
} }