Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d5c7c2f
Bump extend from 3.0.1 to 3.0.2
dependabot[bot] Nov 2, 2019
129964f
Bump mixin-deep from 1.3.1 to 1.3.2
dependabot[bot] Nov 2, 2019
4e50452
Bump acorn from 5.7.1 to 5.7.4
dependabot[bot] Mar 13, 2020
cf1292a
Bump websocket-extensions from 0.1.3 to 0.1.4
dependabot[bot] Jun 6, 2020
26300e7
Bump http-proxy from 1.17.0 to 1.18.1
dependabot[bot] Sep 5, 2020
516d316
Bump ini from 1.3.5 to 1.3.8
dependabot[bot] Dec 11, 2020
3ad5e18
Bump elliptic from 6.4.1 to 6.5.4
dependabot[bot] Mar 8, 2021
a1e4b39
Bump y18n from 3.2.1 to 4.0.1
dependabot[bot] Mar 29, 2021
2e8f494
Bump ssri from 6.0.1 to 6.0.2
dependabot[bot] Apr 19, 2021
42b8552
Bump ua-parser-js from 0.7.19 to 0.7.28
dependabot[bot] May 6, 2021
8d8a824
Bump handlebars from 4.1.2 to 4.7.7
dependabot[bot] May 6, 2021
19e065d
Bump url-parse from 1.4.4 to 1.5.1
dependabot[bot] May 6, 2021
5cb9bba
Bump lodash from 4.17.11 to 4.17.21
dependabot[bot] May 6, 2021
3048d46
Bump hosted-git-info from 2.6.0 to 2.8.9
dependabot[bot] May 9, 2021
49f3a63
Bump browserslist from 4.7.2 to 4.16.6
dependabot[bot] May 24, 2021
b6dc721
Bump dns-packet from 1.3.1 to 1.3.4
dependabot[bot] May 26, 2021
bf0a724
Bump postcss from 7.0.14 to 7.0.36
dependabot[bot] Jun 15, 2021
4318078
Adds some dependencies to package.json
jakehebert-CCC Sep 13, 2021
a5e8f0b
Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/postcss-…
jakehebert-CCC Sep 13, 2021
53bdc55
dns-packet to 1.3.4
jakehebert-CCC Sep 13, 2021
2ed8fa0
browserslist to 4.16.6
jakehebert-CCC Sep 13, 2021
fce411a
bump lodash 4.17.21
jakehebert-CCC Sep 13, 2021
8f4837d
hosted-git-info to 2.8.9
jakehebert-CCC Sep 13, 2021
f9f546c
url parse to 1.5.1
jakehebert-CCC Sep 13, 2021
c59304f
hendlebars to 4.7.7
jakehebert-CCC Sep 13, 2021
d4fad72
bump ua-parser-js to 0.7.28
jakehebert-CCC Sep 13, 2021
becb56e
bump ssri to 6.0.2
jakehebert-CCC Sep 13, 2021
51d05e1
bump y18n to 4.0.1
jakehebert-CCC Sep 13, 2021
ba67ead
bump elliptic to 6.5.4
jakehebert-CCC Sep 13, 2021
fffea09
bump ini to 1.3.8
jakehebert-CCC Sep 13, 2021
da4a722
bump http-proxy to 1.18.1
jakehebert-CCC Sep 13, 2021
f8450a5
bump websocket-extensions to 0.1.4
jakehebert-CCC Sep 13, 2021
2b2591e
Bump acorn to 5.7.4
jakehebert-CCC Sep 13, 2021
49de32d
bump extend to 3.0.2
jakehebert-CCC Sep 13, 2021
4e40ebc
bump mixin-deep to 1.3.2
jakehebert-CCC Sep 13, 2021
0de8af8
remove path from Charlie's computer
jakehebert-CCC Sep 13, 2021
d53202f
remove fsevents node package
jakehebert-CCC Sep 13, 2021
e12dc0d
WIP
jakehebert-CCC Sep 17, 2021
01b41f4
Remove file-loader
jakehebert-CCC Sep 21, 2021
8dea016
Update readmes
jakehebert-CCC Sep 21, 2021
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@
},
"terminal.integrated.env.windows": {
"SFDX_SET_CLIENT_IDS": "sfdx-vscode"
},
"eslint.nodePath": "/Users/jonas/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-45.5.0/node_modules"
}
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ prod_alias=john@acme.com

## 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.
2. run `npm start`
3. Enable the `Allow Insecure Localhost` setting in chrome (chrome://flags/#allow-insecure-localhost). If you don't want to enable this, or use a different browser, you can create your own self-signed certificate by following [these instructions](https://github.com/ChuckJonas/bad-ass-salesforce-stack/blob/master/config/cert/readme.md).
1. Create your own self-signed certificate by following [these instructions](https://github.com/ChuckJonas/bad-ass-salesforce-stack/blob/master/config/cert/readme.md). (This only needs to be done once)
2. 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.
3. run `npm start`
4. navigate to your page in salesforce: EG: `/apex/app`
5. append `?local=1` to page query string
6. Start coding. Your app will automatically update as you save changes.
Expand Down
56 changes: 35 additions & 21 deletions app/app.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import { Card, Drawer, Button } from 'antd';
import { hot } from 'react-hot-loader'; // needs to be before react!
import * as React from 'react';
import { Account } from '@src/generated';
import { Card, Drawer, Button } from "antd";
import { hot } from "react-hot-loader"; // needs to be before react!
import * as React from "react";
import { Account } from "@src/generated";

// example use of file loader to load image
import bassLogo from '@src/assets/images/bass-logo.jpg';
import bassLogo from "@src/assets/images/bass-logo.jpg";

interface AppState {
acc: Account;
drawerVisible: boolean;
}

class App extends React.Component<{}, AppState> {

constructor(props: any) {
super(props);
this.state = {
Expand All @@ -26,10 +25,10 @@ class App extends React.Component<{}, AppState> {
const accs = await Account.retrieve((fields) => {
return {
select: [
...fields.select('id', 'name', 'website'),
fields.subQuery('contacts', (cFields) => {
...fields.select("id", "name", "website"),
fields.subQuery("contacts", (cFields) => {
return {
select: cFields.select('id', 'name', 'email', 'phone'),
select: cFields.select("id", "name", "email", "phone"),
};
}),
],
Expand All @@ -43,18 +42,23 @@ class App extends React.Component<{}, AppState> {

public render() {
return (
<Card title='B.A.S.S.'>
<Card title="B.A.S.S.">
<Drawer
visible={this.state.drawerVisible}
onClose={() => this.setState({drawerVisible: false})}
title='An Account'
onClose={() => this.setState({ drawerVisible: false })}
title="An Account"
width={600}
>
{this.state.acc && this.renderDrawerContent()}
</Drawer>
<img width={300} src={bassLogo} />
<br />
<Button type='primary' onClick={() => this.setState({drawerVisible: true})}>Click Me!</Button>
<Button
type="primary"
onClick={() => this.setState({ drawerVisible: true })}
>
Click Me!
</Button>
</Card>
);
}
Expand All @@ -64,23 +68,33 @@ class App extends React.Component<{}, AppState> {

const contactsList = acc.contacts.map((c) => {
return (
<Card type='inner' key={c.id}>
<p><b>Name:</b> {c.name}</p>
<p><b>Email:</b> {c.email}</p>
<p><b>Phone:</b> {c.phone}</p>
<Card type="inner" key={c.id}>
<p>
<b>Name:</b> {c.name}
</p>
<p>
<b>Email:</b> {c.email}
</p>
<p>
<b>Phone:</b> {c.phone}
</p>
</Card>
);
});
return (
<div>
<p><b>Name:</b> {acc.name}</p>
<p><b>Website:</b> {acc.website}</p>
<Card title='Contacts' extra={acc.contacts.length}>
<p>
<b>Name:</b> {acc.name}
</p>
<p>
<b>Website:</b> {acc.website}
</p>
<Card title="Contacts" extra={acc.contacts.length}>
{contactsList}
</Card>
</div>
);
}
};
}

export default hot(module)(App);
2 changes: 1 addition & 1 deletion app/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ interface System {
}
declare var System: System;

//allow importing of files with file-loader
//declare any necessary imported file types
declare module '*.png'
declare module '*.jpg'
49 changes: 28 additions & 21 deletions config/babelrc.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
{
"presets": [
"@babel/env",
"@babel/typescript",
"@babel/react"

],
"plugins": [
["@babel/plugin-proposal-decorators", { "legacy": true }],
["react-hot-loader/babel"],
[
"import",
{
"libraryName": "antd",
"style": true,
"libraryDirectory": "es"
}
],
["@babel/plugin-proposal-class-properties", { "loose": true }],
["@babel/proposal-object-rest-spread"]
]
}
"presets": [
"@babel/env",
"@babel/typescript",
"@babel/react"
],
"plugins": [
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
[
"react-hot-loader/babel"
],
[
"import",
{
"libraryName": "antd",
"style": true,
"libraryDirectory": "es"
}
],
[
"@babel/proposal-object-rest-spread"
]
]
}
6 changes: 3 additions & 3 deletions config/cert/readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Trusting Localhost

For cases where you cannot `Allow Insecure Localhost` (or aren't using chrome):
These steps allow your computer to trust the app we are displaying from localhost:

1. run `openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes -keyout ./config/cert/server.key -out ./config/cert/server.crt -extensions san -config ./config/cert/dev.conf`
2. in "package.json" update the `npm start` with `--cert ./config/cert/server.crt --key ./config/cert/server.key`
3. install the newly created cert `config/cert/server.crt` in [keychain and set trust to "Always"](https://www.youtube.com/watch?v=TGrX8XgSuZ4)
2. in "package.json" update the `npm start` with `--cert ./config/cert/server.crt --key ./config/cert/server.key`
3. install the newly created cert `config/cert/server.crt` in [keychain and set trust to "Always"](https://www.youtube.com/watch?v=TGrX8XgSuZ4)
40 changes: 11 additions & 29 deletions config/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,18 @@ module.exports = (env: any = {}) => {

const devServer: webpackDevServer.Configuration = {
historyApiFallback: true,
overlay: true,
port: PORT,
headers: { // enable CORS
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
'Access-Control-Allow-Headers': 'X-Requested-With, content-type, Authorization',
},
disableHostCheck: true,
};

const config: webpack.Configuration = {
mode,
cache: true,
devtool: isBuild ? 'source-map' : 'source-map',
devServer,
context: PATHS.root,
entry: {
app: [
Expand Down Expand Up @@ -116,13 +113,13 @@ module.exports = (env: any = {}) => {
use: [
{ loader: 'style-loader' },
{ loader: 'css-loader' },
{
loader: 'less-loader',
{loader: 'less-loader',
options: {
modifyVars: themeVariables,
javascriptEnabled: true,
},
},
lessOptions:{
javascriptEnabled: true,
modifyVars: themeVariables,
}
}},
],
},
// json
Expand All @@ -133,27 +130,15 @@ module.exports = (env: any = {}) => {
},
// images
{
test: /\.(jpg|jpeg|png|gif|svg)$/,
test: /\.(png|svg|jpg|jpeg|gif)$/i,
type: 'asset/resource',
include: [PATHS.assets],
use: {
loader: 'file-loader',
options: {
name: '[path][hash].[ext]',
},
},
},
// fonts
{
test: /\.(woff|woff2|ttf|eot)$/,
include: [
PATHS.assets,
],
use: {
loader: 'file-loader',
options: {
name: 'fonts/[name].[hash].[ext]',
},
},
test: /\.(woff|woff2|eot|ttf|otf)$/i,
type: 'asset/resource',
include: [PATHS.assets],
},
],
},
Expand All @@ -163,9 +148,6 @@ module.exports = (env: any = {}) => {
...[
new webpack.DefinePlugin(GLOBAL_DEFINES),
],
...(!isBuild ? [
new webpack.NamedModulesPlugin(),
] : []),
...(isProd ? [
// put production optimization plugins here
] : []),
Expand Down
Loading