Skip to content

Commit

Permalink
Merge pull request #110 from cloudnode-pro/not-sdk
Browse files Browse the repository at this point in the history
Remove any mention of SDK
  • Loading branch information
zefir-git authored Sep 1, 2023
2 parents 1eb98c5 + 60befb8 commit 6a9f378
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ console.log(newsletter._response.status); // 200
#### Browser
Download the browser version from `browser/{{config.name}}.js` or use our hosted version.
```html
<script src="{{{config.browserSdkUrl}}}"></script>
<script src="{{{config.browserUrl}}}"></script>
<script>
const {{config.instanceName}} = new {{config.name}}();
Expand Down
4 changes: 2 additions & 2 deletions gen/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface Config {
apiVersion: string;

/**
* Link to hosted browser SDK
* Link to hosted browser version
*/
browserSdkUrl: string;
browserUrl: string;
}
4 changes: 2 additions & 2 deletions gen/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {Config} from "./Config";
import {minify} from "terser";
import assert from "assert";

// create a browser-compatible SDK
export async function createBrowserSDK(config: Config): Promise<void> {
// create a browser-compatible version
export async function createBrowser(config: Config): Promise<void> {
const mainJs = await fs.readFile(path.join("src", config.name + ".js"), "utf-8");
// remove imports at beginning of file and export default at end of file
const browserJs = mainJs.replace(/^import.*$/gm, "").replace(/^export default \w+;$/gm, "");
Expand Down
6 changes: 3 additions & 3 deletions gen/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Package from "./Package";
import {addExtraReturns} from "./util.js";
import * as child_process from "child_process";
import {promisify} from "util";
import {createBrowserSDK} from "./browser.js";
import {createBrowser} from "./browser.js";

// load `/schema.json`
const schema: Schema = addExtraReturns(JSON.parse(await fs.readFile("schema.json", "utf8")));
Expand All @@ -34,8 +34,8 @@ await source(schema, config, pkg);
// build
await promisify(child_process.exec)("npm run build");

// generate browser SDK
await createBrowserSDK(config);
// generate browser version
await createBrowser(config);

// generate doc schema
const docSchema = await generateDocSchema(schema, config, pkg);
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"keywords": [
"cloudnode",
"api",
"sdk",
"client"
"client",
"library"
],
"author": "Cloudnode",
"license": "GPL-3.0",
Expand Down

0 comments on commit 6a9f378

Please sign in to comment.