init undefined app

This commit is contained in:
Primakov Alexandr Alexandrovich 2022-02-17 22:18:16 +03:00
parent ed026f1636
commit aeee003538
8 changed files with 6846 additions and 0 deletions

21
ijl.config.js Normal file
View File

@ -0,0 +1,21 @@
const pkg = require('./package')
module.exports = {
apiPath: 'stubs/api',
webpackConfig: {
output: {
publicPath: `/static/${pkg.name}/${process.env.VERSION || pkg.version}/`
}
},
navigations: {
'undefined.main': '/undefined'
},
features: {
'undefined': {
// add your features here in the format [featureName]: { value: string }
},
},
config: {
key: 'value'
}
}

6706
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

31
package.json Normal file
View File

@ -0,0 +1,31 @@
{
"name": "undefined",
"version": "1.0.0",
"description": "",
"main": "./src/index.tsx",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "ijl-cli --server --port=8099 --with-open-browser",
"build": "npm run clean && ijl-cli --build --dev",
"build:prod": "npm run clean && ijl-cli --build",
"clean": "rimraf dist"
},
"repository": {
"type": "git",
"url": "git+ssh://git@bitbucket.org/aaprimakov/undefined.git"
},
"keywords": [],
"author": "",
"license": "MIT",
"homepage": "https://bitbucket.org/aaprimakov/undefined#readme",
"dependencies": {
"@ijl/cli": "^4.1.0",
"@types/react": "^17.0.39",
"@types/react-dom": "^17.0.11",
"express": "^4.17.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-lottie": "^1.2.3",
"typescript": "^4.5.5"
}
}

1
src/404.json Normal file

File diff suppressed because one or more lines are too long

31
src/app.tsx Normal file
View File

@ -0,0 +1,31 @@
import React from 'react';
import Lottie from 'react-lottie';
import * as animationData from './404.json'
const App = () => {
return(
<div>
<h1 style={{ textAlign: 'center', color: '#3f7afe' }}>Undefined app name</h1>
<p style={{ textAlign: 'center' }}>
Вы запросили приложение по адресу undefined. Возможно не указана версия в админке или не сброшен кэш
</p>
<p style={{ textAlign: 'center' }}>
You requested an application by url -&gt; undefined. Perhaps the version is not specified in the admin panel or the cache has not been reset.
</p>
<Lottie
options={{
loop: true,
autoplay: true,
animationData: animationData,
rendererSettings: {
preserveAspectRatio: 'xMidYMid slice'
}
}}
style={{ maxWidth: 600 }}
/>
</div>
)
}
export default App;

27
src/index.tsx Normal file
View File

@ -0,0 +1,27 @@
import React from 'react';
import ReactDom from 'react-dom';
import App from './app';
export default () => <App/>;
export const mount = (Сomponent) => {
ReactDom.render(
<Сomponent/>,
document.getElementById('app')
);
if(module.hot) {
module.hot.accept('./app', ()=> {
ReactDom.render(
<App/>,
document.getElementById('app')
);
})
}
};
export const unmount = () => {
ReactDom.unmountComponentAtNode(document.getElementById('app'));
};

3
stubs/api/index.js Normal file
View File

@ -0,0 +1,3 @@
const router = require('express').Router();
module.exports = router;

26
tsconfig.json Normal file
View File

@ -0,0 +1,26 @@
{
"compilerOptions": {
"lib": [
"dom",
"es2017"
],
"baseUrl": ".",
"outDir": "./dist/",
"sourceMap": true,
"esModuleInterop": true,
"noImplicitAny": false,
"module": "esnext",
"moduleResolution": "node",
"target": "es6",
"jsx": "react",
"typeRoots": ["node_modules/@types", "src/typings"],
"types" : ["webpack-env", "node"],
"resolveJsonModule": true
},
"exclude": [
"node_modules",
"**/*.test.ts",
"**/*.test.tsx",
"node_modules/@types/jest"
]
}