Skip to content

Commit 3d88524

Browse files
committed
chore(setup): initial app setup (jamaljsr#1)
1 parent 1435af5 commit 3d88524

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+19360
-2
lines changed

.commitlintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["@commitlint/config-conventional"]
3+
}

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.electronbuildrc

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"appId": "com.lightningditto.app",
3+
"productName": "Ditto",
4+
"copyright": "Copyright © 2019 ${author}",
5+
"artifactName": "ditto-${os}-${arch}-v${version}.${ext}",
6+
"files": ["build/**/*", "node_modules/**/*"],
7+
"directories": {
8+
"buildResources": "assets"
9+
},
10+
"mac": {
11+
"category": "public.app-category.utilities",
12+
"target": ["dmg", "zip"]
13+
},
14+
"dmg": {
15+
"contents": [
16+
{
17+
"x": 130,
18+
"y": 220
19+
},
20+
{
21+
"x": 410,
22+
"y": 220,
23+
"type": "link",
24+
"path": "/Applications"
25+
}
26+
]
27+
},
28+
"win": {
29+
"target": [
30+
{
31+
"target": "nsis",
32+
"arch": ["x64", "ia32"]
33+
}
34+
]
35+
},
36+
"linux": {
37+
"target": [
38+
{
39+
"target": "deb",
40+
"arch": ["x64", "ia32"]
41+
},
42+
{
43+
"target": "AppImage",
44+
"arch": ["x64", "ia32"]
45+
}
46+
],
47+
"category": "Development"
48+
},
49+
"publish": {
50+
"provider": "github",
51+
"owner": "jamaljsr",
52+
"repo": "ditto",
53+
"private": false
54+
},
55+
"extends": null
56+
}

.eslintignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# testing
2+
/coverage
3+
4+
# production
5+
/build
6+
/dist
7+
8+
# compiled by tsc from /src/electron/
9+
/public/main.js

.eslintrc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"parser": "@typescript-eslint/parser", // Specifies the ESLint parser
3+
"extends": [
4+
"plugin:react/recommended", // Uses the recommended rules from @eslint-plugin-react
5+
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from @typescript-eslint/eslint-plugin
6+
"prettier/@typescript-eslint", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
7+
"plugin:prettier/recommended" // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
8+
],
9+
"parserOptions": {
10+
"ecmaVersion": 2018, // Allows for the parsing of modern ECMAScript features
11+
"sourceType": "module", // Allows for the use of imports
12+
"ecmaFeatures": {
13+
"jsx": true // Allows for the parsing of JSX
14+
}
15+
},
16+
"settings": {
17+
"react": {
18+
"version": "detect" // Tells eslint-plugin-react to automatically detect the version of React to use
19+
}
20+
},
21+
"rules": {
22+
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
23+
"react/prop-types": "off",
24+
"@typescript-eslint/explicit-function-return-type": "off",
25+
"@typescript-eslint/explicit-member-accessibility": "off",
26+
"@typescript-eslint/no-explicit-any": false
27+
}
28+
}

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
* text eol=lf
2+
*.png binary
3+
*.ico binary
4+
*.icns binary

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. OSX Majave or Windows 10 v1903]
28+
- Docker Version: [e.g. 19.03.1]
29+
- Docker Compose Version: [e.g. 1.24.1]
30+
31+
**Additional context**
32+
Add any other context about the problem here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Closes #(issue number goes here)
2+
3+
### Description
4+
5+
[Description of your changes go here. Please provide both casual and technical explanations.]
6+
7+
### Steps to Test
8+
9+
1. Steps
10+
2. To
11+
3. Test
12+
13+
### Screenshots
14+
15+
[Only if applicable]

.gitignore

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
*.pid.lock
13+
14+
# Directory for instrumented libs generated by jscoverage/JSCover
15+
lib-cov
16+
17+
# Coverage directory used by tools like istanbul
18+
coverage
19+
20+
# nyc test coverage
21+
.nyc_output
22+
23+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24+
.grunt
25+
26+
# Bower dependency directory (https://bower.io/)
27+
bower_components
28+
29+
# node-waf configuration
30+
.lock-wscript
31+
32+
# Compiled binary addons (https://nodejs.org/api/addons.html)
33+
build/Release
34+
35+
# Dependency directories
36+
node_modules/
37+
jspm_packages/
38+
39+
# TypeScript v1 declaration files
40+
typings/
41+
42+
# Optional npm cache directory
43+
.npm
44+
45+
# Optional eslint cache
46+
.eslintcache
47+
48+
# Optional REPL history
49+
.node_repl_history
50+
51+
# Output of 'npm pack'
52+
*.tgz
53+
54+
# Yarn Integrity file
55+
.yarn-integrity
56+
57+
# dotenv environment variables file
58+
.env
59+
60+
# next.js build output
61+
.next
62+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
63+
64+
# dependencies
65+
/node_modules
66+
/.pnp
67+
.pnp.js
68+
69+
# testing
70+
/coverage
71+
72+
# production
73+
/build
74+
/dist
75+
76+
# compiled by tsc from /src/electron/
77+
/public/main.js
78+
/public/main.js.map
79+
80+
# misc
81+
.DS_Store
82+
.env.local
83+
.env.development.local
84+
.env.test.local
85+
.env.production.local
86+
87+
npm-debug.log*
88+
yarn-debug.log*
89+
yarn-error.log*

.i18next-scanner.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
const typescript = require('typescript');
2+
const fs = require('fs');
3+
const path = require('path');
4+
5+
module.exports = {
6+
input: [
7+
'src/**/*.{ts,tsx}',
8+
// Use ! to filter out files or directories
9+
'!src/**/*.spec.{ts,tsx}',
10+
],
11+
output: './',
12+
options: {
13+
debug: true,
14+
func: {
15+
list: ['i18next.t', 'i18n.t', 't'],
16+
},
17+
trans: {
18+
defaultsKey: 'defaults',
19+
},
20+
lngs: ['en-US', 'es'],
21+
defaultLng: 'en-US',
22+
ns: ['translation'],
23+
defaultNs: 'translation',
24+
defaultValue: '__MISSING__TRANSLATION__',
25+
resource: {
26+
loadPath: 'src/i18n/locales/{{lng}}.json',
27+
savePath: 'src/i18n/locales/{{lng}}.json',
28+
},
29+
nsSeparator: ':',
30+
keySeparator: false,
31+
},
32+
transform: function transform(file, enc, done) {
33+
const { base, ext } = path.parse(file.path);
34+
// custom transform for typescript files
35+
if (['.ts', '.tsx'].includes(ext) && !base.includes('.d.ts')) {
36+
const content = fs.readFileSync(file.path, enc);
37+
38+
// convert ts code into es2018 code that the parser can injest
39+
const { outputText } = typescript.transpileModule(content, {
40+
compilerOptions: {
41+
target: 'es2018',
42+
},
43+
fileName: path.basename(file.path),
44+
});
45+
46+
this.parser.parseTransFromString(outputText);
47+
this.parser.parseFuncFromString(outputText);
48+
}
49+
50+
done();
51+
},
52+
};

0 commit comments

Comments
 (0)