Skip to content

Commit 1a23688

Browse files
OneSignalfadi-george
authored andcommitted
feat: sync with web-shim-codegen v3.0.2
- Export OneSignal types and interfaces (OneSignal/web-shim-codegen@b3143a0)
1 parent ddc7df3 commit 1a23688

File tree

11 files changed

+2515
-4081
lines changed

11 files changed

+2515
-4081
lines changed

.eslintrc.cjs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es6: true,
5+
node: true,
6+
},
7+
settings: {
8+
'import/resolver': {
9+
node: {
10+
paths: ['src'],
11+
extensions: ['.js', '.ts', '.jsx', '.tsx'],
12+
},
13+
},
14+
},
15+
extends: ['plugin:react/recommended'],
16+
parser: '@typescript-eslint/parser',
17+
parserOptions: {
18+
ecmaFeatures: {
19+
jsx: true,
20+
},
21+
ecmaVersion: 2018,
22+
sourceType: 'module',
23+
},
24+
plugins: ['react', '@typescript-eslint'],
25+
rules: {
26+
'react/jsx-filename-extension': [1, { extensions: ['.tsx', '.jsx'] }],
27+
'react/jsx-props-no-spreading': 0,
28+
'prefer-destructuring': 0,
29+
'no-param-reassign': 0,
30+
'import/extensions': 0,
31+
'dot-notation': 0,
32+
'no-continue': 0,
33+
'no-unused-vars': 'off',
34+
'@typescript-eslint/no-unused-vars': ['error'],
35+
'no-unused-expressions': [
36+
'error',
37+
{ allowShortCircuit: true, allowTernary: true },
38+
],
39+
},
40+
};

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ dist
1616
.env.test.local
1717
.env.production.local
1818

19-
npm-debug.log*
19+
npm-debug.log*
20+
yarn-debug.log*
21+
yarn-error.log*

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ You can find more information on OneSignal [here](https://onesignal.com/).
2525

2626
### Migration Guides
2727

28-
Versions 3.0 were recently released and include breaking changes. See the [Migration Guide](https://github.com/OneSignal/react-onesignal/blob/main/MigrationGuide.md) to update your implementation.
28+
Version 3.0 was recently released and includes breaking changes. See the [Migration Guide](https://github.com/OneSignal/react-onesignal/blob/main/MigrationGuide.md) to update your implementation.
2929

3030
## Contents
3131

example/index.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
<meta
9+
name="description"
10+
content="Web site created using create-react-app"
11+
/>
12+
<link rel="apple-touch-icon" href="/logo192.png" />
13+
<!--
14+
manifest.json provides metadata used when your web app is installed on a
15+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
16+
-->
17+
<link rel="manifest" href="/manifest.json" />
18+
<!--
19+
Notice the use of %PUBLIC_URL% in the tags above.
20+
It will be replaced with the URL of the `public` folder during the build.
21+
Only files inside the `public` folder can be referenced from the HTML.
22+
23+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
24+
work correctly both with client-side routing and a non-root public URL.
25+
Learn how to configure a non-root public URL by running `npm run build`.
26+
-->
27+
<title>React App</title>
28+
</head>
29+
<body>
30+
<noscript>You need to enable JavaScript to run this app.</noscript>
31+
<div id="root"></div>
32+
<script type="module" src="./src/index.tsx"></script>
33+
</body>
34+
</html>

example/package.json

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,17 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6-
"@testing-library/jest-dom": "^5.16.5",
7-
"@testing-library/react": "^13.4.0",
8-
"@testing-library/user-event": "^13.5.0",
9-
"@types/jest": "^27.5.2",
10-
"@types/node": "^16.18.14",
11-
"@types/react": "^18.0.28",
12-
"@types/react-dom": "^18.0.11",
13-
"cra-template-typescript": "1.2.0",
14-
"react": "^18.2.0",
15-
"react-dom": "^18.2.0",
6+
"@types/node": "^22.13.10",
7+
"@types/react": "^19.0.10",
8+
"@types/react-dom": "^19.0.4",
9+
"react": "^19.0.0",
10+
"react-dom": "^19.0.0",
1611
"react-onesignal": "file:../",
17-
"react-scripts": "5.0.1",
18-
"typescript": "^4.9.5",
19-
"web-vitals": "^2.1.4"
12+
"typescript": "^5.8.2",
13+
"web-vitals": "^4.2.4"
2014
},
2115
"scripts": {
22-
"start": "npm run prepare && react-scripts start",
23-
"prepare": "cd .. && npm run build",
24-
"build": "react-scripts build",
25-
"test": "react-scripts test",
26-
"eject": "react-scripts eject"
27-
},
28-
"eslintConfig": {
29-
"extends": [
30-
"react-app",
31-
"react-app/jest"
32-
]
16+
"start": "vite"
3317
},
3418
"browserslist": {
3519
"production": [
@@ -42,5 +26,9 @@
4226
"last 1 firefox version",
4327
"last 1 safari version"
4428
]
29+
},
30+
"devDependencies": {
31+
"@vitejs/plugin-react": "^4.3.4",
32+
"vite": "^6.2.1"
4533
}
4634
}

example/src/index.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
import React from 'react';
21
import ReactDOM from 'react-dom/client';
3-
import './index.css';
42
import App from './App';
3+
import './index.css';
54
import reportWebVitals from './reportWebVitals';
65

76
const root = ReactDOM.createRoot(
8-
document.getElementById('root') as HTMLElement
9-
);
10-
root.render(
11-
<App />
7+
document.getElementById('root') as HTMLElement,
128
);
9+
root.render(<App />);
1310

1411
// If you want to start measuring performance in your app, pass a function
1512
// to log results (for example: reportWebVitals(console.log))

example/vite.config.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import react from '@vitejs/plugin-react';
2+
3+
import { defineConfig } from 'vite';
4+
5+
export default defineConfig({
6+
plugins: [react()],
7+
server: {
8+
port: 3000,
9+
open: true,
10+
},
11+
});

0 commit comments

Comments
 (0)