Generated Computers
Locals: an Apple Silicon engine that runs local LLMs up to 3x faster. A product of Generated Computers.
翻譯準備中
Build Shopify apps with Vue 3. polaris-vue-elements gives you typed Vue components (props, events, v-model) around Shopify Polaris web components like s-button, s-text-field and s-modal, generated fro
翻譯準備中
開發工具TypeScript · JavaScriptGitHub @HQCuong上線中營運者未確認
試用過了嗎? 點一下就好,不需要登入。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證Typed Vue 3 wrappers for Shopify Polaris web components (s-button, s-text-field, s-modal…) — props, events and v-model generated from the official Custom Elements Manifest.
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗English | Tiếng Việt | 한국어 | 简体中文 | 日本語 | Deutsch | Français | Español
Documentation · Getting started · Components · Embedded app guide · Changelog
Typed Vue 3 wrapper components for Shopify Polaris web components: the s-* custom elements used to build Shopify App Home (embedded admin) apps.
The Polaris runtime itself loads from Shopify's CDN (the polaris-2.js stable channel receives compatible updates automatically). This library gives you an idiomatic, fully typed Vue surface on top of it.
@shopify/polaris-types): union-typed props like variant, autocomplete in templates, typed @click / @aftershow listeners.v-model on 17 form components (STextField, SCheckbox, SSelect, SChoiceList, …), each mapped to its correct property/event pair.SModal exposes a typed $el (ModalElement), so modal.value?.$el.showOverlay() type-checks, alongside Polaris's declarative commandFor / command pattern.$attrs, slots are forwarded verbatim, and brand-new Polaris components can always be used as raw s-* tags. A stale wrapper means missing types for new features, never broken existing ones.npm install polaris-vue-elements
Vue ^3.5 is a peer dependency.
The wrappers are presentational only. Your host app loads the Polaris runtime from Shopify's CDN and tells Vue that s-* tags are custom elements:
<!-- index.html -->
<script src="https://cdn.shopify.com/shopifycloud/polaris-2.js"></script>
// vite.config.ts
vue({
template: {
compilerOptions: {
isCustomElement: (tag) => tag.startsWith('s-'),
},
},
})
Note:
polaris-2.jsis Shopify's stable channel and brings the admin's new visual design. Apps still onpolaris-1.jskeep working: 2.0's component API is the same as 1.1 apart from a few additions. See Polaris 2.0 and the new admin design.
<script setup lang="ts">
import { ref } from 'vue'
import { SButton, STextField } from 'polaris-vue-elements'
const name = ref('')
</script>
<template>
<STextField v-model="name" label="Name" />
<SButton variant="primary" @click="console.log(name)">Save</SButton>
</template>
Tip: prefer writing Polaris's own
<s-button>tags? Add"types": ["polaris-vue-elements/elements"]to yourtsconfig.json, and Volar /vue-tsctype-check raw<s-*>tags too (types only;v-modelstays wrapper-only). See Typing raw<s-*>tags.
Everything lives at polaris-vue-elements.dev:
v-model, overlays and typed raw tags.fetch, navigation and the save bar.The site's source is in docs/; run it locally with npm run docs:dev.
Everything derivable from Shopify's manifest is machine-generated; human judgment lives in one small file.
@shopify/polaris-types (custom-elements.json) ← source of truth
│ npm run generate
▼
src/lib/generated/ ← metadata, Props/Events/Element types, components (DO NOT EDIT)
src/lib/runtime/ ← createWrapper: one generic factory for all 62 components
src/lib/overrides.ts ← hand-written: v-model mappings only
Drift-guard tests make forgetting impossible: CI fails if generated code is stale, if a manifest component lacks a wrapper, or if a new form-like component is missing a v-model override. A scheduled workflow (sync-polaris.yml) opens a sync PR automatically when a new @shopify/polaris-types is published.
npm update @shopify/polaris-types
npm run generate # regenerate wrappers + types
npm run docs:generate # regenerate component reference docs
git diff # review, then note API changes in CHANGELOG.md
npm install
npm run dev # playground (src/App.vue) with live Polaris components
npm run docs:dev # documentation site
npm run test:unit # vitest (drift guards + wrapper behavior)
npm run type-check # vue-tsc
npm run lint # oxlint + eslint
npm run generate # regenerate src/lib/generated/ from the manifest
npm run docs:generate # regenerate docs/components/ from the manifest
npm run build:lib # build the publishable package into dist/
Bug reports, docs fixes and pull requests are welcome. See CONTRIBUTING.md for setup, ground rules and the pre-PR checklist, and the Code of Conduct. To report a vulnerability, see SECURITY.md.
Releases are cut from main by pushing a version tag. release.yml does the rest: checks, npm publish with provenance via npm Trusted Publishing, and a GitHub Release whose notes come from CHANGELOG.md.
CHANGELOG.md, move the ## [Unreleased] entries under a new ## [x.y.z] - YYYY-MM-DD heading and update the compare links at the bottom. The polaris-types sync PRs record new/removed components there automatically; add prop, slot and icon changes by hand (removals are breaking).npm version x.y.z --no-git-tag-version, commit both files, and push to main.git tag vx.y.z && git push origin vx.y.z. Tags with a pre-release suffix (e.g. v0.3.0-rc.0) publish under the next dist-tag.MIT. Not affiliated with or endorsed by Shopify.