Skip to content

Commit 8cc22fe

Browse files
style: update style to be alligned with the template repo
1 parent 867b41e commit 8cc22fe

29 files changed

+6946
-948
lines changed

.eslintrc.js

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2020: true,
5+
},
6+
extends: [
7+
'airbnb',
8+
'plugin:react/recommended',
9+
'plugin:@typescript-eslint/recommended',
10+
],
11+
parser: '@typescript-eslint/parser',
12+
parserOptions: {
13+
ecmaFeatures: {
14+
jsx: true,
15+
},
16+
ecmaVersion: 11,
17+
sourceType: 'module',
18+
},
19+
plugins: [
20+
'react',
21+
'@typescript-eslint',
22+
],
23+
rules: {
24+
semi: ['error', 'never'],
25+
'no-unused-vars': 'off',
26+
'import/prefer-default-export': 'off',
27+
// TODO remove following 2 lines
28+
'guard-for-in': 'off',
29+
'no-restricted-syntax': 'off',
30+
'import/extensions': 'off',
31+
'import/no-unresolved': 'off',
32+
'react/jsx-filename-extension': 'off',
33+
indent: [
34+
'error',
35+
2,
36+
],
37+
'linebreak-style': ['error', 'unix'],
38+
'object-curly-newline': 'off',
39+
'@typescript-eslint/no-explicit-any': 'off',
40+
},
41+
overrides: [{
42+
files: ['*.tsx'],
43+
rules: {
44+
'react/prop-types': 'off',
45+
'react/jsx-props-no-spreading': 'off',
46+
},
47+
}],
48+
}

.gitignore

+163-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,164 @@
1-
\.idea/
1+
# File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig
2+
3+
# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,macos,node
4+
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,macos,node
5+
6+
### macOS ###
7+
# General
8+
.DS_Store
9+
.AppleDouble
10+
.LSOverride
11+
12+
# Icon must end with two \r
13+
Icon
14+
15+
# Thumbnails
16+
._*
17+
18+
# Files that might appear in the root of a volume
19+
.DocumentRevisions-V100
20+
.fseventsd
21+
.Spotlight-V100
22+
.TemporaryItems
23+
.Trashes
24+
.VolumeIcon.icns
25+
.com.apple.timemachine.donotpresent
26+
27+
# Directories potentially created on remote AFP share
28+
.AppleDB
29+
.AppleDesktop
30+
Network Trash Folder
31+
Temporary Items
32+
.apdisk
33+
34+
### Node ###
35+
# Logs
36+
logs
37+
*.log
38+
npm-debug.log*
39+
yarn-debug.log*
40+
yarn-error.log*
41+
lerna-debug.log*
42+
43+
# Diagnostic reports (https://nodejs.org/api/report.html)
44+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
45+
46+
# Runtime data
47+
pids
48+
*.pid
49+
*.seed
50+
*.pid.lock
51+
52+
# Directory for instrumented libs generated by jscoverage/JSCover
53+
lib-cov
54+
55+
# Coverage directory used by tools like istanbul
56+
coverage
57+
*.lcov
58+
59+
# nyc test coverage
60+
.nyc_output
61+
62+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
63+
.grunt
64+
65+
# Bower dependency directory (https://bower.io/)
66+
bower_components
67+
68+
# node-waf configuration
69+
.lock-wscript
70+
71+
# Compiled binary addons (https://nodejs.org/api/addons.html)
72+
build/Release
73+
74+
# Dependency directories
275
node_modules/
3-
lib/
4-
package-lock\.json
5-
*.db
76+
jspm_packages/
77+
78+
# TypeScript v1 declaration files
79+
typings/
80+
81+
# TypeScript cache
82+
*.tsbuildinfo
83+
84+
# Optional npm cache directory
85+
.npm
86+
87+
# Optional eslint cache
88+
.eslintcache
89+
90+
# Microbundle cache
91+
.rpt2_cache/
92+
.rts2_cache_cjs/
93+
.rts2_cache_es/
94+
.rts2_cache_umd/
95+
96+
# Optional REPL history
97+
.node_repl_history
98+
99+
# Output of 'npm pack'
100+
*.tgz
101+
102+
# Yarn Integrity file
103+
.yarn-integrity
104+
105+
# dotenv environment variables file
106+
.env
107+
.env.test
108+
109+
# parcel-bundler cache (https://parceljs.org/)
110+
.cache
111+
112+
# Next.js build output
113+
.next
114+
115+
# Nuxt.js build / generate output
116+
.nuxt
117+
dist
118+
119+
# Gatsby files
120+
.cache/
121+
# Comment in the public line in if your project uses Gatsby and not Next.js
122+
# https://nextjs.org/blog/next-9-1#public-directory-support
123+
# public
124+
125+
# vuepress build output
126+
.vuepress/dist
127+
128+
# Serverless directories
129+
.serverless/
130+
131+
# FuseBox cache
132+
.fusebox/
133+
134+
# DynamoDB Local files
135+
.dynamodb/
136+
137+
# TernJS port file
138+
.tern-port
139+
140+
# Stores VSCode versions used for testing VSCode extensions
141+
.vscode-test
142+
143+
### VisualStudioCode ###
144+
.vscode/*
145+
!.vscode/settings.json
146+
!.vscode/tasks.json
147+
!.vscode/launch.json
148+
!.vscode/extensions.json
149+
*.code-workspace
150+
151+
### VisualStudioCode Patch ###
152+
# Ignore all local history of files
153+
.history
154+
155+
# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,macos,node
156+
157+
# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)
158+
159+
types
160+
build
161+
lib
162+
.adminbro
163+
164+
example-app/cypress/videos

LICENSE

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2018 SoftwareBrothers.co
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

example-app/cypress.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"baseUrl": "http://localhost:3000/admin"
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "Using fixtures to represent data",
3+
"email": "[email protected]",
4+
"body": "Fixtures are a great way to mock data for responses to routes"
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
context('Dashboard Page', () => {
2+
beforeEach(() => {
3+
cy.visit('/')
4+
})
5+
6+
it('shows overridden sidebar footer', () => {
7+
cy.contains('Welcome on Board')
8+
})
9+
})

example-app/cypress/plugins/index.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/// <reference types="cypress" />
2+
// ***********************************************************
3+
// This example plugins/index.js can be used to load plugins
4+
//
5+
// You can change the location of this file or turn off loading
6+
// the plugins file with the 'pluginsFile' configuration option.
7+
//
8+
// You can read more here:
9+
// https://on.cypress.io/plugins-guide
10+
// ***********************************************************
11+
12+
// This function is called when a project is opened or re-opened (e.g. due to
13+
// the project's config changing)
14+
15+
/**
16+
* @type {Cypress.PluginConfig}
17+
*/
18+
module.exports = (on, config) => {
19+
// `on` is used to hook into various events Cypress emits
20+
// `config` is the resolved Cypress config
21+
}
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// ***********************************************
2+
// This example commands.js shows you how to
3+
// create various custom commands and overwrite
4+
// existing commands.
5+
//
6+
// For more comprehensive examples of custom
7+
// commands please read more here:
8+
// https://on.cypress.io/custom-commands
9+
// ***********************************************
10+
//
11+
//
12+
// -- This is a parent command --
13+
// Cypress.Commands.add("login", (email, password) => { ... })
14+
//
15+
//
16+
// -- This is a child command --
17+
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
18+
//
19+
//
20+
// -- This is a dual command --
21+
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
22+
//
23+
//
24+
// -- This will overwrite an existing command --
25+
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })

example-app/cypress/support/index.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// ***********************************************************
2+
// This example support/index.js is processed and
3+
// loaded automatically before your test files.
4+
//
5+
// This is a great place to put global configuration and
6+
// behavior that modifies Cypress.
7+
//
8+
// You can change the location of this file or turn off
9+
// automatically serving support files with the
10+
// 'supportFile' configuration option.
11+
//
12+
// You can read more here:
13+
// https://on.cypress.io/configuration
14+
// ***********************************************************
15+
16+
// Import commands.js using ES2015 syntax:
17+
import './commands'
18+
19+
// Alternatively you can use CommonJS syntax:
20+
// require('./commands')

example-app/package.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "example-app",
3+
"version": "1.0.0",
4+
"main": "index.js",
5+
"license": "MIT",
6+
"scripts": {
7+
"build": "tsc",
8+
"start": "yarn build && node build/index.js",
9+
"start:dev": "concurrently \"yarn build --watch\" \"nodemon --ext '.js' --watch ../build --watch ./build --ignore 'cypress/**/*.js' node build/src/index.js\"",
10+
"cypress:open": "cypress open",
11+
"cypress:run": "cypress run"
12+
},
13+
"devDependencies": {
14+
"@types/express": "^4.17.7",
15+
"concurrently": "^5.2.0",
16+
"cypress": "^4.11.0",
17+
"nodemon": "^2.0.4",
18+
"ts-node": "^8.10.2",
19+
"typescript": "^3.9.7"
20+
},
21+
"dependencies": {
22+
"@admin-bro/core": "^3.0.0-beta.4",
23+
"@admin-bro/express": "^3.0.0-beta.1",
24+
"express": "^4.17.1",
25+
"express-formidable": "^1.2.0",
26+
"express-session": "^1.17.1"
27+
}
28+
}

example-app/src/index.ts

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import express from 'express'
2+
import AdminBro from '@admin-bro/core'
3+
import { buildRouter } from '@admin-bro/express'
4+
5+
const PORT = 3000
6+
7+
const run = async () => {
8+
const app = express()
9+
const admin = new AdminBro()
10+
const router = buildRouter(admin)
11+
12+
app.use(admin.options.rootPath, router)
13+
14+
app.listen(PORT, () => {
15+
// eslint-disable-next-line no-console
16+
console.log(`Example app listening at http://localhost:${PORT}`)
17+
})
18+
}
19+
20+
run()

example-app/tsconfig.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"compilerOptions": {
3+
"outDir": "./build",
4+
"target": "es2017",
5+
"esModuleInterop": true,
6+
"jsx": "react",
7+
"strictNullChecks": true,
8+
"strictPropertyInitialization": true,
9+
"strictFunctionTypes": true,
10+
"strictBindCallApply": true,
11+
"noImplicitThis": true,
12+
"moduleResolution": "node",
13+
"module": "commonjs",
14+
"types": ["cypress"]
15+
},
16+
"include": [
17+
"./src/**/*",
18+
"./cypress/**/*"
19+
],
20+
}

0 commit comments

Comments
 (0)