chuckjonas / bad-ass-salesforce-stack Goto Github PK
View Code? Open in Web Editor NEWB.A.S.S. Starter: react / redux / typescript / antd / ts-force / sfdx / webpack / salesforce
B.A.S.S. Starter: react / redux / typescript / antd / ts-force / sfdx / webpack / salesforce
When the VF page is loaded into lightning, the request stop working because the app is using ?isdtp=p1
gets to the instance url __RESTHOST__
.
Fix: update the header to remove extra junk:
const __RESTHOST__ = '{!URLFOR("/", null)}'.replace("?isdtp=p1", "");
Might want to come up with a more robust solution as there might be other URL param/values that get appended
Long over due... The build script have many OSX specific commands.
OSX commands to refactor:
Might just make sense to create a npm build tool to help
Right now bass is just packaging app.js & vendors.js... Fix this to allow adding all other assets
could run both local typescript tests as well as any SF unit tests with SFDX
Steps to reproduce
npm install
npm run deploy-dev
Expected Outcome
Actual Outcome
NPM Log: https://gist.github.com/ralphcallaway/bfd6313c319fbe12d32f47b89284f5a2
Console Log
➜ devBASS git:(master) ✗ npm run deploy-prod
> [email protected] deploy-prod /Users/ralphcallaway/Documents/eclipse 3.7/devBASS
> npm run build-prod && npm run push-prod
> [email protected] build-prod /Users/ralphcallaway/Documents/eclipse 3.7/devBASS
> npm run bundle-app-prod && npm run package-sfdc
> [email protected] bundle-app-prod /Users/ralphcallaway/Documents/eclipse 3.7/devBASS
> webpack run compile-prod && npm run copy-bundle
Hash: 5d2e1eb09050b2f0c2f2
Version: webpack 3.6.0
Time: 43ms
ERROR in Entry module not found: Error: Can't resolve 'run' in '/Users/ralphcallaway/Documents/eclipse 3.7/devBASS'
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] bundle-app-prod: `webpack run compile-prod && npm run copy-bundle`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] bundle-app-prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/ralphcallaway/.npm/_logs/2017-12-26T19_35_50_827Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build-prod: `npm run bundle-app-prod && npm run package-sfdc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build-prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/ralphcallaway/.npm/_logs/2017-12-26T19_35_50_850Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] deploy-prod: `npm run build-prod && npm run push-prod`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] deploy-prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/ralphcallaway/.npm/_logs/2017-12-26T19_35_50_872Z-debug.log
Currently you have to rename it in multiple places... Would be ideal if it was possible to just rename it in one place (maybe .npmrc
?) and have the build configuration take care of the rest
Instead of maintaining separate branches, could be cool to just add a boiler-room-custodian config which resets the project.
Would maybe still want separate branch for redux
Should be more stable
Currently the page & static resource are defaulted to App
. If you want to rename this you manually need to update the build-scripts
& the force-app
meta-data. Would be nice if there was a script to do this to make it less error prone.
I set up a project and on running npm run deploy-dev I received the following error:
rimraf dist
node_modules/antd/es/notification/PurePanel.d.ts:25:16 - error TS2304: Cannot find name 'PurePanel'.
25 export default PurePanel;
~~~~~~~~~
Found 1 error in node_modules/antd/es/notification/PurePanel.d.ts:25
I forced the package to downgrade to 5.2.3 and the error went away. I think maybe the package needs to be fixed to this version until the issue with antd is resolved.
Andy
This makes much more sense as your "source" is really contained in both the force-app
and the react application. react-app
might even be a better name, but then if someone were to port this to an angular application (which wouldn't be hard to do), they would have an additional set of paths to update.
Hi guys, I base on this project to mount my react app directly inside of the VF page. But the problem is that I need to add the
<script type="text/javascript">
const __ACCESSTOKEN__ = '{!$Api.Session_ID}';
</script>
If I put the __ACCESSTOKEN here, my app will not pass the security check to public my package to AppExchange. Do you have any solutions for it? Thanks for your help.
Webpack failures when trying to run npm run build
(will add more details)
this is a bit of an issue... could end up deploying stuff to the wrong place if you have multiple projects. Need to figure out a better way to manage build script targets
Currently production build is using the same settings as dev environment. Should probably optimize react and potentially source maps?
need to add asset mock for jest
Hi, could you add as part of the setup process the instructions to generate the Salesforce Object classes please.
npm run generate-ts-force
It wasn't obvious to me until a bit of digging, so it might be useful to add it.
Thanks
Andy
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.