Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into docs
Browse files Browse the repository at this point in the history
  • Loading branch information
juzser committed Mar 26, 2024
2 parents a8bdb96 + 363a612 commit d5267f6
Show file tree
Hide file tree
Showing 10 changed files with 280 additions and 145 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ We're using this library for our apps and got `Built for Shopify` badge, so hope

## Documentation

Online documentation: [Click Here](https://ownego.github.io/polaris-vue/)
Official documentation for v2.x: [Click Here](https://ownego.github.io/polaris-vue/)

> Documentation for v1.3.x: [here](https://ownego.github.io/polaris-vue/v1/)
<br/>

Expand Down
8 changes: 7 additions & 1 deletion docs/.vitepress/theme/use/useMeta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ export function useMeta(ignoreFetch = false) {

// String
if (types[0].startsWith('string')) {
return ['string'];
console.log(types[0]);

return [types[0]];
}

// Number
Expand Down Expand Up @@ -190,6 +192,10 @@ export function useMeta(ignoreFetch = false) {
return 'boolean';
}

if (t === 'boolean[]') {
return 'boolean';
}

if (t === 'number') {
return 'boolean';
}
Expand Down
2 changes: 1 addition & 1 deletion docs/components/AppProvider/I18n.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</template>

<script setup lang="ts">
// import locales from '@ownego/polaris-vue/locales/fr.json';
// import locales from '@ownego/polaris-vue/dist/locales/fr.json';
import locales from './fr.json'; // Let's use the import as above, this is just for demo purpose
const items = [
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ The `i18n` prop is required to pass the locales, you can check the [supported lo
</AppProvider>
</template>
<script setup>
import locales from '@ownego/polaris-vue/locales/en.json';
import locales from '@ownego/polaris-vue/dist/locales/en.json';
</script>
```
:::
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ownego/polaris-vue",
"version": "2.0.4",
"version": "2.0.5",
"polaris_version": "12.20.0",
"description": "Shopify Polaris 12 - UI library for Vue 3",
"author": "Ownego Team",
Expand All @@ -20,13 +20,12 @@
"LICENSE",
"README.md"
],
"locales": "./dist/locales",
"types": "./dist/types/src/polaris-vue.d.ts",
"types": "./dist/types/polaris-vue.d.ts",
"main": "./dist/polaris-vue.umd.js",
"module": "./dist/polaris-vue.es.js",
"scripts": {
"dev": "vite",
"build": "rimraf dist && vite build && vue-tsc --declaration --emitDeclarationOnly && npm run gen-dts && npm run copy-locales && npm run remove-trashes",
"build": "rimraf dist && vue-tsc --noEmit && vite build && npm run gen-dts && npm run copy-locales && npm run remove-trashes",
"preview": "vite preview --port 5050",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"gen-dts": "esbuild build/gen-component-declaration.js --bundle --platform=node | node && npm run move-dts",
Expand All @@ -53,7 +52,7 @@
"@shopify/postcss-plugin": "^5.0.2",
"@types/node": "^20.10.4",
"@vitejs/plugin-vue": "^5.0.2",
"@vue/language-plugin-pug": "^2.0.6",
"@vue/language-plugin-pug": "1.8.27",
"change-case": "^5.3.0",
"eslint": "^8.54.0",
"eslint-plugin-vue": "^9.18.1",
Expand All @@ -70,13 +69,14 @@
"typescript": "^5.3.3",
"url": "^0.11.3",
"vite": "^5.0.10",
"vite-plugin-dts": "^3.7.3",
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-replace": "^0.1.1",
"vitepress": "^1.0.0-rc.35",
"vue": "^3.4.19",
"vue-component-meta": "^1.8.27",
"vue-router": "^4.2.5",
"vue-tsc": "^2.0.6"
"vue-tsc": "^1.8.27"
},
"peerDependencies": {
"vue": "^3.3"
Expand Down
12 changes: 0 additions & 12 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
import { createApp } from 'vue';
import { createWebHistory, createRouter } from 'vue-router';
import App from './Demo.vue';
import PolarisVue from './polaris-vue';

// Define routes for development stage
const routes = [
{ path: '/', component: App },
];

const router = createRouter({
history: createWebHistory(),
routes,
});

createApp(App)
.use(PolarisVue)
.use(router)
.mount('#app');
10 changes: 5 additions & 5 deletions src/polaris-vue.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { App } from 'vue';

import * as components from '@/components';
import * as components from './components';

const PolarisVue = {
install(Vue: App) {
Expand All @@ -10,10 +10,10 @@ const PolarisVue = {
},
};

export * from '@/components';
export * from './components';

export { useBreakpoints } from '@/use/useBreakpoints';
export { useIndexResourceState } from '@/use/useIndexResourceState';
export { useSetIndexFiltersMode } from '@/use/useSetIndexFiltersMode';
export { useBreakpoints } from './use/useBreakpoints';
export { useIndexResourceState } from './use/useIndexResourceState';
export { useSetIndexFiltersMode } from './use/useSetIndexFiltersMode';

export default PolarisVue;
4 changes: 1 addition & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,19 @@
"skipLibCheck": true,
"paths": {
"@/*": ["./src/*"],
"@polaris/*": ["./polaris/polaris-react/src/*"]
"@polaris/*": ["./polaris/polaris-react/src/*"],
},
"types": [
"node",
"vite/client"
],
"outDir": "dist/types",

// "noEmit": true,
"moduleResolution": "node",
// "allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",

"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
Expand Down
12 changes: 7 additions & 5 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { defineConfig, loadEnv } from 'vite';
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import svgLoader from 'vite-svg-loader';
import { fileURLToPath } from 'url';
import { replaceCodePlugin } from 'vite-plugin-replace';
import packageJson from './package.json';
import { generateScopedName } from './build/namespaced-classname.js';
import dts from 'vite-plugin-dts';

// https://vitejs.dev/config/
export default ({ mode }) => {
const env = loadEnv(mode, '.');

export default () => {
return defineConfig({
plugins: [
vue(),
Expand All @@ -22,6 +21,10 @@ export default ({ mode }) => {
},
],
}),
dts({
rollupTypes: true,
outDir: 'dist/types',
}),
],
resolve: {
alias: {
Expand All @@ -40,7 +43,6 @@ export default ({ mode }) => {
},
},
modules: {
// generateScopedName: `${env.VITE_CLASS_PREFIX}-[local]`,
generateScopedName,
},
},
Expand Down
Loading

0 comments on commit d5267f6

Please sign in to comment.