Skip to content

Commit

Permalink
feat: TypeScript && improved SSR mechanisms (webiny#677)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrians5j authored Jan 27, 2020
1 parent f77b646 commit 3da0566
Show file tree
Hide file tree
Showing 3,238 changed files with 83,374 additions and 76,284 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .adiorc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const LOAD_COMPONENTS_PREFIX = ["@webiny/", "@serverless/"];

module.exports = {
parser: {
plugins: ["jsx", "classProperties", "dynamicImport", "flow"]
plugins: ["jsx", "classProperties", "dynamicImport", "throwExpressions", "typescript"]
},
traverse: ({ path, push }) => {
// We try to detect "this.load("...")" calls inside of Serverless components.
Expand Down
89 changes: 23 additions & 66 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,115 +14,72 @@
"name": "Adrian Smijulj",
"avatar_url": "https://avatars0.githubusercontent.com/u/5121148?v=4",
"profile": "https://www.webiny.com",
"contributions": [
"question",
"code",
"doc",
"example",
"ideas",
"infra",
"maintenance",
"platform",
"plugin",
"tool"
]
"contributions": []
},
{
"login": "Pavel910",
"name": "Pavel Denisjuk",
"avatar_url": "https://avatars1.githubusercontent.com/u/3920893?v=4",
"profile": "http://webiny.com/",
"contributions": [
"question",
"code",
"doc",
"example",
"ideas",
"infra",
"maintenance",
"platform",
"plugin",
"projectManagement",
"tool"
]
"contributions": []
},
{
"login": "SvenAlHamad",
"name": "Sven",
"avatar_url": "https://avatars3.githubusercontent.com/u/3808420?v=4",
"profile": "http://www.webiny.com/",
"contributions": [
"question",
"blog",
"bug",
"business",
"code",
"design",
"doc",
"financial",
"fundingFinding",
"ideas",
"infra",
"maintenance",
"projectManagement",
"tutorial",
"video"
]
"contributions": []
},
{
"login": "ndcollins",
"name": "Nick Collins",
"avatar_url": "https://avatars0.githubusercontent.com/u/501726?v=4",
"profile": "https://github.com/ndcollins",
"contributions": [
"bug",
"ideas",
"userTesting"
]
"contributions": []
},
{
"login": "JetUni",
"name": "Jarrett",
"avatar_url": "https://avatars0.githubusercontent.com/u/1317221?v=4",
"profile": "https://github.com/JetUni",
"contributions": [
"bug",
"code"
]
"contributions": []
},
{
"login": "enmesarru",
"name": "Furkan KURUTAŞ",
"avatar_url": "https://avatars2.githubusercontent.com/u/40731570?v=4",
"profile": "https://github.com/enmesarru",
"contributions": [
"code"
]
"contributions": []
},
{
"login": "roman-vabishchevych",
"name": "Roman Vabishchevych",
"avatar_url": "https://avatars3.githubusercontent.com/u/4134474?v=4",
"profile": "https://github.com/roman-vabishchevych",
"contributions": [
"bug",
"code",
"ideas",
"plugin",
"userTesting"
]
"contributions": []
},
{
"login": "fodurrr",
"name": "fodurrr",
"avatar_url": "https://avatars1.githubusercontent.com/u/10008597?v=4",
"profile": "https://github.com/fodurrr",
"contributions": [
"bug",
"userTesting"
]
"contributions": []
},
{
"login": "jbampton",
"name": "John Bampton",
"avatar_url": "https://avatars3.githubusercontent.com/u/418747?v=4",
"profile": "https://thebeast.me/about/",
"contributions": []
},
{
"login": "jamesgeorge007",
"name": "James George",
"avatar_url": "https://avatars2.githubusercontent.com/u/25279263?v=4",
"profile": "https://ghuser.io/jamesgeorge007",
"contributions": []
}
],
"contributorsPerLine": 7,
"contributorsPerLine": 6,
"commitConvention": "none"
}
25 changes: 25 additions & 0 deletions .babel.node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const alias = require("@webiny/project-utils/aliases/jest");

const babel = {
presets: [
[
"@babel/preset-env",
{
targets: {
node: "8.10"
}
}
],
"@babel/preset-typescript"
],
plugins: [
["@babel/plugin-proposal-class-properties"],
["@babel/plugin-proposal-object-rest-spread", { useBuiltIns: true }],
["@babel/plugin-transform-runtime", { useESModules: false }],
["babel-plugin-dynamic-import-node"],
["babel-plugin-lodash"],
process.env.NODE_ENV === "test" ? ["babel-plugin-module-resolver", { alias }] : null
].filter(Boolean)
};

module.exports = babel;
56 changes: 56 additions & 0 deletions .babel.react.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
module.exports = {
presets: [
[
"@babel/preset-env",
{
targets: {
browsers: ["last 2 versions", "safari >= 7"]
},
// Allow importing core-js in entrypoint and use browserlist to select polyfills
useBuiltIns: "entry",
// Set the corejs version we are using to avoid warnings in console
// This will need to change once we upgrade to corejs@3
corejs: 3,
// Do not transform modules to CJS
modules: false,
// Exclude transforms that make all code slower
exclude: ["transform-typeof-symbol"]
}
],
["@babel/preset-react", { useBuiltIns: true }],
["@babel/preset-typescript", { isTSX: true, allExtensions: true }]
],
plugins: [
"babel-plugin-lodash",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-throw-expressions",
[
"@babel/plugin-transform-runtime",
{
corejs: false,
version: require("@babel/runtime/package.json").version,
regenerator: true,
useESModules: false
}
],
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-nullish-coalescing-operator",
["babel-plugin-emotion", { autoLabel: true }],
[
"@babel/plugin-proposal-object-rest-spread",
{
useBuiltIns: true
}
],
[
"babel-plugin-named-asset-import",
{
loaderMap: {
svg: {
ReactComponent: "@svgr/webpack![path]"
}
}
}
]
]
};
41 changes: 24 additions & 17 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,38 @@
const aliases = require("@webiny/project-utils/aliases");

module.exports = {
parser: "babel-eslint",
extends: ["eslint:recommended", "plugin:jest/recommended", "plugin:react/recommended"],
plugins: ["flowtype", "jest", "import"],
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:jest/recommended",
"plugin:react/recommended"
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2018,
sourceType: "module"
},
plugins: ["@typescript-eslint", "jest", "import", "react"],
env: {
jest: true,
commonjs: true,
node: true,
es6: true
},
parserOptions: {
ecmaVersion: 6,
sourceType: "module"
},
rules: {
"flowtype/define-flow-type": 1,
"flowtype/use-flow-type": 1,
"react/prop-types": 0,
"import/no-unresolved": [2, { commonjs: true, amd: true }]
"import/no-unresolved": 0, // [2, { commonjs: true, amd: true }],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-use-before-define": 0,
"@typescript-eslint/no-var-requires": 0
},
settings: {
flowtype: {
onlyFilesWithFlowAnnotation: true
},
"import/resolver": {
"babel-module": { alias: aliases }
react: {
pragma: "React",
version: "detect"
}
},
globals: {
window: true,
document: true
}
};
50 changes: 0 additions & 50 deletions .flowconfig

This file was deleted.

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ build/
.files/
.changelog
.verdaccio
.history
.history
*.tsbuildinfo
.cloudfnsrc.js
.cloudfns/
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
tabWidth: 2,
overrides: [
{
files: "*.js",
files: ["*.js", "*.ts", "*.tsx"],
options: {
tabWidth: 4
}
Expand Down
Loading

0 comments on commit 3da0566

Please sign in to comment.