AI prompts
base on # solidus\_frontend
Frontend contains controllers and views implementing a storefront and cart for Solidus.
## 🚧 Warning
This gem is deprecated and no longer part of the Solidus recommended stack.
For new Solidus apps, we recommend that you use
[SolidusStarterFrontend](https://github.com/solidusio/solidus_starter_frontend)
instead.
This repository will only accept bug fixes and security patches for the
branches that match supported versions of Solidus:
| Branch | End of Life |
| --------------------------------------------------------------- | ----------- |
| [v3.4](https://github.com/solidusio/solidus_frontend/tree/v3.4) | 2024-10-21 |
| [v3.3](https://github.com/solidusio/solidus_frontend/tree/v3.3) | 2024-07-24 |
| [v3.2](https://github.com/solidusio/solidus_frontend/tree/v3.2) | 2024-02-18 |
## Override views
In order to customize a view you should copy the file into your host app. Using Deface is not
recommended as it provides lots of headaches while debugging and degrades your shops performance.
Solidus provides a generator to help with copying the right view into your host app.
Simply call the generator to copy all views into your host app.
```bash
$ bundle exec rails g solidus:views:override
```
If you only want to copy certain views into your host app, you can provide the `--only` argument:
```bash
$ bundle exec rails g solidus:views:override --only products/show
```
The argument to `--only` can also be a substring of the name of the view from the `app/views/spree` folder:
```bash
$ bundle exec rails g solidus:views:override --only product
```
This will copy all views whose directory or filename contains the string "product".
### Handle upgrades
After upgrading Solidus to a new version run the generator again and follow on screen instructions.
## Developing Solidus Frontend
* Clone the Git repo
```bash
git clone git://github.com/solidusio/solidus_frontend.git
cd solidus
```
### Without Docker
* Install the gem dependencies
```bash
bin/setup
```
_Note_: If you're using PostgreSQL or MySQL, you'll need to install those gems through the DB environment variable.
```bash
# PostgreSQL
export DB=postgresql
bin/setup
# MySQL
export DB=mysql
bin/setup
```
### With Docker
```bash
docker-compose up -d
```
Wait for all the gems to be installed (progress can be checked through `docker-compose logs -f app`).
You can provide the ruby version you want your image to use:
```bash
docker-compose build --build-arg RUBY_VERSION=2.6 app
docker-compose up -d
```
The rails version can be customized at runtime through `RAILS_VERSION` environment variable:
```bash
RAILS_VERSION='~> 5.0' docker-compose up -d
```
Running tests:
```bash
# sqlite
docker-compose exec app bundle exec rspec
# postgres
docker-compose exec app env DB=postgres bundle exec rspec
# mysql
docker-compose exec app env DB=mysql bundle exec rspec
```
Accessing the databases:
```bash
# sqlite
docker-compose exec app sqlite3 /path/to/db
# postgres
docker-compose exec app env PGPASSWORD=password psql -U root -h postgres
# mysql
docker-compose exec app mysql -u root -h mysql -ppassword
```
In order to be able to access the [sandbox application](#sandbox), just make
sure to provide the appropriate `--binding` option to `rails server`. By
default, port `3000` is exposed, but you can change it through `SANDBOX_PORT`
environment variable:
```bash
SANDBOX_PORT=4000 docker-compose up -d
docker-compose exec app bin/sandbox
docker-compose exec app bin/rails server --binding 0.0.0.0 --port 4000
```
### Sandbox
Solidus is meant to be run within the context of Rails application. You can
easily create a sandbox application inside of your cloned source directory for
testing purposes.
This sandbox includes solidus\_auth\_devise and generates with seed and sample
data already loaded.
* Create the sandbox application
```bash
bin/sandbox
```
You can create a sandbox with PostgreSQL or MySQL by setting the DB environment variable.
```bash
# PostgreSQL
export DB=postgresql
bin/sandbox
# MySQL
export DB=mysql
bin/sandbox
```
If you need to create a Rails 5.2 application for your sandbox, for example
if you are still using Ruby 2.4 which is not supported by Rails 6, you can
use the `RAILS_VERSION` environment variable.
```bash
export RAILS_VERSION='~> 5.2.0'
bin/setup
bin/sandbox
```
* Start the server (`bin/rails` will forward any argument to the sandbox)
```bash
bin/rails server
```
### Tests
Solidus uses [RSpec](http://rspec.info) for tests. Refer to its documentation for
more information about the testing library.
#### CircleCI
We use CircleCI to run the tests for Solidus as well as all incoming pull
requests. All pull requests must pass to be merged.
You can see the build statuses at
[https://circleci.com/gh/solidusio/solidus_frontend](https://circleci.com/gh/solidusio/solidus_frontend).
#### Run all tests
[ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/home) is
required to run the frontend suites.
Run the tests
```bash
bundle exec rspec
```
By default, `rspec` runs the tests for SQLite 3. If you would like to run specs
against another database you may specify the database in the command:
```bash
env DB=postgresql bundle exec rspec
```
#### Code coverage reports
If you want to run the [SimpleCov](https://github.com/colszowka/simplecov) code
coverage report:
```bash
COVERAGE=true bundle exec rspec
```
### Releasing new versions
Please refer to the dedicated [page](https://github.com/solidusio/solidus/wiki/How-to-release-extensions) on Solidus wiki.
", Assign "at most 3 tags" to the expected json: {"id":"5253","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"