Skip to content

Commit 890b0f3

Browse files
author
Rodrigo Gomez Palacio
authored
Merge pull request #73 from OneSignal/repo-maintenance
Repo maintenance
2 parents 71daab1 + d0aa126 commit 890b0f3

File tree

13 files changed

+386
-200
lines changed

13 files changed

+386
-200
lines changed
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: 🙋‍♂️ Ask a question
2+
description: Tell us what's on your mind
3+
title: '[question]: '
4+
labels: ['question']
5+
body:
6+
- type: textarea
7+
id: question
8+
attributes:
9+
label: How can we help?
10+
description: Specific question regarding integrating this code generator.
11+
placeholder: How do I...?
12+
validations:
13+
required: true

.github/ISSUE_TEMPLATE/bug-report.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: 🪳 Bug report
2+
description: File a bug report
3+
title: '[Bug]: '
4+
labels: ['bug', 'triage']
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for taking the time to fill out this bug report!
10+
- type: textarea
11+
id: what-happened
12+
attributes:
13+
label: What happened?
14+
description: Provide a thorough description of whats going on.
15+
placeholder: e.g. The types need to be updated
16+
validations:
17+
required: true
18+
- type: textarea
19+
id: reproduction-steps
20+
attributes:
21+
label: Steps to reproduce?
22+
description: Provide as much detail as posible to reproduce the issue.
23+
placeholder: |
24+
1. Modify file X
25+
2. Run script Y
26+
render: Markdown
27+
validations:
28+
required: true
29+
- type: textarea
30+
id: what-are-expectations
31+
attributes:
32+
label: What did you expect to happen?
33+
description: Also tell us, what did you expect to happen?
34+
placeholder: I expected the code to generate
35+
validations:
36+
required: true
37+
- type: textarea
38+
id: logs
39+
attributes:
40+
label: Relevant log output
41+
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
42+
render: Shell

LICENSE

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Modified MIT License
2+
3+
Copyright 2024 OneSignal
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
1. The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
2. All copies of substantial portions of the Software may only be used in connection
16+
with services provided by OneSignal.
17+
18+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
THE SOFTWARE.

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"name": "web-shim-codegen",
3-
"version": "2.0.0",
3+
"version": "3.0.1",
44
"description": "Used to build Web SDK libraries for various web frameworks",
55
"main": "index.js",
66
"scripts": {
77
"lint": "yarn run eslint . --ext .ts",
88
"test": "echo \"Error: no test specified\" && exit 1",
99
"build": "./scripts/build"
1010
},
11-
"keywords": [],
12-
"author": "",
13-
"license": "ISC",
11+
"keywords": ["web", "sdk", "codegen"],
12+
"author": "Rodrigo Gomez-Palacio",
13+
"license": "MIT",
1414
"devDependencies": {
1515
"@types/node": "^18.15.0",
1616
"@typescript-eslint/eslint-plugin": "^5.54.0",

src/managers/TypingsWriterManager.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ import {
1717
SLIDEDOWN_EVENT_NAME,
1818
SLIDEDOWN_OPTIONS,
1919
SUBSCRIPTION_CHANGE_EVENT,
20-
TAG_CATEGORY } from "../snippets/types";
20+
TAG_CATEGORY,
21+
USER_CHANGE_EVENT,
22+
USER_NAMESPACE_PROPERTIES} from "../snippets/types";
2123
import { INTERFACE_PREFIX } from "../support/constants";
2224
import { ReaderManager } from "./ReaderManager";
2325

@@ -96,6 +98,8 @@ export class TypingsWriterManager extends CodeWriter {
9698
this.writeLine(prefix+NOTIFICATION_FOREGROUND_WILL_DISPLAY_EVENT);
9799
this.writeLine(prefix+NOTIFICATION_DISMISS_EVENT);
98100
this.writeLine(prefix+NOTIFICATION_CLICK_EVENT);
101+
this.writeLine(prefix+USER_CHANGE_EVENT);
102+
this.writeLine(prefix+USER_NAMESPACE_PROPERTIES);
99103
this.writeLine();
100104
this.writeLine(initObjectInterfaceContents);
101105
}

src/managers/bases/OneSignalWriterManagerBase.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ const PARENT_PATH_FOR_NAMESPACE_MAP: { [key: string]: string } = {
3030
};
3131

3232
const PROPERTY_DEFAULT_MAP: { [key: string]: string } = {
33-
permissionNative: ` ?? 'default';`,
34-
permission: ` ?? false;`
33+
permissionNative: ` ?? 'default'`,
34+
permission: ` ?? false`
3535
};
3636

3737
export abstract class OneSignalWriterManagerBase extends CodeWriter {
@@ -86,7 +86,7 @@ export abstract class OneSignalWriterManagerBase extends CodeWriter {
8686
if (properties) {
8787
properties.forEach(prop => {
8888
const defaultValue = PROPERTY_DEFAULT_MAP[prop.name] ?? '';
89-
this.writeLine(`\tget ${prop.name}(): ${prop.type} { return window.OneSignal?.${PARENT_PATH_FOR_NAMESPACE_MAP[namespaceName] ?? ''}${namespaceName}?.${prop.name}${defaultValue} },`);
89+
this.writeLine(`\tget ${prop.name}(): ${prop.type} { return window.OneSignal?.${PARENT_PATH_FOR_NAMESPACE_MAP[namespaceName] ?? ''}${namespaceName}?.${prop.name}${defaultValue}; },`);
9090
});
9191
}
9292

0 commit comments

Comments
 (0)