Skip to content

Commit

Permalink
Merge pull request #73 from OneSignal/repo-maintenance
Browse files Browse the repository at this point in the history
Repo maintenance
  • Loading branch information
rgomezp authored Dec 18, 2024
2 parents 71daab1 + d0aa126 commit 890b0f3
Show file tree
Hide file tree
Showing 13 changed files with 386 additions and 200 deletions.
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/ask-question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 🙋‍♂️ Ask a question
description: Tell us what's on your mind
title: '[question]: '
labels: ['question']
body:
- type: textarea
id: question
attributes:
label: How can we help?
description: Specific question regarding integrating this code generator.
placeholder: How do I...?
validations:
required: true
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: 🪳 Bug report
description: File a bug report
title: '[Bug]: '
labels: ['bug', 'triage']
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Provide a thorough description of whats going on.
placeholder: e.g. The types need to be updated
validations:
required: true
- type: textarea
id: reproduction-steps
attributes:
label: Steps to reproduce?
description: Provide as much detail as posible to reproduce the issue.
placeholder: |
1. Modify file X
2. Run script Y
render: Markdown
validations:
required: true
- type: textarea
id: what-are-expectations
attributes:
label: What did you expect to happen?
description: Also tell us, what did you expect to happen?
placeholder: I expected the code to generate
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: Shell
24 changes: 24 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Modified MIT License

Copyright 2024 OneSignal

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:

1. The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

2. All copies of substantial portions of the Software may only be used in connection
with services provided by OneSignal.

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.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "web-shim-codegen",
"version": "2.0.0",
"version": "3.0.1",
"description": "Used to build Web SDK libraries for various web frameworks",
"main": "index.js",
"scripts": {
"lint": "yarn run eslint . --ext .ts",
"test": "echo \"Error: no test specified\" && exit 1",
"build": "./scripts/build"
},
"keywords": [],
"author": "",
"license": "ISC",
"keywords": ["web", "sdk", "codegen"],
"author": "Rodrigo Gomez-Palacio",
"license": "MIT",
"devDependencies": {
"@types/node": "^18.15.0",
"@typescript-eslint/eslint-plugin": "^5.54.0",
Expand Down
6 changes: 5 additions & 1 deletion src/managers/TypingsWriterManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ import {
SLIDEDOWN_EVENT_NAME,
SLIDEDOWN_OPTIONS,
SUBSCRIPTION_CHANGE_EVENT,
TAG_CATEGORY } from "../snippets/types";
TAG_CATEGORY,
USER_CHANGE_EVENT,
USER_NAMESPACE_PROPERTIES} from "../snippets/types";
import { INTERFACE_PREFIX } from "../support/constants";
import { ReaderManager } from "./ReaderManager";

Expand Down Expand Up @@ -96,6 +98,8 @@ export class TypingsWriterManager extends CodeWriter {
this.writeLine(prefix+NOTIFICATION_FOREGROUND_WILL_DISPLAY_EVENT);
this.writeLine(prefix+NOTIFICATION_DISMISS_EVENT);
this.writeLine(prefix+NOTIFICATION_CLICK_EVENT);
this.writeLine(prefix+USER_CHANGE_EVENT);
this.writeLine(prefix+USER_NAMESPACE_PROPERTIES);
this.writeLine();
this.writeLine(initObjectInterfaceContents);
}
Expand Down
6 changes: 3 additions & 3 deletions src/managers/bases/OneSignalWriterManagerBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ const PARENT_PATH_FOR_NAMESPACE_MAP: { [key: string]: string } = {
};

const PROPERTY_DEFAULT_MAP: { [key: string]: string } = {
permissionNative: ` ?? 'default';`,
permission: ` ?? false;`
permissionNative: ` ?? 'default'`,
permission: ` ?? false`
};

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

Expand Down
Loading

0 comments on commit 890b0f3

Please sign in to comment.