From 1b5013edcbc7e28725a0206a7eb2e1b188bf0f84 Mon Sep 17 00:00:00 2001 From: Charlie Jonas Date: Sun, 21 Apr 2019 12:09:44 -0600 Subject: [PATCH] sfdx project structure (#23) * better windows readme * ability to change sfdx module path * #22 Refactored src -> app * added notes about upgrading --- README.md | 61 +++++- {src => app}/app.tsx | 0 {src => app}/assets/images/bass-logo.jpg | Bin {src => app}/components/index.ts | 0 {src => app}/generated/Account.ts | 8 +- {src => app}/generated/Contact.ts | 8 +- {src => app}/generated/index.ts | 0 {src => app}/index.tsx | 0 {src => app}/styles/ant-theme-vars.less | 0 {src => app}/styles/styles.less | 0 {src => app}/tests/Example.spec.tsx | 0 {src => app}/types.d.ts | 0 config/jest.json | 6 +- config/ts-force-config.json | 2 +- config/webpack.config.ts | 18 +- package-lock.json | 242 +++++++++++------------ package.json | 21 +- tsconfig.json | 4 +- 18 files changed, 211 insertions(+), 159 deletions(-) rename {src => app}/app.tsx (100%) rename {src => app}/assets/images/bass-logo.jpg (100%) rename {src => app}/components/index.ts (100%) rename {src => app}/generated/Account.ts (98%) rename {src => app}/generated/Contact.ts (98%) rename {src => app}/generated/index.ts (100%) rename {src => app}/index.tsx (100%) rename {src => app}/styles/ant-theme-vars.less (100%) rename {src => app}/styles/styles.less (100%) rename {src => app}/tests/Example.spec.tsx (100%) rename {src => app}/types.d.ts (100%) diff --git a/README.md b/README.md index 563465a..8f0ab5d 100644 --- a/README.md +++ b/README.md @@ -32,10 +32,15 @@ Make sure you have the following installed on your machine: #### Windows -You will also need the following: +You will also need the ability to execute the following bash commands: `zip`, `cp`, `mv`. -* A `bash` enumerator (one comes with `git`) OR [linux](https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/). Basiclly you need your shell to be able to run standard GNU commands like `cp`, `mv`, `zip`, etc. -** You may also need to tell npm to use bash: `npm config set script-shell "C:\\Program Files\\Git\\bin\\bash.exe"` +There are several options: + +* A `bash` enumerator (like the one included with `git`). You may need to [install `zip` binaries](https://stackoverflow.com/questions/38782928/how-to-add-man-and-zip-to-git-bash-installation-on-windows/55749636#55749636) +* [linux](https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/) +* [mingw](http://www.mingw.org/wiki/Getting_Started) + +You may also need to tell npm to use bash: `npm config set script-shell "C:\\Program Files\\Git\\bin\\bash.exe"` ### Clone this Starter @@ -43,6 +48,13 @@ You will also need the following: 2. `cd bass` 3. `npm install` +#### Project Structure + +* `app`: The react Application source Folder +* `force-app`: The Salesforce DX package. Store related metadata here +* `config`: configurations for development, build & tests (some configuration files are in root) +* `dist`: the build directory + ### Authentication To do much of anything you'll need to connect with one or more orgs. Use `sfdx force:org:list` to see a list of orgs you're already authenticated with. Connect to an existing sandbox using `sfdx force:auth:web:login -sr [ORG_URL] -a [ALIAS]`. You can also create a scratch org using: `npm run new-scratch-org`. @@ -65,7 +77,6 @@ prod_alias=john@acme.com *NOTE: You might want to ignore `.npmrc` for your repo. Each contributor will manage this configuration separately and committing it could result in another user accidentally deploying to an unintended org. This is especially true if you use the sfdx alias over the username - ## DEVELOPMENT 1. Deploy your application by running `npm run deploy-dev` or `npm run deploy-scratch`. This step needs to happen whenever the contents of `force-app` change. @@ -154,6 +165,48 @@ It is possible to debug right from vscode. To do so: 4. `f5` or launch `debug locally` configuration 5. you may need to Enable [Allow Insecure Localhost](chrome://flags/#allow-insecure-localhost) again if it opens in a different instance of chrome +## Upgrading to newer version of "BASS" + +Overtime, this project has gotten both simpler AND objectively better. + +Unfortunately upgrades are currently a very manual process. Over the many different enhancements: + +* configuration files have been changed & moved around +* Low Value / High Complexity: features have been removed +* build scripts have changed +* configuration files have changed +* npm dependencies have been upgraded/added/removed + +I admit, I haven't done a very good job of documenting these changes very well. My goal of keeping this everything as flexible as possible has also made it impossible to move parts of the configuration to upgradable packages. + +I've tried to go back and tag `Release` to give a sense of breaking changes, but it's very incomplete. + +### Things to consider when upgrading + +* Most changes have happened in the following areas: + * `package.json` (particularly the `scripts` & `config` sections) + * `webpack.config.ts` + * `tsconfig.json` + +For these files, it's best to first identify any customization of your own and then try to merge them into the latest version from `B.A.S.S.`. + +* Lots of files have been moved around. In particular: + * many files have been moved to `config` folder. + * `src` has been renamed to `app` + +* Features & dependencies have been removed. Examples: + * there is no longer an `local` mode as it no longer has any advantages over using `Localhost assets on salesforce` + * Redux was removed from the core of this project + * Replaced `awesome-typescript-loader` with babel + * self-signed cert generation script has been removed (manual instructions are in `config/cert`) + +* Runtime dependencies have been upgraded to the latest and greatest. Which likely means breaking changes in these libraries: + * react + * antd + * ts-force + +In most cases you should just be able to continue using your runtime library versions with the latest version of `B.A.S.S.`. + ## OTHER USEFUL STUFF ### vscode diff --git a/src/app.tsx b/app/app.tsx similarity index 100% rename from src/app.tsx rename to app/app.tsx diff --git a/src/assets/images/bass-logo.jpg b/app/assets/images/bass-logo.jpg similarity index 100% rename from src/assets/images/bass-logo.jpg rename to app/assets/images/bass-logo.jpg diff --git a/src/components/index.ts b/app/components/index.ts similarity index 100% rename from src/components/index.ts rename to app/components/index.ts diff --git a/src/generated/Account.ts b/app/generated/Account.ts similarity index 98% rename from src/generated/Account.ts rename to app/generated/Account.ts index dd2f998..5ce3fad 100644 --- a/src/generated/Account.ts +++ b/app/generated/Account.ts @@ -1,7 +1,7 @@ import { Rest, RestObject, SObject, sField, SalesforceFieldType, SFLocation, SFieldProperties, FieldResolver, SOQLQueryParams, buildQuery, FieldProps } from "ts-force"; import { Contact } from "./"; -export type AccountFields = FieldProps; +export type AccountFields = Partial>; /** * Generated class for Account @@ -217,16 +217,16 @@ export class Account extends RestObject { this.upsellOpportunity = void 0; this.sLASerialNumber = void 0; this.sLAExpirationDate = void 0; - Object.assign(this, fields); + this.initObject(fields); return new Proxy(this, this.safeUpdateProxyHandler); } public static API_NAME: 'Account' = 'Account'; public readonly _TYPE_: 'Account' = 'Account'; - private static _fields: { [P in keyof AccountFields]: SFieldProperties; }; + private static _fields: { [P in keyof FieldProps]: SFieldProperties; }; public static get FIELDS() { - return this._fields = this._fields ? this._fields : Account.getPropertiesMeta(Account) + return this._fields = this._fields ? this._fields : Account.getPropertiesMeta, Account>(Account) } public static async retrieve(qryParam: ((fields: FieldResolver) => SOQLQueryParams) | string): Promise { diff --git a/src/generated/Contact.ts b/app/generated/Contact.ts similarity index 98% rename from src/generated/Contact.ts rename to app/generated/Contact.ts index 563c8aa..a20368a 100644 --- a/src/generated/Contact.ts +++ b/app/generated/Contact.ts @@ -1,7 +1,7 @@ import { Rest, RestObject, SObject, sField, SalesforceFieldType, SFLocation, SFieldProperties, FieldResolver, SOQLQueryParams, buildQuery, FieldProps } from "ts-force"; import { Account } from "./"; -export type ContactFields = FieldProps; +export type ContactFields = Partial>; /** * Generated class for Contact @@ -199,16 +199,16 @@ export class Contact extends RestObject { this.cleanStatus = void 0; this.level = void 0; this.languages = void 0; - Object.assign(this, fields); + this.initObject(fields); return new Proxy(this, this.safeUpdateProxyHandler); } public static API_NAME: 'Contact' = 'Contact'; public readonly _TYPE_: 'Contact' = 'Contact'; - private static _fields: { [P in keyof ContactFields]: SFieldProperties; }; + private static _fields: { [P in keyof FieldProps]: SFieldProperties; }; public static get FIELDS() { - return this._fields = this._fields ? this._fields : Contact.getPropertiesMeta(Contact) + return this._fields = this._fields ? this._fields : Contact.getPropertiesMeta, Contact>(Contact) } public static async retrieve(qryParam: ((fields: FieldResolver) => SOQLQueryParams) | string): Promise { diff --git a/src/generated/index.ts b/app/generated/index.ts similarity index 100% rename from src/generated/index.ts rename to app/generated/index.ts diff --git a/src/index.tsx b/app/index.tsx similarity index 100% rename from src/index.tsx rename to app/index.tsx diff --git a/src/styles/ant-theme-vars.less b/app/styles/ant-theme-vars.less similarity index 100% rename from src/styles/ant-theme-vars.less rename to app/styles/ant-theme-vars.less diff --git a/src/styles/styles.less b/app/styles/styles.less similarity index 100% rename from src/styles/styles.less rename to app/styles/styles.less diff --git a/src/tests/Example.spec.tsx b/app/tests/Example.spec.tsx similarity index 100% rename from src/tests/Example.spec.tsx rename to app/tests/Example.spec.tsx diff --git a/src/types.d.ts b/app/types.d.ts similarity index 100% rename from src/types.d.ts rename to app/types.d.ts diff --git a/config/jest.json b/config/jest.json index f297fd3..356cd60 100644 --- a/config/jest.json +++ b/config/jest.json @@ -12,9 +12,9 @@ "moduleNameMapper": { "\\.(css|scss|less)$": "/config/__mocks__/styleMock.js", "\\.(png|jpg|gif|ttf|eot|svg)$": "/config/__mocks__/fileMock.js", - "@src/(.*)": "/src/$1", - "@gen/(.*)": "/src/generated/$1" + "@src/(.*)": "/app/$1", + "@gen/(.*)": "/app/generated/$1" }, - "testRegex": "/src/tests/.*\\.(ts|tsx|js)$", + "testRegex": "/app/tests/.*\\.(ts|tsx|js)$", "unmockedModulePathPatterns": [] } diff --git a/config/ts-force-config.json b/config/ts-force-config.json index bf98d3a..ee44f06 100644 --- a/config/ts-force-config.json +++ b/config/ts-force-config.json @@ -3,5 +3,5 @@ "username": "demo@bass.starter" }, "sObjects": ["Account", "Contact"], - "outPath": "./src/generated" + "outPath": "./app/generated" } diff --git a/config/webpack.config.ts b/config/webpack.config.ts index 0733ff4..94250b0 100644 --- a/config/webpack.config.ts +++ b/config/webpack.config.ts @@ -6,12 +6,15 @@ import lessToJs from 'less-vars-to-js'; const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; /** Setup Paths */ +const root = path.resolve(__dirname, '..'); +const src = path.resolve(root, 'app'); const PATHS = { - root: path.resolve(__dirname, '..'), - src: path.resolve(__dirname, '../src'), - assets: path.resolve(__dirname, '../src/assets'), - dist: path.resolve(__dirname, '../dist'), - styles: path.resolve(__dirname, '../src/styles') + root, + src, + index: path.resolve(src, 'index.tsx'), + assets: path.resolve(src, 'assets'), + styles: path.resolve(src, 'styles'), + dist: path.resolve(root, 'dist'), }; // for ant style overrides @@ -54,7 +57,7 @@ module.exports = (env: any = {}) => { entry: { app: [ 'babel-polyfill', - './src/index.tsx', + PATHS.index, ], }, output: { @@ -86,7 +89,6 @@ module.exports = (env: any = {}) => { // externals: { // }, - /*** LOADERS ***/ module: { rules: [ @@ -96,7 +98,7 @@ module.exports = (env: any = {}) => { test: /\.(ts|js)x?$/, exclude: /node_modules/, loader: 'babel-loader', - options: require('./babelrc.json') + options: require('./babelrc.json'), }, // css { diff --git a/package-lock.json b/package-lock.json index 4a21c0f..f5f2200 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,15 +4,24 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@ant-design/create-react-context": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@ant-design/create-react-context/-/create-react-context-0.2.4.tgz", + "integrity": "sha512-8sw+/w6r+aEbd+OJ62ojoSE4zDt/3yfQydmbWFznoftjr8v/opOswGjM+/MU0rSaREbluqzOmZ6xdecHpSaS2w==", + "requires": { + "gud": "^1.0.0", + "warning": "^4.0.3" + } + }, "@ant-design/icons": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@ant-design/icons/-/icons-1.2.1.tgz", "integrity": "sha512-gQx3nH6m1xvebOWh5xibhzVK02aoqHY7JUXUS4doAidSDRWsj5iwKC8Gq9DemDZ4T+bW6xO7jJZN1UsbvcW7Uw==" }, "@ant-design/icons-react": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@ant-design/icons-react/-/icons-react-1.1.2.tgz", - "integrity": "sha512-7Fgt9d8ABgxrhZxsFjHk/VpPcxodQJJhbJO8Lsh7u58pGN4NoxxW++92naeGTXCyqZsbDPBReP+SC0bdBtbsGQ==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@ant-design/icons-react/-/icons-react-1.1.5.tgz", + "integrity": "sha512-p2ybKfO/r2lC1RZu4rDY2VBDZq2zqAaJzf/B1HrKTxGo8/mM1zOOEoob/LRXZphJ9jD5wCcTdcmcB9YMaAWW4Q==", "requires": { "ant-design-palettes": "^1.1.3", "babel-runtime": "^6.26.0" @@ -2635,6 +2644,15 @@ "@types/range-parser": "*" } }, + "@types/hoist-non-react-statics": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz", + "integrity": "sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==", + "requires": { + "@types/react": "*", + "hoist-non-react-statics": "^3.3.0" + } + }, "@types/http-proxy": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.0.tgz", @@ -3127,19 +3145,20 @@ } }, "antd": { - "version": "3.15.0", - "resolved": "https://registry.npmjs.org/antd/-/antd-3.15.0.tgz", - "integrity": "sha512-gSoVmQN7rfYmhfpv0dL2sL9gk0Pu9JHgGiExjLJZaSnbPjpCOTAYjIzxG/oo8GzCSeK5abgN5F1saWR5ggLVFQ==", + "version": "3.16.4", + "resolved": "https://registry.npmjs.org/antd/-/antd-3.16.4.tgz", + "integrity": "sha512-n+BbeN5ojCORN5EMt/vXTTSNqXMaOogK52JTYlWWQr+x+SyEkXDh41Hi95lPiKKoM8BNLHSPS3SQdaqy5Cx1Gw==", "requires": { + "@ant-design/create-react-context": "^0.2.4", "@ant-design/icons": "~1.2.0", - "@ant-design/icons-react": "~1.1.2", + "@ant-design/icons-react": "~1.1.5", + "@types/hoist-non-react-statics": "^3.3.1", "@types/react-slick": "^0.23.3", "array-tree-filter": "^2.1.0", "babel-runtime": "6.x", "classnames": "~2.2.6", "copy-to-clipboard": "^3.0.8", "create-react-class": "^15.6.3", - "create-react-context": "0.2.2", "css-animation": "^1.5.0", "dom-closest": "^0.2.0", "enquire.js": "^2.1.6", @@ -3149,7 +3168,7 @@ "prop-types": "^15.6.2", "raf": "^3.4.0", "rc-animate": "^2.5.4", - "rc-calendar": "~9.10.3", + "rc-calendar": "~9.12.1", "rc-cascader": "~0.17.0", "rc-checkbox": "~2.1.5", "rc-collapse": "~1.11.1", @@ -3168,11 +3187,11 @@ "rc-slider": "~8.6.5", "rc-steps": "~3.3.0", "rc-switch": "~1.9.0", - "rc-table": "~6.4.0", + "rc-table": "~6.5.0", "rc-tabs": "~9.6.0", "rc-time-picker": "~3.6.1", "rc-tooltip": "~3.7.3", - "rc-tree": "~1.14.6", + "rc-tree": "~1.15.2", "rc-tree-select": "~2.6.0", "rc-trigger": "^2.6.2", "rc-upload": "~2.6.0", @@ -4406,11 +4425,11 @@ "dev": true }, "copy-to-clipboard": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.0.8.tgz", - "integrity": "sha512-c3GdeY8qxCHGezVb1EFQfHYK/8NZRemgcTIzPq7PuxjHAf/raKibn2QdhHPb/y6q74PMgH6yizaDZlRmw6QyKw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.1.0.tgz", + "integrity": "sha512-+RNyDq266tv5aGhfRsL6lxgj8Y6sCvTrVJnFUVvuxuqkcSMaLISt1wd4JkdQSphbcLTIQ9kEpTULNnoCXAFdng==", "requires": { - "toggle-selection": "^1.0.3" + "toggle-selection": "^1.0.6" } }, "core-js": { @@ -6638,13 +6657,21 @@ "integrity": "sha512-zGEOVKFM5sVPPrYs7J5/hYEw2Pof8KCyOwyhG8sAF26mCAeUFAcYPu1mwB7hhpIP29zOIBaDqwuHdLp0jvZXjw==" }, "gzip-size": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-5.0.0.tgz", - "integrity": "sha512-5iI7omclyqrnWw4XbXAmGhPsABkSIDQonv2K0h61lybgofWa6iZyvrI3r2zsJH4P8Nb64fFVzlvfhs0g7BBxAA==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-5.1.0.tgz", + "integrity": "sha512-wfSnvypBDRW94v5W3ckvvz/zFUNdJ81VgOP6tE4bPpRUcc0wGqU+y0eZjJEvKxwubJFix6P84sE8M51YWLT7rQ==", "dev": true, "requires": { "duplexer": "^0.1.1", - "pify": "^3.0.0" + "pify": "^4.0.1" + }, + "dependencies": { + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + } } }, "hammerjs": { @@ -6788,9 +6815,12 @@ } }, "hoist-non-react-statics": { - "version": "2.5.5", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz", - "integrity": "sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw==" + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.0.tgz", + "integrity": "sha512-0XsbTXxgiaCDYDIWFcwkmerZPSwywfUqYmwT4jzewKTQSWoE6FCMoUVOeBJWK3E/CrWbxRG3m5GzY4lnIwGRBA==", + "requires": { + "react-is": "^16.7.0" + } }, "homedir-polyfill": { "version": "1.0.3", @@ -7257,11 +7287,6 @@ "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", "dev": true }, - "is-negative-zero": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz", - "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=" - }, "is-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", @@ -10577,6 +10602,13 @@ "prop-types": "^15.6.0", "react-lifecycles-compat": "^3.0.4", "shallowequal": "^1.0.2" + }, + "dependencies": { + "hoist-non-react-statics": { + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz", + "integrity": "sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw==" + } } }, "minimalistic-assert": { @@ -11099,9 +11131,9 @@ "dev": true }, "omit.js": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/omit.js/-/omit.js-1.0.0.tgz", - "integrity": "sha512-O1rwbvEfAdhtonTv+v6IQeMOKTi/wlHcXpI3hehyPDlujkjSBQC6Vtzg0mdy+v2KVDmuPf7hAbHlTBM6q1bUHQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/omit.js/-/omit.js-1.0.2.tgz", + "integrity": "sha512-/QPc6G2NS+8d4L/cQhbk6Yit1WTB6Us2g84A7A/1+w9d/eRGHyEqC5kkQtHVoHZ5NFWGG7tUGgrhVZwgZanKrQ==", "requires": { "babel-runtime": "^6.23.0" } @@ -11602,9 +11634,9 @@ "dev": true }, "prettier": { - "version": "1.16.4", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.16.4.tgz", - "integrity": "sha512-ZzWuos7TI5CKUeQAtFd6Zhm2s6EpAD/ZLApIhsF9pRvRtM1RFo61dM/4MSRUA0SuLugA/zgrZD8m0BaY46Og7g==" + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.17.0.tgz", + "integrity": "sha512-sXe5lSt2WQlCbydGETgfm1YBShgOX4HxQkFPvbxkcwgDvGDeqVau8h+12+lmSVlP3rHPz0oavfddSZg/q+Szjw==" }, "private": { "version": "0.1.8", @@ -11841,9 +11873,9 @@ } }, "rc-calendar": { - "version": "9.10.10", - "resolved": "https://registry.npmjs.org/rc-calendar/-/rc-calendar-9.10.10.tgz", - "integrity": "sha512-WFnxpXGzIt2cPCJjFmrju/w2jZHAO9jW3JSDZovaJuBtVciu1p8brL6PSjWCo4flD3jVurL9LO8tJwgajELj2w==", + "version": "9.12.4", + "resolved": "https://registry.npmjs.org/rc-calendar/-/rc-calendar-9.12.4.tgz", + "integrity": "sha512-AByRVQKcZcxciQDGUFWW4s0mQgb4nS1FMWv0pa5LwER7JP0CFpm1ql2gMPt+2fZ7BZCAv5IRgfmpReRef8e5pw==", "requires": { "babel-runtime": "6.x", "classnames": "2.x", @@ -11893,9 +11925,9 @@ } }, "rc-dialog": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/rc-dialog/-/rc-dialog-7.3.0.tgz", - "integrity": "sha512-YLQHqZuU0cO02LUwhCsCCtvSw24SKLrT4DkNHCNGGcH9YpZP/IOFaH4zVUmXGEQiwyt0D1f3volHthMCKzLzMg==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/rc-dialog/-/rc-dialog-7.3.1.tgz", + "integrity": "sha512-AlGpAWgz23RtZlmke/JZM7hJxBl5fylwfcp2dn0qS4v5T8nhaKT/t4WEtTGYMQcuXxPE06KGz6tXqhaQDnXw3Q==", "requires": { "babel-runtime": "6.x", "rc-animate": "2.x", @@ -11903,9 +11935,9 @@ } }, "rc-drawer": { - "version": "1.7.7", - "resolved": "https://registry.npmjs.org/rc-drawer/-/rc-drawer-1.7.7.tgz", - "integrity": "sha512-7dESNkClYdWGSdBdwcfeOz6DUCqzrW44QT013fsTBJIiWNLSLgDV5KoHKXG8VTJWU4mBn7M5Lqgyr94CRZcxGA==", + "version": "1.7.8", + "resolved": "https://registry.npmjs.org/rc-drawer/-/rc-drawer-1.7.8.tgz", + "integrity": "sha512-gshd9fG12iSFDHicKzZQf8YbrTPyXA+ubkmaIwrudreI6+ipDUpXByflhEgiaRBhkZyv4L0EkW1srjetyzkfwA==", "requires": { "babel-runtime": "6.x", "classnames": "^2.2.5", @@ -11955,9 +11987,9 @@ } }, "rc-form": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/rc-form/-/rc-form-2.4.3.tgz", - "integrity": "sha512-59KeQat5TU4YzpfXYpFlyQ1/5uFXm0SV7VokRr+i8bPMhimpKpZl5gt0J7dNiKLTsGnkCqBLSL88d9ufPJ+EQQ==", + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/rc-form/-/rc-form-2.4.4.tgz", + "integrity": "sha512-AHR2GGYJOlKG5jP6ZjqS+PVBrUUXt+kDJFgJeDw17k6RDVIrG1535MxDPgNmRXp2VM4GQij4sVvjaHvwFsUgCA==", "requires": { "async-validator": "~1.8.5", "babel-runtime": "6.x", @@ -11966,16 +11998,6 @@ "hoist-non-react-statics": "^3.3.0", "lodash": "^4.17.4", "warning": "^4.0.3" - }, - "dependencies": { - "hoist-non-react-statics": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.0.tgz", - "integrity": "sha512-0XsbTXxgiaCDYDIWFcwkmerZPSwywfUqYmwT4jzewKTQSWoE6FCMoUVOeBJWK3E/CrWbxRG3m5GzY4lnIwGRBA==", - "requires": { - "react-is": "^16.7.0" - } - } } }, "rc-hammerjs": { @@ -11989,22 +12011,21 @@ } }, "rc-input-number": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/rc-input-number/-/rc-input-number-4.4.0.tgz", - "integrity": "sha512-AsXLVaQZ7rCU71B8zzP3nviL8/CkFGDcp5kIlpMzBdGIHoLyRnXcxei3itH9PfFSgMBixEnb5hFVoTikFbNWSQ==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/rc-input-number/-/rc-input-number-4.4.1.tgz", + "integrity": "sha512-vgMjTNzBwgK6JkGVXfoHtYziTn4aFarYaHCYEwlJpDkLDvBxwcSlfXZ4ZGqS4MpouDKO0B1W1oPiXcJbJWG3zg==", "requires": { "babel-runtime": "6.x", "classnames": "^2.2.0", - "is-negative-zero": "^2.0.0", "prop-types": "^15.5.7", "rc-util": "^4.5.1", "rmc-feedback": "^2.0.0" } }, "rc-menu": { - "version": "7.4.21", - "resolved": "https://registry.npmjs.org/rc-menu/-/rc-menu-7.4.21.tgz", - "integrity": "sha512-TfcwybKLuw2WhEkplYH7iFMGlDbH6KhPcd+gv5J2oLQcgiGeUECzyOWSVaFRRlkpB7g2eNzXbha/AXN/Xyzvnw==", + "version": "7.4.22", + "resolved": "https://registry.npmjs.org/rc-menu/-/rc-menu-7.4.22.tgz", + "integrity": "sha512-6o/5H7y60O7Q9Yvp3YaqxPQA65zfh0goiWV98Xh2R95qYg2QRGP7aiMdYG0sjVpZR67oTneMMIoyfMudj9iQmA==", "requires": { "babel-runtime": "6.x", "classnames": "2.x", @@ -12032,9 +12053,9 @@ } }, "rc-pagination": { - "version": "1.17.8", - "resolved": "https://registry.npmjs.org/rc-pagination/-/rc-pagination-1.17.8.tgz", - "integrity": "sha512-duEV+K/b/nZNGr943+TMCEcY4xWkjAkpKW0Vr7fSR8wQk0DY7aTJC+k+vjl4X2EzEmPXqy85hibzpsO9vydKAw==", + "version": "1.17.14", + "resolved": "https://registry.npmjs.org/rc-pagination/-/rc-pagination-1.17.14.tgz", + "integrity": "sha512-VnM0VQcXfw4vf30n2GnY8w44ZvjuuY1N8DvjbxDndTiNrX2vH+BFl4enC1yYIIdyv84jYfP8mWCEQZ+QscdY1A==", "requires": { "babel-runtime": "6.x", "prop-types": "^15.5.7", @@ -12081,9 +12102,9 @@ } }, "rc-slider": { - "version": "8.6.6", - "resolved": "https://registry.npmjs.org/rc-slider/-/rc-slider-8.6.6.tgz", - "integrity": "sha512-byfnq1LbBFyZ0HURWo22sjeiKIxLyzSnIiNUsUf6SWu1ZhQe/Qt24JnE/ZJsqKoUirXxlX+d577ptfAybZHm+Q==", + "version": "8.6.9", + "resolved": "https://registry.npmjs.org/rc-slider/-/rc-slider-8.6.9.tgz", + "integrity": "sha512-v5XwSARCyKGkalV7c54jwiuPNh8pGUg0i1opVD8YJVd8zQqbxepRoGmEE4xwRTxjR7Goao6/ARc7l2dGoPwZsg==", "requires": { "babel-runtime": "6.x", "classnames": "^2.2.5", @@ -12116,9 +12137,9 @@ } }, "rc-table": { - "version": "6.4.3", - "resolved": "https://registry.npmjs.org/rc-table/-/rc-table-6.4.3.tgz", - "integrity": "sha512-4/f7mS87EtNxM2vhIaA7I1J8hPZ5OiOQwmjac7RJTmGOFVA8PJDGwEipeyU/eC9RM7f3v4Lc+a05KCfIbRU4tg==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/rc-table/-/rc-table-6.5.0.tgz", + "integrity": "sha512-UXsoTcJIr5Ehyf1GXAKLcc5x0/+cOSgBaKL7wt6vmVEIW5CF6bVJj4iOr7P8LGdoez/omoHmr5GXcW6/AZxR7A==", "requires": { "babel-runtime": "6.x", "classnames": "^2.2.5", @@ -12143,9 +12164,9 @@ } }, "rc-tabs": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/rc-tabs/-/rc-tabs-9.6.1.tgz", - "integrity": "sha512-3/Ip9yCEERFFvCjU0ZoQqvn6unMo0XOQESygNLq1DyOAYRcukpq8Q28awpXWqh8l8NBcyw1sVfrs6SZN/zmAKg==", + "version": "9.6.3", + "resolved": "https://registry.npmjs.org/rc-tabs/-/rc-tabs-9.6.3.tgz", + "integrity": "sha512-f4GotOvzfzY4fqj/Y9Npt3pxyyHceyj06yss2uhNlAb+PW25tn22LxgGhhFVn2RyUXrt5WT26HPgtHx9R9sN3Q==", "requires": { "babel-runtime": "6.x", "classnames": "2.x", @@ -12155,6 +12176,7 @@ "raf": "^3.4.1", "rc-hammerjs": "~0.6.0", "rc-util": "^4.0.4", + "resize-observer-polyfill": "^1.5.1", "warning": "^3.0.0" }, "dependencies": { @@ -12169,9 +12191,9 @@ } }, "rc-time-picker": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/rc-time-picker/-/rc-time-picker-3.6.2.tgz", - "integrity": "sha512-SyGEVXO0ImeG2mz+7fkVmDoVM0+OrX6uYGpKYijNr/lAah7c5p310ZR6fVrblXOl4TpqVnfWR67RMJ3twAyM7w==", + "version": "3.6.4", + "resolved": "https://registry.npmjs.org/rc-time-picker/-/rc-time-picker-3.6.4.tgz", + "integrity": "sha512-ZINzzmP1+bvyPt3oamfFTc0vjkqm1B++lIYDZaTbtK5EHpTyAUnaa/ZSAJQ5p36Lbl7Uh9F/U2E3djhP7nkXcQ==", "requires": { "classnames": "2.x", "moment": "2.x", @@ -12190,9 +12212,9 @@ } }, "rc-tree": { - "version": "1.14.10", - "resolved": "https://registry.npmjs.org/rc-tree/-/rc-tree-1.14.10.tgz", - "integrity": "sha512-iOn7+SpWzM4OQoF/7wJeFiuRpBGJ3ndTe6YVGnfIhsWqDd7S6a7z0anDQcBpPsW/PvisjNDXr4zKchZvx+0iCA==", + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/rc-tree/-/rc-tree-1.15.2.tgz", + "integrity": "sha512-VPXLA/GdV6U9N8evpl4rmjRsBkw5BoweqWjcVBVwYGzBtonNIFpdc+bnb7TDmd6S3mKOM7mXPbiSr2GKYdj4hA==", "requires": { "babel-runtime": "^6.23.0", "classnames": "2.x", @@ -12229,9 +12251,9 @@ } }, "rc-tree-select": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/rc-tree-select/-/rc-tree-select-2.6.0.tgz", - "integrity": "sha512-9svioSjzqqGeIK9XTuM5yNe0WteSro2Hc8/Go+CTGth6P/mflVC7vC0jTJlFVpFz+Aw1LzXcJFsbAyRwUiSaag==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rc-tree-select/-/rc-tree-select-2.6.3.tgz", + "integrity": "sha512-FdOsEPe+1JkxE5+hBYV3qiImpRzZQvSlr0cCWMvCDtveukurhotJ6Dj7whDQhr71EJQrT9/OxEPaINm8reHYJw==", "requires": { "classnames": "^2.2.1", "dom-scroll-into-view": "^1.2.1", @@ -12261,30 +12283,6 @@ "react-lifecycles-compat": "^3.0.4" } }, - "rc-tree": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/rc-tree/-/rc-tree-1.15.2.tgz", - "integrity": "sha512-VPXLA/GdV6U9N8evpl4rmjRsBkw5BoweqWjcVBVwYGzBtonNIFpdc+bnb7TDmd6S3mKOM7mXPbiSr2GKYdj4hA==", - "requires": { - "babel-runtime": "^6.23.0", - "classnames": "2.x", - "prop-types": "^15.5.8", - "rc-animate": "^3.0.0-rc.5", - "rc-util": "^4.5.1", - "react-lifecycles-compat": "^3.0.4", - "warning": "^3.0.0" - }, - "dependencies": { - "warning": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/warning/-/warning-3.0.0.tgz", - "integrity": "sha1-MuU3fLVy3kqwR1O9+IIcAe1gW3w=", - "requires": { - "loose-envify": "^1.0.0" - } - } - } - }, "rc-trigger": { "version": "3.0.0-rc.3", "resolved": "https://registry.npmjs.org/rc-trigger/-/rc-trigger-3.0.0-rc.3.tgz", @@ -14192,9 +14190,9 @@ "dev": true }, "ua-parser-js": { - "version": "0.7.18", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.18.tgz", - "integrity": "sha512-LtzwHlVHwFGTptfNSgezHp7WUlwiqb0gA9AALRbKaERfxwJoiX0A73QbTToxteIAuIaFshhgIZfqK8s7clqgnA==" + "version": "0.7.19", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.19.tgz", + "integrity": "sha512-T3PVJ6uz8i0HzPxOF9SWzWAlfN/DavlpQqepn22xgve/5QecC+XMCAtmUNnY7C9StehaV6exjUCI801lOI7QlQ==" }, "uglify-js": { "version": "3.3.28", @@ -14621,9 +14619,9 @@ } }, "webpack-bundle-analyzer": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-3.1.0.tgz", - "integrity": "sha512-nyDyWEs7C6DZlgvu1pR1zzJfIWSiGPbtaByZr8q+Fd2xp70FuM/8ngCJzj3Er1TYRLSFmp1F1OInbEm4DZH8NA==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-3.3.2.tgz", + "integrity": "sha512-7qvJLPKB4rRWZGjVp5U1KEjwutbDHSKboAl0IfafnrdXMrgC0tOtZbQD6Rw0u4cmpgRN4O02Fc0t8eAT+FgGzA==", "dev": true, "requires": { "acorn": "^6.0.7", @@ -14668,9 +14666,9 @@ } }, "commander": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", "dev": true }, "supports-color": { @@ -14683,9 +14681,9 @@ } }, "ws": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.0.tgz", - "integrity": "sha512-deZYUNlt2O4buFCa3t5bKLf8A7FPP/TVjwOeVNpw818Ma5nk4MLXls2eoEGS39o8119QIYxTrTDoPQ5B/gTD6w==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", + "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", "dev": true, "requires": { "async-limiter": "~1.0.0" @@ -15022,9 +15020,9 @@ } }, "whatwg-fetch": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", - "integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz", + "integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==" }, "whatwg-mimetype": { "version": "2.1.0", diff --git a/package.json b/package.json index fbdc948..93d46b6 100644 --- a/package.json +++ b/package.json @@ -10,15 +10,14 @@ }, "bugs": "https://github.com/ChuckJonas/bad-ass-salesforce-stack/issues", "license": "MIT", - "main": "dist/app.js", "config": { "resource": "app", - "port": 8080, - "TS_NODE_PROJECT": "config/webpack.tsconfig.json" + "package_path": "./force-app/main/default", + "port": 8080 }, "scripts": { "start": "npm run setup-ts-webpack -- webpack-dev-server --config config/webpack.config.ts --hot --https", - "setup-ts-webpack": "cross-env TS_NODE_PROJECT=$npm_package_config_TS_NODE_PROJECT", + "setup-ts-webpack": "cross-env TS_NODE_PROJECT=config/webpack.tsconfig.json", "clean": "rimraf dist", "compile": "npm run clean && npm run setup-ts-webpack -- webpack --config config/webpack.config.ts --env.build --env.resource $npm_package_config_resource", "compile-dev": "npm run compile", @@ -27,9 +26,9 @@ "new-scratch-org": "sfdx force:org:create -f config/project-scratch-def.json -a $npm_config_scratch_alias", "bundle-app-dev": "npm run compile-dev && npm run copy-bundle", "bundle-app-prod": "npm run compile-prod && npm run copy-bundle", - "zip-bundle": "zip -r ./force-app/main/default/staticresources/app.zip ./dist", - "copy-resource-meta": "cp ./config/build-assets/temp.resource-meta.xml ./force-app/main/default/staticresources/$npm_package_config_resource.resource-meta.xml", - "copy-bundle": "rimraf ./force-app/main/default/staticresources/* || true && npm run zip-bundle && mv ./force-app/main/default/staticresources/app.zip ./force-app/main/default/staticresources/$npm_package_config_resource.resource && npm run copy-resource-meta", + "zip-bundle": "zip -r $npm_package_config_package_path/staticresources/app.zip ./dist", + "copy-resource-meta": "cp ./config/build-assets/temp.resource-meta.xml $npm_package_config_package_path/staticresources/$npm_package_config_resource.resource-meta.xml", + "copy-bundle": "rimraf $npm_package_config_package_path/staticresources/* || true && npm run zip-bundle && mv $npm_package_config_package_path/staticresources/app.zip $npm_package_config_package_path/staticresources/$npm_package_config_resource.resource && npm run copy-resource-meta", "package-sfdc": "sfdx force:source:convert -d ./dist/sfdc-package", "build-dev": "npm run bundle-app-dev && npm run package-sfdc", "build-prod": "npm run bundle-app-prod && npm run package-sfdc", @@ -37,15 +36,15 @@ "push-scratch": "sfdx force:source:push -u $npm_config_scratch_alias", "push-prod": "sfdx force:mdapi:deploy -u $npm_config_prod_alias -d ./dist/sfdc-package -w 10000", "deploy-dev": "npm run build-dev && npm run push-dev", - "deploy-scratch": "npm run build-dev && npm run push-scratch", + "deploy-scratch": "npm run bundle-app-dev && npm run push-scratch", "deploy-prod": "npm run build-prod && npm run push-prod", "generate-ts-force": "ts-force-gen -j ./config/ts-force-config.json", "test": "jest --no-cache --config ./config/jest.json", "test:update": "jest --no-cache --config jest.json -u", - "reinstall": "rimraf node_modules && npm install" + "reinstall": "rimraf node_modules dist && npm install" }, "dependencies": { - "antd": "^3.15.0", + "antd": "^3.16.4", "babel-polyfill": "^6.26.0", "react": "^16.8.4", "react-dom": "^16.8.4", @@ -95,7 +94,7 @@ "tslint-react": "^3.6.0", "typescript": "^3.3.3", "webpack": "^4.29.6", - "webpack-bundle-analyzer": "^3.1.0", + "webpack-bundle-analyzer": "^3.3.2", "webpack-cli": "^3.2.3", "webpack-dev-server": "^3.2.1" } diff --git a/tsconfig.json b/tsconfig.json index f22c985..08f2a0d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,7 @@ "baseUrl": "./", // enables relative imports to root "paths": { "@src/*": [ - "src/*" + "app/*" ] }, "outDir": "out/", // target for compiled files @@ -37,7 +37,7 @@ "sourceMap": true }, "include": [ - "src/**/*" + "app/**/*" ], "exclude": [ "node_modules",