1.0.6 • Published 2 years ago

@websaam/sdk-ts-starter v1.0.6

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

A boilerplate to start create a Typescript SDK

Getting started

npx @websaam/sdk-ts-starter my-ts-sdk

Installation

  1. Run yarn

  2. Change your configs in esbuild-config.js

  3. Change your package name in package.json, rename @websaam/sdk-ts-starter to anything you want

HTML

devHtml: Listens to Typescript file changes from src, and output to src_build_from_ts, which is also being listend and built to ./build/web/index.js. Finally, run a live server on localhost:3000

Open tests/html/html-test.html to edit

<script src="/build/web/index.js"></script>
<script>
    console.log("ExampleSDK:", ExampleSDK);
    ExampleSDK.foo();
</script>

React

devReact: Listens to Typescript file changes from src, and output to src_build_from_ts, which is also being listend and built to ./build/node/index.js. Finally, run React app on localhost:3000

// 1. Download React
yarn getReact

// 2. Build the SDK for both client/node, and publish locally using yalc
yarn build

// 3. Go to the React app and link the local published sdk (change the name of the package name `@websaam/sdk-ts-starter` to something you desired)
yarn linkReact

// 4. In the App.js
import * as ExampleSDK from '@websaam/sdk-ts-starter';
ExampleSDK.hello();
1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago