Commit Graph
24 Commits
Author SHA1 Message Date
Ivan Starkov 2e236917a7 build: Add devcontainer (#3429)
## Description

Allow development in devcontainers, simplifies initial setup

Open project in vscode (and accept open in devcontainer) or in
codespaces, wait setup to complete

run
```
pnpm dev
```

<img width="436" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/f03fdc99-5c46-4de5-be9c-2bb9420afc99">





## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2024-05-28 14:15:55 +03:00
Ivan Starkov f2ce532dcb build: Migrate (#3266)
# Migrate

This workflow is triggered only on pushes to the `main`, `*.staging` or
`migrate` branches.
For `*.staging` and `migrate` it specifically checks if the commit
message starts with `::migrate::`,
indicating a migration-related change.

### Example usage:

Execute a commit with a migration flag using:
```
git commit --allow-empty -m "::migrate::test description"
```

### Note:
This setup is a temporary measure. The intention is to transition to a
fully automated publish and release process via GitHub Actions in the
future.

## PS

Show amount of pending migrations so you know do you need to apply it on
staging

<img width="419" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/0dfaeae5-bb65-4a65-bb6a-29be20d92a7a">
2024-05-01 16:20:11 +03:00
Ivan Starkov 7fdfb50fb0 build: CLI container to use in webstudio builder publish process (#3163)
## Description

Deployed tags:

<img width="1376" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/7e7dd235-7e98-4ab7-9a28-e9d027fd0dbf">


## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2024-04-14 18:55:22 +03:00
Bogdan Chadkin 7abeb7b809 build: drop turbo (#3164)
There is no use for us from turbo. Pnpm does the same as runner. Caching
we still were not able to setup. Builds are superfast anyway. Checks are
actually faster since github tuned their actions.
2024-04-14 15:29:19 +07:00
Ivan Starkov 357f35d7a5 feat: Implement Rate Limiting (#2393)
## Description

This PR integrates a rate-limiting mechanism into the app using Vercel's
edge-layer middleware in combination with the Hono framework. This
middleware is written in JS with full JSDoc TypeScript typings.

### Architecture & Strategy
Vercel Middleware: Serves as the front-line defense, running at the edge
for optimal performance.
Hono Framework: For granular control, we utilize Hono middlewares for
applying or skipping rate limits.
Additionally, non-expensive routes benefit from an ephemeral cache to
further optimize performance

### Current Limitations
Due to a dependency on CommonJS, we cannot use TypeScript fully.
Consequently, session configurations are not yet shared across multiple
files. All utility functions are present in a single file for the time
being.


### Logic Breakdown
- Assets: Rate limiting skipped.
- Service Calls: Rate limiting skipped.
- /rest/ai/* Endpoint: Rate limit of 20 requests per 5 minutes,
identified by userId or IP.
- Unauthorized Users: Rate limit of 5 requests per 5 seconds, based
solely on IP.
- Authorized Users: Rate limit of 20 requests per 5 seconds, based on
userId.

### Next Steps
Plan to migrate to ESM for enabling TypeScript support for better
maintainability.
Use multiple regional KV

### Debug endpoint.
[Rate limit debug
endpoint](https://webstudio-builder-kscynssns-webstudio-is.vercel.app/rate-limit-debug)


## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-10-03 12:16:18 +00:00
Jaya Krishna Namburu fa73721355 feat: Allow export to netlify using functions and edge-functions as templates from cli (#2346)
## Description

This PR adds support for templates. 
- Extracted out the defaults like `.vercelignore` and `image-loader`.
As, if the users re using some other service providers they come as
default and won't help.
- Add prompt for selecting a template at the start of the init process.
- Added template for `netlify-functions` and `netlify-edge-functions`. 

## Code Review

- [ ] hi @istarkov , I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview
  
- [ ] hi @TrySound , I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [x] made a self-review
- [x] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging
- [x] tested locally
2023-09-23 12:30:21 +02:00
Oleg Isonenandnettohadi ef49e85362 Set loading state when opening project from dashboard (#1627)
Closes https://github.com/webstudio-is/webstudio-builder/issues/1334

## Description

When project item is clicked, we are fetching the project data via
router, if its slow - we show loading indication

## Steps for reproduction

1. open dashboard
2. set network throttling in dev tools to super slow
3. open a project

## Code Review

- [ ] hi @istarkov , I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory

---------

Co-authored-by: nettohadi <32300655+nettohadi@users.noreply.github.com>
2023-05-14 14:23:51 +02:00
Ivan Starkov 50e17d44ee Show preview initially for view only users (#940)
## Description

1. What is this PR about (link the issue and add a short description)

Show preview initially for view only users

ref #548


## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @TrySound , I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-02-03 18:19:55 +03:00
Mateusz Burzyński 59ff5bf4d8 Use TS project references to improve the IDE experience 2022-10-20 20:53:40 +02:00
Andrey Okonetchnikov ef542e158b Integrate lost-pixel 2022-09-23 10:47:15 +02:00
Roman Pominov a9f33cd6f9 new migration engine (wip)
Squashed all "wip" commits
2022-09-05 11:42:59 +03:00
Oleg Isonen b224916242 only ignore lib in packages 2022-08-07 00:11:37 +02:00
Sara Vieira 2986216118 PR fixes 2022-07-21 22:30:38 +02:00
Sara Vieira 7b46a5bd43 allow s3 uploads 2022-07-17 16:27:06 +02:00
Sara Vieira b620c45351 make local uploads work 2022-07-14 13:59:14 +02:00
Oleg Isonen 98283929fe ignore yarn.lock 2022-07-12 00:59:28 +02:00
Oleg Isonen 25348ce785 ignore build 2022-07-06 21:44:26 +02:00
Oleg Isonen 310166343b first working version of designer in turborepo 2022-07-06 11:36:59 +02:00
Sara Vieira 9fcc1e9b8f use correct remix versions 2022-05-24 23:29:59 +03:00
Sara Vieira 8c9d47006c fix remix not found 2022-05-22 01:01:54 +02:00
Sara Vieira bf49390de9 move to sqlite 2022-05-21 18:37:19 +02:00
Oleg Isonen 77d8e5026b migrations 2022-05-07 14:19:52 +02:00
Oleg Isonen 62158f7df5 don't ignore nested lib dirs 2022-03-15 14:05:31 +00:00
Oleg Isonen 8c68ca2659 first public commit 2022-03-13 04:22:21 +00:00