You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -14,6 +16,7 @@ If you already bootstrapped the remotes you just need to run:
14
16
`scripts/update-subtrees`
15
17
16
18
## Upstream API Spec
19
+
17
20
The code generator uses an `api.json` spec file from the [OneSignal-Website-SDK](https://github.com/OneSignal/OneSignal-Website-SDK) repo as the input. Modify this file in that repo to change what the generator ultimately builds.
18
21
19
22
The generator uses the URL hard-coded as a constant in the `src/support/constants.ts` file to fetch the spec. Make sure to update this URL as needed.
@@ -25,40 +28,44 @@ The generator uses the URL hard-coded as a constant in the `src/support/constant
25
28
Run the `update-version-numbers` script in the `scripts` folder and input the update type (major, minor, patch, beta).
26
29
27
30
**Update `README.md` files where needed**
28
-
* React: `src/static/react/README.md`
29
-
* Vue: `src/static/vue/README.md`
30
-
* Angular: `src/static/onesignal-ngx/README.md`
31
+
32
+
- React: `src/static/react/README.md`
33
+
- Vue: `src/static/vue/README.md`
34
+
- Angular: `src/static/onesignal-ngx/README.md`
31
35
32
36
```
33
-
yarn build
37
+
npm run build
34
38
```
35
39
36
-
*ATTENTION: note regarding hidden files:*
37
-
The `settings.json` file in the `.vscode` directory hides all `*.js` files automatically. This is to keep the workspace uncluttered. Alternatively, you can turn those settings off by flipping to `false` and cleaning / decluttering with the command `yarn clean` (see below).
40
+
_ATTENTION: note regarding hidden files:_
41
+
The `settings.json` file in the `.vscode` directory hides all `*.js` files automatically. This is to keep the workspace uncluttered. Alternatively, you can turn those settings off by flipping to `false`.
38
42
39
43
## Publishing
44
+
40
45
1. Merge your changes to `main` to kick off the build and cd_update process. Or trigger the workflow manually through the "Submit Downstream PRs" Github Actions workflow.
41
46
2. Review the downstream PR (branch `cd_update`) and merge into each respective SDK's `main` or feature branch (e.g: `user-model/v1`).
42
47
3. Pull the remote changes via `git pull` for the SDKs.
43
48
4. Publish with `npm publish .`
44
-
* For onesignal-vue3 you must pass the `--access public` to the publish command as it is a scoped package.
45
-
* For **beta releases** run `npm publish --tag beta`
49
+
- For onesignal-vue3 you must pass the `--access public` to the publish command as it is a scoped package.
50
+
- For **beta releases** run `npm publish --tag beta`
46
51
47
52
## Special Types File
53
+
48
54
The repo contains a file `types.ts` that contains all the type definitions for arguments and return values. These types must be kept updated (synchronized) with the upstream. To add new ones:
55
+
49
56
- add the type to `src/snippets/types.ts`
50
57
- write the type via `TypingsWriterManagerBase.ts`
51
58
52
-
## Cleaning
53
-
You can clean the generated `.js` files by running `yarn clean`
54
-
55
59
## Compatibility
60
+
56
61
As frameworks put out new major releases, we should ensure our shims remain compatible with the new versions.
57
62
58
63
### Vue 2 & 3
64
+
59
65
There were some breaking changes in Vue 3 that required the plugin to be updated to support it. Instead of making a major release, we opted to create a separate plugin: `onesignal-vue3` as this will greatly simplify managing future major releases (e.g: w/ user-model).
60
66
61
67
### Angular
68
+
62
69
Angular puts out a new major release more frequently: once or twice per year. Our plugin is almost a pure JS module with the exception of a couple imports including `Injectable` needed for the eventual dependency injection. These are:
It is unlikely that Angular would introduce a regression in a future release, in particular with `Injectable` which is our main dependency injection method. For context, it is a decorator (e.g: `@Injectable()`) which Angular uses to know what to inject. However, keep an eye out for changes related to any of these when looking to determine compatibility.
69
76
70
77
# Dev Environment
78
+
71
79
Set up a new React, Vue, or Angular App so the new app and final package repo is at the same directory level as this project.
0 commit comments