{"id":28416444,"url":"https://github.com/nebulab/shopify_toolkit","last_synced_at":"2025-08-03T22:38:25.835Z","repository":{"id":282418753,"uuid":"940650341","full_name":"nebulab/shopify_toolkit","owner":"nebulab","description":"A toolkit for working with Custom Shopify Apps built on Rails.","archived":false,"fork":false,"pushed_at":"2025-07-03T15:04:51.000Z","size":19614,"stargazers_count":11,"open_issues_count":5,"forks_count":0,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-07-28T14:56:04.957Z","etag":null,"topics":["rails","ruby","shopify","shopify-apps"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nebulab.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-28T14:52:17.000Z","updated_at":"2025-07-02T13:58:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"9c2ad202-0413-4ce0-8191-d2b35470509f","html_url":"https://github.com/nebulab/shopify_toolkit","commit_stats":null,"previous_names":["nebulab/shopify_toolkit"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/nebulab/shopify_toolkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebulab%2Fshopify_toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebulab%2Fshopify_toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebulab%2Fshopify_toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebulab%2Fshopify_toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nebulab","download_url":"https://codeload.github.com/nebulab/shopify_toolkit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebulab%2Fshopify_toolkit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268624105,"owners_count":24280147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rails","ruby","shopify","shopify-apps"],"created_at":"2025-06-03T21:05:13.412Z","updated_at":"2025-08-03T22:38:25.825Z","avatar_url":"https://github.com/nebulab.png","language":"Ruby","readme":"# ShopifyToolkit\n\nA toolkit for working with Custom Shopify Apps built on Rails.\n\n### Assumptions\n\n- You are using Rails 7.0 or later\n- The custom app is only installed on a single store\n- In order for the schema dump/load to work, you need to have the `shopify_app` gem installed and configured\n\n## Features/Roadmap\n\n- [x] Shopify/Matrixify CSV tools\n- [x] Metafield/Metaobject migrations (just like ActiveRecord migrations, but for Shopify!)\n- [x] Metafield Definitions management API\n- [x] Metaobject Definitions management API\n  - [x] Create\n  - [x] Update\n  - [x] Find\n  - [ ] Delete\n- [ ] Metaobject Instances management API\n- [ ] GraphQL Admin API code generation (syntax checking, etc)\n- [ ] GraphQL Admin API client with built-in rate limiting\n- [ ] GraphQL Admin API client with built-in caching\n- [ ] GraphQL Admin API client with built-in error handling\n- [ ] GraphQL Admin API client with built-in logging\n- [ ] Bulk Operations\n  - [ ] Interface for uploading and getting results for query / mutation\n  - [ ] Error handling and Logging\n  - [ ] Callbacks\n\n## Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n```bash\nbundle add shopify_toolkit\n```\n\n## Usage\n\n### Migrating Metafields and Metaobjects\n\nWithin a Rails application created with ShopifyApp, generate a new migration file:\n\n```bash\nbundle exec shopify-toolkit generate_migration AddProductPressReleases\n```\n\nThen, add the following code to the migration file:\n\n```ruby\n# config/shopify/migrate/20250528130134_add_product_press_releases.rb\nclass AddProductPressReleases \u003c ShopifyToolkit::Migration\n  def up\n    create_metaobject_definition :press_release,\n      name: \"Press Release\",\n      displayNameKey: \"name\",\n      access: { storefront: \"PUBLIC_READ\" },\n      capabilities: {\n        onlineStore: { enabled: false },\n        publishable: { enabled: true },\n        translatable: { enabled: true },\n        renderable: { enabled: false },\n      },\n      fieldDefinitions: [\n        { key: \"name\", name: \"Title\", required: true, type: \"single_line_text_field\" },\n        { key: \"body\", name: \"Body\", required: true, type: \"multi_line_text_field\" },\n      ]\n\n    metaobject_definition_id = get_metaobject_definition_gid :press_release\n\n    create_metafield :products, :press_release, :metaobject_reference, name: \"Press Release\", validations: [\n      { name: \"metaobject_definition_id\", value: metaobject_definition_id }\n    ]\n  end\n\n  def down\n    # Noop. We don't want to remove the metaobject definition, since it might be populated with data.\n  end\nend\n```\n\nThen run the migrations:\n\n```bash\nbundle exec shopify-toolkit migrate\n```\n\n### Creating a Metafield Schema Definition\n\nYou can also create a metafield schema definition file to define your metafields in a more structured way. This is useful for keeping track of your metafields and their definitions.\n\n```rb\n# config/shopify/schema.rb\n\nShopifyToolkit::MetafieldSchema.define do\n  # Define your metafield schema here\n  # For example:\n  create_metafield :products, :my_metafield, :single_line_text_field, name: \"My Metafield\"\nend\n```\n\n### Analyzing a Matrixify CSV Result files\n\nMatrixify is a popular Shopify app that allows you to import/export data from Shopify using CSV files. The CSV files that Matrixify generates are very verbose and can be difficult to work with. This tool allows you to analyze the CSV files and extract the data you need.\n\nThe tool will import the file into a local SQLite database\nand open a console for you to run queries against the data\nusing ActiveRecord.\n\n\u003e Note: To use it with `bundle exec`, sqlite3 must be included in the project’s bundle\n\n```shell\nshopify-toolkit analyze products-result.csv --force-import\n==\u003e Importing products-result.csv into /var/folders/hn/z7b7s1kj3js4k7_qk3lj27kr0000gn/T/shopify-toolkit-analyze-products_result_csv.sqlite3\n-- create_table(:results, {:force=\u003etrue})\n   -\u003e 0.0181s\n-- add_index(:results, :import_result)\n   -\u003e 0.0028s\n........................\n==\u003e Starting console for products-result.csv\n\u003e\u003e comments\n=\u003e\n[\"UPDATE: Found by Handle | Assuming MERGE for Variant Command | Assuming MERGE for Tags Command | Variants updated by SKU: 1\",\n \"UPDATE: Found by Handle | Assuming MERGE for Variant Command | Assuming MERGE for Tags Command | Variants updated by SKU: 1 | Warning: The following media were not uploaded to Shopify: [https://mymedia.com/image.jpg: Error downloading from Web: 302 Moved Temporarily]\",\n ...]\n\u003e\u003e first\n#\u003cShopifyToolkit::Result:0x0000000300bf1668\n id: 1,\n data: nil,\n handle: \"my-product\",\n title: \"My Product\",\n import_result: \"OK\",\n import_comment: \"UPDATE: Found by Handle | Assuming MERGE for Varia...\"\u003e\n\u003e\u003e count\n=\u003e 116103\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/nebulab/shopify_toolkit.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnebulab%2Fshopify_toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnebulab%2Fshopify_toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnebulab%2Fshopify_toolkit/lists"}