Project has 3 different modes:
- Standalone, minified browser build (usable directly using <script> tag - exposes "ordercitySDK" global variable on the window object)
- Production npm build - available from npm registry using
npm install ordercity-sdk
- default export is theordercitySDK
variable - Development build - using only for development, more details below
npm run dev
- Starts the project in development mode:
SDK is already cofigured for development: webpack hot reload, API credentials, shopkey for testing shop, debug mode is on
Go to localhost:4000
, open console, and test the SDK (e.g. ordercitySDK.getCategories({}).then(console.log)
)
Build should be hosted on CDN77 cdn.
When we make a new SDK version, we have to do several things:
- Increment package version in package.json, according to semantic versioning (major/minor/patch)
- Publish this new version to npm
- Build project (for different environments,
npm run build:<env>
) - Deploy to firebase CDN77 hosting
Test: rsync -va ./dist/test/ user_qwe84qu1@push-20.cdn77.com:/www/sdk pw: 12j1z7kKzidt46bTlGQ0
Live: rsync -va ./dist/live/ user_xvfke1n1@push-20.cdn77.com:/www/sdk pw: 452nr8CHUhoGL9Di5AY0
Stage: rsync -va ./dist/stage/ user_q4rbi75g@push-20.cdn77.com:/www/sdk pw: r7OybSWl9Y9DsCxj8h3n