feat: @persea/entity

This commit is contained in:
cha0s 2021-01-24 16:38:15 -06:00
parent b704d75558
commit 4d7cbab109
13 changed files with 7305 additions and 0 deletions

View File

@ -27,6 +27,7 @@
"@latus/user": "^2.0.0",
"@persea/bootstrap": "^1.0.0",
"@persea/core": "^1.0.0",
"@persea/entity": "^1.0.0",
"@persea/json": "^1.0.0",
"connected-react-router": "^6.8.0",
"dotenv": "8.2.0",

View File

@ -1266,6 +1266,13 @@
glob "^7.1.6"
natsort "^2.0.2"
"@persea/entity@^1.0.0":
version "1.0.0"
resolved "http://npm.cha0sdev/@persea%2fentity/-/entity-1.0.0.tgz#02820edf20a98fafef6260b1ac3341fe5ac0bf4a"
integrity sha512-SEz3GKCqQa8JqNks9hjx3fUUmo2tVvAF/9CeD2OIFgV+7dSoW4qS68qdlo2c/ecJjodYz6w2KcGiYQ2iyFXXdA==
dependencies:
debug "4.3.1"
"@persea/json@^1.0.0":
version "1.0.0"
resolved "http://npm.cha0sdev/@persea%2fjson/-/json-1.0.0.tgz#1ad786e3a390b5d164b009f529c0e09fb8642c80"

View File

@ -0,0 +1 @@
module.exports = require('../../config/.eslintrc');

6
packages/entity/.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
**/*.js
**/*.map
!/.*
!/webpack.config.js
!src/**/*.js
!/test/**/*.js

View File

@ -0,0 +1 @@
module.exports = require('../../config/.neutrinorc');

View File

@ -0,0 +1,43 @@
{
"name": "@persea/entity",
"version": "1.0.0",
"main": "index.js",
"author": "cha0s",
"license": "MIT",
"scripts": {
"build": "NODE_PATH=./node_modules 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",
"forcepub": "npm unpublish --force $(node -e 'const {name, version} = require(`./package.json`); process.stdout.write(`${name}@${version}`)') && npm publish",
"lint": "NODE_PATH=./node_modules eslint --format codeframe --ext mjs,js .",
"test": "yarn --silent run build --display none && mocha --colors test.js"
},
"files": [
"client.js",
"client.js.map",
"index.js",
"index.js.map",
"test.js",
"test.js.map"
],
"dependencies": {
"@latus/react": "^2.0.0",
"debug": "4.3.1"
},
"devDependencies": {
"@neutrinojs/airbnb": "^9.4.0",
"@neutrinojs/banner": "^9.4.0",
"@neutrinojs/copy": "^9.4.0",
"@neutrinojs/mocha": "^9.4.0",
"@neutrinojs/react": "^9.4.0",
"autoprefixer": "^9.8.6",
"chai": "4.2.0",
"eslint": "^7",
"eslint-import-resolver-webpack": "0.13.0",
"glob": "7.1.6",
"mocha": "^8",
"neutrino": "^9.4.0",
"source-map-support": "0.5.19",
"webpack": "^4",
"webpack-cli": "^3"
}
}

View File

@ -0,0 +1,9 @@
import EntityRenderer from '../entity-renderer';
export default {
hooks: {
'@persea/core/resource-renderers': () => [
EntityRenderer,
],
},
};

View File

@ -0,0 +1,27 @@
import './index.scss';
import {PropTypes, React} from '@latus/react';
const EntityRendererComponent = () => (
<div className="entity-renderer">
<h2 className="entity-renderer__title">EntityRenderer</h2>
</div>
);
EntityRendererComponent.propTypes = {
buffer: PropTypes.shape({}).isRequired,
};
export default class EntityResourceRenderer {
static Component({buffer}) {
return (
<EntityRendererComponent buffer={buffer} />
);
}
static get matcher() {
return /\.entity\.json$/;
}
}

View File

View File

@ -0,0 +1,5 @@
import {expect} from 'chai';
it('exists', () => {
expect(true).to.be.true;
});

View File

@ -0,0 +1,3 @@
const neutrino = require('neutrino');
module.exports = neutrino(require(`${__dirname}/.neutrinorc`)).webpack();

7202
packages/entity/yarn.lock Normal file

File diff suppressed because it is too large Load Diff