Skip to content

Commit 9726d9f

Browse files
committed
all: Initial code drop (1.0.0 beta 1)
0 parents  commit 9726d9f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+15580
-0
lines changed

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
.yarn
3+
build

.eslintrc.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"plugins": ["@typescript-eslint", "prettier", "simple-import-sort"],
4+
"extends": [
5+
"eslint:recommended",
6+
"plugin:@typescript-eslint/eslint-recommended",
7+
"plugin:@typescript-eslint/recommended",
8+
"prettier/@typescript-eslint",
9+
"plugin:prettier/recommended"
10+
],
11+
"rules": {
12+
"no-console": 0,
13+
"prefer-template": "off",
14+
"lines-between-class-members": "off",
15+
"prefer-destructuring": "off",
16+
"sort-imports": "off", // Disable builtin sort import
17+
"simple-import-sort/imports": "warn",
18+
"@typescript-eslint/explicit-function-return-type": ["warn", { "allowExpressions": true }],
19+
"@typescript-eslint/explicit-member-accessibility": "error",
20+
"@typescript-eslint/no-inferrable-types": ["error", { "ignoreParameters": true, "ignoreProperties": true }],
21+
"@typescript-eslint/no-explicit-any": ["warn", { "fixToUnknown": true }],
22+
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
23+
"@typescript-eslint/naming-convention": [
24+
"error",
25+
{
26+
"selector": "interface",
27+
"format": ["PascalCase"],
28+
"custom": {
29+
"regex": "^I[A-Z]",
30+
"match": false
31+
}
32+
}
33+
], // Disable "interfaces should begin with I"
34+
"prettier/prettier": "warn"
35+
}
36+
}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build
2+
node_modules
3+
.DS_Store
4+
coverage

.gitlab-ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
stages:
2+
- test
3+
4+
after_script:
5+
- docker-compose -p $CI_COMMIT_REF_SLUG down
6+
7+
build_and_test:
8+
stage: test
9+
script:
10+
- docker-compose -p $CI_COMMIT_REF_SLUG pull --ignore-pull-failures
11+
- docker-compose -p $CI_COMMIT_REF_SLUG build --pull base
12+
- docker-compose -p $CI_COMMIT_REF_SLUG run tests

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/Project.xml

Lines changed: 58 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inapp-javascript-sdk.iml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/jsLibraryMappings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/prettier.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/All_Tests.xml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/build.xml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"trailingComma": "es5",
3+
"printWidth": 100
4+
}

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib",
3+
"typescript.enablePromptUseWorkspaceTsdk": true
4+
}

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM node:15-buster
2+
3+
LABEL MAINTAINER="@arnaud <[email protected]>"
4+
LABEL DESCRIPTION="Batch In-App Webview SDK Build Image"
5+
6+
WORKDIR /src
7+
8+
COPY package.json /src/package.json
9+
COPY package-lock.json /src/package-lock.json
10+
11+
RUN npm install
12+
13+
COPY . /src

LICENSE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Copyright (c) 2014-Present, Batch.com
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
- Use of copies, substantial portions or binaries contained within Batch's SDK is only permitted to enable use of the Batch platform.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Batch In-App WebView SDK
2+
3+
4+
# Integrating the SDK into your web page
5+
6+
TODO
7+
8+
# Developing the SDK
9+
10+
Files are located in "src" and are built in "build".
11+
12+
src is typescript that compiles to ES5. Be careful about runtime dependencies, as Typescript doesn't polyfill them.
13+
14+
It's a standard typescript project so use your favourite editor. The repository comes preconfigured for IntelliJ (Webstorm/Phpstorm/Ultimate)
15+
and VSCode.
16+
17+
Your editor should have an eslint plugin enabled. Formatting will be handled via prettier.
18+
19+
# Build the SDK
20+
21+
```
22+
npm run build-minified
23+
```
24+
25+
26+
This will output `build/batch-webview-sdk.min.js`
27+
28+
# Serve it
29+
30+
`npm run serve`
31+
32+
This will serve the SDK on port 9094.
33+
A devkit will also be available on http://localhost:9094
34+
35+
Note: This expects you to have built the SDK using `npm run build-minified`.
36+
37+
# Watch
38+
39+
```
40+
npm run watch
41+
```
42+
43+
Combines build & serve, will automatically rebuild the SDK when changes occur.

0 commit comments

Comments
 (0)