Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialise repo #1

Merged
merged 7 commits into from
May 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# https://editorconfig.org
NMinhNguyen marked this conversation as resolved.
Show resolved Hide resolved
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 80
trim_trailing_whitespace = true

[*.{md,mdx}]
max_line_length = 0
trim_trailing_whitespace = false

[COMMIT_EDITMSG]
max_line_length = 0
1 change: 1 addition & 0 deletions .eslintignore
34 changes: 34 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module.exports = {
root: true,
env: {
browser: true,
Copy link
Contributor Author

@NMinhNguyen NMinhNguyen May 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's likely we'll need to use overrides to have different rules for Node.js vs browser packages (e.g. https://github.com/facebook/create-react-app/tree/master/packages/eslint-config-react-app for the latter) in the (very near) future but this should be okay for now.

es6: true,
node: true,
},
extends: [
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add it if it is good and catches semantic errors?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to get too carried away in the first PR, these are more just TODOs for future.

'eslint:recommended',
'plugin:@typescript-eslint/recommended',
NMinhNguyen marked this conversation as resolved.
Show resolved Hide resolved
'plugin:react/recommended',
'prettier',
'prettier/react',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2020,
Copy link
Contributor Author

@NMinhNguyen NMinhNguyen May 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npx eslint --init set this to 11, but I switched it to 2020 because it's more standard I think. But I actually wonder if we should lower this to the version that current Node.js LTS (10) supports, i.e. ES2017?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think setting it to 2020 is fine.

12 is the active LTS anyway. And by October, 14 will be active!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes but maintenance LTS is what is supported by the ecosystem typically..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong position on this, but am apt to pick whatever is new so we can use the latest APIs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpmorganchase/modular-team thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we could use Babel (or rather, will most likely end up using Babel anyway) so it doesn't matter

sourceType: 'module',
},
plugins: ['@typescript-eslint', 'react'],
rules: {},
settings: {
react: {
version: 'detect',
},
},
};
NMinhNguyen marked this conversation as resolved.
Show resolved Hide resolved
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Dependencies
/node_modules
NMinhNguyen marked this conversation as resolved.
Show resolved Hide resolved

# Testing
/coverage

# Misc
.DS_Store
.eslintcache

# Editors
.idea

# Logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
15 changes: 15 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"singleQuote": true,
"trailingComma": "all",
"printWidth": 80,
"proseWrap": "always",

"overrides": [
{
"files": ["*.md", "*.mdx"],
"options": {
"printWidth": 120
}
}
]
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright JPMorgan Chase & Co.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# modular

`modular` allows you to develop and deploy applications, written as JavaScript modules, across multiple repositories.

It consists of a few parts:

- a spec for tracking and resolving dependencies
- a development server to write and debug code locally
- a tool to build and deploy these assets
- documentation and guidance
31 changes: 31 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"lint": "eslint --cache --fix --ext .js,.ts,.tsx --max-warnings 0 ."
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^3.0.0",
"@typescript-eslint/parser": "^3.0.0",
"eslint": "^7.0.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-react": "^7.20.0",
"husky": "^4.2.5",
"lint-staged": "^10.2.4",
"prettier": "2.0.5",
NMinhNguyen marked this conversation as resolved.
Show resolved Hide resolved
"react": "^16.13.1",
"react-dom": "^16.13.1",
"typescript": "~3.9.3"
NMinhNguyen marked this conversation as resolved.
Show resolved Hide resolved
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{js,ts,tsx}": "eslint --cache --fix --ext .js,.ts,.tsx --max-warnings 0",
"*.{js,json,ts,tsx,css,md,mdx}": "prettier --write"
}
}
24 changes: 24 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */

/* Basic Options */
"target": "esnext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
NMinhNguyen marked this conversation as resolved.
Show resolved Hide resolved
"module": "esnext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
/* Specify library files to be included in the compilation. */
"lib": ["dom", "dom.iterable", "esnext"],
"jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */,
"noEmit": true /* Do not emit outputs. */,
"isolatedModules": true /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */,

/* Strict Type-Checking Options */
"strict": true /* Enable all strict type-checking options. */,

/* Module Resolution Options */
"moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,

/* Advanced Options */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
}
}
Loading