Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/stable sdk #189

Merged
merged 115 commits into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
7ea3750
chore(ignore): add apps-local folder for local development
heyqbnk Nov 23, 2023
3a65837
chore(packages): move dev packages to separate folder
heyqbnk Nov 23, 2023
2b18d5a
chore(deps): add new plugins for sorting
heyqbnk Nov 23, 2023
b232afa
feat(package): rework linting package, add new rules
heyqbnk Nov 23, 2023
2d8c266
feat(utils): allow specifying alias. Process tsconfig paths. Fix tsco…
heyqbnk Nov 23, 2023
fabaecd
chore(tsconfig): remove build config
heyqbnk Nov 23, 2023
d3c22fe
chore(packages): move deprecated packages to separate folder
heyqbnk Nov 23, 2023
377510f
chore(tsconfigs): rework everything related to tsconfigs and make the…
heyqbnk Nov 23, 2023
6e8f297
chore(scripts): fix typecheck script
heyqbnk Nov 23, 2023
89e443a
chore(deps): actualize deps
heyqbnk Nov 23, 2023
be39f08
build(vite): actualize build configs
heyqbnk Nov 23, 2023
87fa073
refactor(imports): remove incorrect export. Update node imports
heyqbnk Nov 23, 2023
7da0991
feat(package): move all packages to sdk package
heyqbnk Nov 23, 2023
31ce8be
chore(tsconfig): add more includes in test tsconfig. Extend esnext-dom
heyqbnk Nov 23, 2023
dda90c6
feat(package): fully rework whole package. Make it simpler and smaller
heyqbnk Nov 23, 2023
00f724f
feat(configs): add parserOptions
heyqbnk Nov 23, 2023
310d614
chore(deps): bump eslint-config-airbnb-typescript and eslint-plugin-s…
heyqbnk Nov 23, 2023
6bfbbf3
feat(rules): restore import/no-extraneous-dependencies
heyqbnk Nov 23, 2023
dde6e9c
chore(tsconfig): remove src from test config
heyqbnk Nov 23, 2023
74750d2
chore(deps): bump eslint and typescript
heyqbnk Nov 23, 2023
67c8f68
chore(workspace): add apps-local directory
heyqbnk Nov 23, 2023
9670ba2
chore(lock): update lock
heyqbnk Nov 23, 2023
59ba1de
fix(imports): set correct imports. Remove fixme
heyqbnk Nov 23, 2023
33043e9
chore(package.json): sort deps
heyqbnk Nov 23, 2023
1f4ee52
chore(lint): add eslint ignore
heyqbnk Nov 23, 2023
eaba0b1
fix(history.go): increase timeout
heyqbnk Nov 23, 2023
cd836a6
feat(package): rework package
heyqbnk Nov 23, 2023
332ccf3
fix(cloud-storage): refactor error thrown in custom method invocation
heyqbnk Nov 24, 2023
dce65da
refactor(init-data): remove usage of state in InitData component
heyqbnk Nov 24, 2023
cfd93b1
feat(main-button): MainButton constructor now accepts object instead …
heyqbnk Nov 24, 2023
23dcf6c
feat(viewport): Viewport constructor now accepts object instead of th…
heyqbnk Nov 25, 2023
8daa68b
feat(state): rename generated events. Restrict key types
heyqbnk Nov 25, 2023
00fc0af
chore(eslint): sort rules. Disable import/extensions
heyqbnk Nov 25, 2023
3c8e964
fix(nav): change packages entry url
heyqbnk Nov 25, 2023
67a4167
feat(sdk): add new components pages
heyqbnk Nov 25, 2023
086bbb4
fix(init-data-node): remove note about init-data
heyqbnk Nov 25, 2023
47dcef9
fix(packages): add deprecation warnings
heyqbnk Nov 25, 2023
b53a29d
refactor(imports,exports): move utils to misc. Reorder imports and ex…
heyqbnk Nov 25, 2023
24f45e8
feat(components): implement Utils component. Re-export misc
heyqbnk Nov 25, 2023
2bf8e5e
feat(cloud-storage): rename methods. Add overrides
heyqbnk Nov 25, 2023
892f989
fix(init-data): remove serializeInitData function
heyqbnk Nov 25, 2023
8782001
fix(init-data): remove InitData.parse
heyqbnk Nov 25, 2023
bbc29f9
fix(init-data): remove InitData.serialize
heyqbnk Nov 25, 2023
7dd03d6
refactor(init-data): refactor canSendAfterDate comment
heyqbnk Nov 25, 2023
e38e160
refactor(init-data): refactor chatInstance comment
heyqbnk Nov 25, 2023
add80e8
feat(invoice): allow opening invoice by slug
heyqbnk Nov 25, 2023
93a4cb2
feat(main-button): rename "progress" to "loader". Implement MainButto…
heyqbnk Nov 25, 2023
ee79c39
fix(mini-app): remove functionality not related to Mini App
heyqbnk Nov 25, 2023
ab0d909
refactor(popup): refactor con props
heyqbnk Nov 25, 2023
2b2f3a4
refactor(qr-scanner): refactor con props
heyqbnk Nov 25, 2023
6f71368
fix(state): ignore undefined values
heyqbnk Nov 25, 2023
6a79c60
feat(theme-params): implement requestThemeParams function
heyqbnk Nov 25, 2023
1c4f043
fix(theme-params): remove request and synced methods. Remove unnecess…
heyqbnk Nov 25, 2023
28e5574
fix(theme-params): remove serialize method. Rename sync to listen
heyqbnk Nov 25, 2023
655fb81
refactor(theme-params): remove unnecessary export
heyqbnk Nov 25, 2023
d1ad1b9
feat(viewport): implement requestViewport function
heyqbnk Nov 25, 2023
6eef4f4
fix(viewport): remove request method
heyqbnk Nov 25, 2023
2fdbdfd
feat(viewport): reuse requestViewport function
heyqbnk Nov 25, 2023
998e041
fix(viewport): rename actualize to sync
heyqbnk Nov 25, 2023
30ab838
fix(viewport): rename sync to listen
heyqbnk Nov 25, 2023
a9644cf
refactor(viewport): reorder state update with tma method call in expand
heyqbnk Nov 25, 2023
fb8b74e
feat(viewport): add truncate utility
heyqbnk Nov 25, 2023
e645fd5
fix(storage): rename isProgressVisible to isLoaderVisible
heyqbnk Nov 25, 2023
b17b79a
fix(colors): remove ColorScheme type
heyqbnk Nov 25, 2023
bef8acd
feat(init): reduce count of created listeners
heyqbnk Nov 25, 2023
1c69f8c
feat(init): reduce count of created listeners
heyqbnk Nov 25, 2023
8f8294e
fix(init): fix createMainButton
heyqbnk Nov 25, 2023
af44921
fix(init): actualize createMiniApp
heyqbnk Nov 25, 2023
9f48844
fix(init): actualize createThemeParams
heyqbnk Nov 25, 2023
02947c3
fix(init): actualize createViewport
heyqbnk Nov 25, 2023
0e79e2d
fix(css): actualize binding functions
heyqbnk Nov 25, 2023
f3bb474
fix(init): actualize init function
heyqbnk Nov 25, 2023
dd1d52f
chore(init-options): refactor acceptCustomStyles comment
heyqbnk Nov 25, 2023
025393e
tests(init-data): remove serializeInitData tests
heyqbnk Nov 25, 2023
6e5016a
refactor(package exports): refactor index exports
heyqbnk Nov 25, 2023
5e5394b
refactor(submodules exports): export everything
heyqbnk Nov 25, 2023
0f5bd16
tests(all): actualize tests
heyqbnk Nov 26, 2023
75a9ad0
feat(createviteconfig): allow specifying path to the tsconfig
heyqbnk Nov 26, 2023
992a5f5
build(tsconfig): reorganize tsconfigs
heyqbnk Nov 26, 2023
8e218d8
fix(sdk): move some parts of about page to other pages
heyqbnk Nov 26, 2023
0351563
feat(sdk): add initialization page
heyqbnk Nov 26, 2023
2ba8f3e
feat(sdk): add launch params page
heyqbnk Nov 26, 2023
efb6af1
feat(sdk): add methods and events page
heyqbnk Nov 26, 2023
a116cf7
feat(sdk): add navigation page
heyqbnk Nov 26, 2023
e68bafe
feat(sdk): add theme params page
heyqbnk Nov 26, 2023
e876d2c
feat(sdk): add init data section
heyqbnk Nov 26, 2023
9631f30
feat(sdk): rework components pages
heyqbnk Nov 26, 2023
7c6bde4
fix(rules): disable arrow-body-style
heyqbnk Nov 26, 2023
ecd046c
feat(init): add Utils to init result
heyqbnk Nov 26, 2023
f2826a4
fix(react): remove lib and module options
heyqbnk Nov 26, 2023
7ad75ba
feat(hooks,hocs): rework hooks and hocs creators
heyqbnk Nov 26, 2023
faffd8f
refactor(types): move types to separate file
heyqbnk Nov 26, 2023
519cae2
refactor(provider): rework provider modules
heyqbnk Nov 26, 2023
a3abbab
refactor(components): rename components to tools
heyqbnk Nov 26, 2023
10d9886
refactor(exports): filter index exports
heyqbnk Nov 26, 2023
be48b06
chore(packages): add separate line in menu for components and init da…
heyqbnk Nov 26, 2023
4c35784
feat(packages): actualize sdk for React docs
heyqbnk Nov 26, 2023
f5d42cc
chore(scripts): better linting scripts
heyqbnk Nov 26, 2023
ac36d6c
build(tsconfig): change module to esnext
heyqbnk Nov 26, 2023
6777110
build(tsconfig): add package.json to include
heyqbnk Nov 26, 2023
efb81dd
feat(package): rework package and make it similar to such for React
heyqbnk Nov 26, 2023
9454748
chore(lint): eslint fix
heyqbnk Nov 26, 2023
eb9afba
refactor(useInitResultDynamicValue): update state value variable name
heyqbnk Nov 26, 2023
4854177
chore(scripts): add script to fix lint
heyqbnk Nov 26, 2023
e21a2ec
chore(lock): update lock
heyqbnk Nov 26, 2023
b108751
refactor(init-data-node): refactor headers, actualize parsing utils link
heyqbnk Nov 26, 2023
f20dd19
feat(sdk-solid): actualize docs
heyqbnk Nov 26, 2023
5f6fdf2
fix(sdk-react): fix some typos
heyqbnk Nov 26, 2023
2a0349a
docs(changeset): The first package major release. This time, it was f…
heyqbnk Nov 26, 2023
2974dc1
docs(changeset): The first package major release. Just setting a stab…
heyqbnk Nov 26, 2023
f64ca63
docs(changeset): The first package major version. It now references @…
heyqbnk Nov 26, 2023
a17f3f0
docs(changeset): The first packages major releases. Their implementat…
heyqbnk Nov 26, 2023
a9c0efc
fix(eslint): disable indentation rules
heyqbnk Nov 26, 2023
e34693b
refactor(debug,logging): move global to a separate file
heyqbnk Nov 26, 2023
60c23a8
tests(globals): fix globals tests
heyqbnk Nov 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .changeset/angry-peas-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@tma.js/sdk-react": major
"@tma.js/sdk-solid": major
---

The first packages major releases. Their implementation was simplified as much as possible. Moreover, they look more similar now.
5 changes: 5 additions & 0 deletions .changeset/gorgeous-students-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tma.js/sdk": major
---

The first package major release. This time, it was fully reworked. All other @tma.js packages were moved to this package.
5 changes: 5 additions & 0 deletions .changeset/quiet-trains-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tma.js/solid-router-integration": patch
---

The first package major version. It now references @tma.js/sdk for utilities.
5 changes: 5 additions & 0 deletions .changeset/thick-wasps-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tma.js/init-data-node": major
---

The first package major release. Just setting a stable version.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ yarn-error.log*
.idea
.docusaurus

# App for local development
apps/.local
# Apps for local development.
apps-local

apps/docs/.vitepress/cache
apps/docs/.vitepress/dist
113 changes: 87 additions & 26 deletions apps/docs/.vitepress/packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,79 @@ function prefixed(value: string): string {

export const packagesNavItem = {
text: 'Packages',
link: prefixed('/typescript/tma-js-bridge'),
link: prefixed('/typescript/tma-js-sdk/about'),
};

export const packagesSidebar = {
[prefixed('/')]: [
{
text: 'TypeScript',
items: [
{ text: '@tma.js/bridge', link: prefixed('/typescript/tma-js-bridge') },
{
text: '@tma.js/init-data',
collapsed: true,
items: [
{ text: 'About', link: prefixed('/typescript/tma-js-init-data/about') },
{ text: 'InitData', link: prefixed('/typescript/tma-js-init-data/init-data') },
{ text: 'Chat', link: prefixed('/typescript/tma-js-init-data/chat') },
{ text: 'User', link: prefixed('/typescript/tma-js-init-data/user') },
],
},
{
text: '@tma.js/launch-params',
link: prefixed('/typescript/tma-js-launch-params'),
},
{ text: '@tma.js/theme-params', link: prefixed('/typescript/tma-js-theme-params') },
{ text: '@tma.js/navigation', link: prefixed('/typescript/tma-js-navigation') },
{
text: '@tma.js/sdk',
collapsed: true,
link: prefixed('/typescript/tma-js-sdk/about'),
items: [
{ text: 'About', link: prefixed('/typescript/tma-js-sdk/about') },
{
text: 'Initialization',
link: prefixed('/typescript/tma-js-sdk/init'),
},
{
text: 'Methods and events',
link: prefixed('/typescript/tma-js-sdk/methods-and-events'),
},
{
text: 'Launch parameters',
link: prefixed('/typescript/tma-js-sdk/launch-parameters'),
},
{
text: 'Theme parameters',
link: prefixed('/typescript/tma-js-sdk/theme-parameters'),
},
{
text: 'Init data',
collapsed: true,
items: [
{
text: 'About',
link: prefixed('/typescript/tma-js-sdk/init-data/about'),
},
{
text: 'InitData',
link: prefixed('/typescript/tma-js-sdk/init-data/init-data')
},
{
text: 'Chat',
link: prefixed('/typescript/tma-js-sdk/init-data/chat')
},
{
text: 'User',
link: prefixed('/typescript/tma-js-sdk/init-data/user')
},
],
},
{
text: 'Navigation',
link: prefixed('/typescript/tma-js-sdk/navigation'),
},
{
text: 'Components',
collapsed: true,
items: [
{
text: 'About components',
link: prefixed('/typescript/tma-js-sdk/components/about'),
},
{
text: 'BackButton',
link: prefixed('/typescript/tma-js-sdk/components/back-button'),
},
{
text: 'ClosingBehavior',
link: prefixed('/typescript/tma-js-sdk/components/closing-behaviour'),
link: prefixed('/typescript/tma-js-sdk/components/closing-behavior'),
},
{
text: 'CloudStorage',
link: prefixed('/typescript/tma-js-sdk/components/cloud-storage'),
},
{
text: 'HapticFeedback',
Expand All @@ -54,10 +86,18 @@ export const packagesSidebar = {
text: 'InitData',
link: prefixed('/typescript/tma-js-sdk/components/init-data'),
},
{
text: 'Invoice',
link: prefixed('/typescript/tma-js-sdk/components/invoice'),
},
{
text: 'MainButton',
link: prefixed('/typescript/tma-js-sdk/components/main-button'),
},
{
text: 'MiniApp',
link: prefixed('/typescript/tma-js-sdk/components/mini-app'),
},
{
text: 'Popup',
link: prefixed('/typescript/tma-js-sdk/components/popup'),
Expand All @@ -71,13 +111,12 @@ export const packagesSidebar = {
link: prefixed('/typescript/tma-js-sdk/components/theme-params'),
},
{
text: 'Viewport',
link: prefixed('/typescript/tma-js-sdk/components/viewport'),
text: 'Utils',
link: prefixed('/typescript/tma-js-sdk/components/utils'),
},
// TODO: Rename?
{
text: 'WebApp',
link: prefixed('/typescript/tma-js-sdk/components/web-app'),
text: 'Viewport',
link: prefixed('/typescript/tma-js-sdk/components/viewport'),
},
],
},
Expand All @@ -99,5 +138,27 @@ export const packagesSidebar = {
{ text: 'init-data-golang', link: prefixed('/golang/init-data-golang') },
],
},
{
text: 'Deprecated',
items: [
{ text: '@tma.js/bridge', link: prefixed('/typescript/tma-js-bridge') },
{
text: '@tma.js/init-data',
collapsed: true,
items: [
{ text: 'About', link: prefixed('/typescript/tma-js-init-data/about') },
{ text: 'InitData', link: prefixed('/typescript/tma-js-init-data/init-data') },
{ text: 'Chat', link: prefixed('/typescript/tma-js-init-data/chat') },
{ text: 'User', link: prefixed('/typescript/tma-js-init-data/user') },
],
},
{
text: '@tma.js/launch-params',
link: prefixed('/typescript/tma-js-launch-params'),
},
{ text: '@tma.js/theme-params', link: prefixed('/typescript/tma-js-theme-params') },
{ text: '@tma.js/navigation', link: prefixed('/typescript/tma-js-navigation') },
],
},
],
};
13 changes: 3 additions & 10 deletions apps/docs/packages/node/tma-js-init-data-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ The package provides utilities to work with the initialization data of Telegram
server side. To learn more about the initialization data and its usage, please refer to
the [documentation](../../platform/launch-parameters/common-information.md).

::: info
This package extends the functionality of [@tma.js/init-data](../typescript/tma-js-init-data/about.md), including all
its types and utilities. Therefore, there is no need to install both packages separately.
:::

## Installation

::: code-group
Expand All @@ -31,14 +26,12 @@ yarn add @tma.js/init-data-node
```
:::

## Usage

### Parsing
## Parsing

You can learn more about parsing utilities in [@tma.js/init-data](../typescript/tma-js-init-data/about.md#parsing)
You can learn more about parsing utilities in [@tma.js/sdk](../typescript/tma-js-sdk/init-data/about#parsing)
documentation.

### Validation
## Validation

To validate the signature of the initialization data, the `validate` function is used. It expects
the initialization data to be passed in raw format (search parameters) and throws an error in
Expand Down
5 changes: 5 additions & 0 deletions apps/docs/packages/typescript/tma-js-bridge.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ and saving their time.
Developers can utilize this package to create their software development kit (SDK), as it offers the
utmost level of control over cross-application communication.

::: danger
This project has been deprecated. All its functionality was moved to
the [@tma.js/sdk](./tma-js-sdk/about.md) package.
:::

## Installation

::: code-group
Expand Down
7 changes: 6 additions & 1 deletion apps/docs/packages/typescript/tma-js-init-data/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@

The package provides utilities to work with the initialization data of Telegram Mini Apps on the
client side. To learn more about the initialization data and its usage, please refer to
the [documentation](../../../platform/launch-parameters/common-information.md).
the [documentation](../../../platform/launch-parameters/init-data.md).

::: danger
This project has been deprecated. All its functionality was moved to
the [@tma.js/sdk](../tma-js-sdk/about.md) package.
:::

## Installation

Expand Down
5 changes: 5 additions & 0 deletions apps/docs/packages/typescript/tma-js-launch-params.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
Provides utilities to work with Telegram Mini
Apps [launch parameters](../../platform/launch-parameters/common-information.md).

::: danger
This project has been deprecated. All its functionality was moved to
the [@tma.js/sdk](./tma-js-sdk/about.md) package.
:::

## Installation

::: code-group
Expand Down
5 changes: 5 additions & 0 deletions apps/docs/packages/typescript/tma-js-navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ outline: [2, 3]

Package for manipulating Mini App navigation on the Telegram Mini Apps platform.

::: danger
This project has been deprecated. All its functionality was moved to
the [@tma.js/sdk](./tma-js-sdk/about.md) package.
:::

## Installation

::: code-group
Expand Down
Loading