- starter for write a SDK, like the facebook SDK.
- result will be one .js file and which bootstrap itself after call init() method.
- To build you need to run
npm run build - SDK will be placed in
dist - To start project run
npm run start
npm run build- take something.sdk.js file from
/distfolder - add this two line in html of your site
<div id="sdk-something"></div>
<script src="./something.sdk.js"></script>- SDK will be initialized in
<div id="sdk-something"></div>after call javascript functionSomethingSDK.init()from anywhere
-
write your library name in webpack.config.js file, for every global functions. E.g.
SomethingSDK.init()module.exports = { ....... output: { ....... library: 'SomethingSDK' }, ........ }
-
export everything from SomethingSDK.ts, what you want to access globally
-
write styles (
.css,.scss,sass) in style folder -
every visually element extends component class
-
RouterService singleton class used for navigation between pages
-
Core class connects services, components and router each other