@soubiran/vite 0.1.4 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -46,7 +46,7 @@ interface Options$1 {
46
46
  /**
47
47
  * Person information for Schema.org structured data.
48
48
  */
49
- person: PersonOptions;
49
+ person?: PersonOptions;
50
50
  /**
51
51
  * Custom validation rules for frontmatter fields.
52
52
  */
@@ -786,152 +786,156 @@ function structuredData(id, frontmatter, options) {
786
786
 
787
787
  //#endregion
788
788
  //#region vite.config.ts
789
- var vite_config_default = (title, hostname, options, config = {}) => mergeConfig(defineConfig({
790
- plugins: [
791
- vueRouter({
792
- extensions: [".vue", ".md"],
793
- routesFolder: "pages",
794
- dts: "src/typed-router.d.ts",
795
- extendRoute(route) {
796
- const path = route.components.get("default");
797
- if (!path) return;
798
- if (path.endsWith(".vue")) route.addToMeta({ frontmatter: { page: options.extractPage(path) } });
799
- if (path.endsWith(".md")) {
800
- const { data } = matter(readFileSync(path, "utf-8"));
801
- route.addToMeta({ frontmatter: data });
789
+ var vite_config_default = (title, hostname, options, config = {}) => {
790
+ const seo = { person: {
791
+ name: "Estéban Soubiran",
792
+ sameAs: [
793
+ "https://x.com/soubiran_",
794
+ "https://www.linkedin.com/in/esteban25",
795
+ "https://www.twitch.tv/barbapapazes",
796
+ "https://www.youtube.com/@barbapapazes",
797
+ "https://github.com/barbapapazes",
798
+ "https://soubiran.dev",
799
+ "https://esteban-soubiran.site",
800
+ "https://barbapapazes.dev"
801
+ ]
802
+ } };
803
+ return mergeConfig(defineConfig({
804
+ plugins: [
805
+ vueRouter({
806
+ extensions: [".vue", ".md"],
807
+ routesFolder: "pages",
808
+ dts: "src/typed-router.d.ts",
809
+ extendRoute(route) {
810
+ const path = route.components.get("default");
811
+ if (!path) return;
812
+ if (path.endsWith(".vue")) route.addToMeta({ frontmatter: { page: options.extractPage(path) } });
813
+ if (path.endsWith(".md")) {
814
+ const { data } = matter(readFileSync(path, "utf-8"));
815
+ route.addToMeta({ frontmatter: data });
816
+ }
802
817
  }
803
- }
804
- }),
805
- vue({ include: [/\.vue$/, /\.md$/] }),
806
- ui({
807
- autoImport: {
808
- dts: "src/auto-imports.d.ts",
809
- dirs: ["src/composables"],
810
- imports: [
811
- "vue",
812
- "vue-router",
813
- "@vueuse/core",
814
- unheadVueComposablesImports,
815
- {
816
- from: "tailwind-variants",
817
- imports: ["tv"]
818
- },
819
- soubiranComposablesImports
820
- ]
821
- },
822
- components: {
823
- include: [
824
- /\.vue$/,
825
- /\.vue\?vue/,
826
- /\.md$/
818
+ }),
819
+ vue({ include: [/\.vue$/, /\.md$/] }),
820
+ ui({
821
+ autoImport: {
822
+ dts: "src/auto-imports.d.ts",
823
+ dirs: ["src/composables"],
824
+ imports: [
825
+ "vue",
826
+ "vue-router",
827
+ "@vueuse/core",
828
+ unheadVueComposablesImports,
829
+ {
830
+ from: "tailwind-variants",
831
+ imports: ["tv"]
832
+ },
833
+ soubiranComposablesImports
834
+ ]
835
+ },
836
+ components: {
837
+ include: [
838
+ /\.vue$/,
839
+ /\.vue\?vue/,
840
+ /\.md$/
841
+ ],
842
+ dts: "src/components.d.ts",
843
+ resolvers: [soubiranResolver()]
844
+ },
845
+ ui: { colors: { neutral: "neutral" } }
846
+ }),
847
+ markdown({
848
+ headEnabled: true,
849
+ wrapperClasses: [
850
+ "slide-enter-content",
851
+ "max-w-none",
852
+ "prose prose-neutral dark:prose-invert",
853
+ "prose-headings:text-default prose-h2:text-[1.125em] prose-h2:mb-[0.5em] prose-h3:text-[1em]",
854
+ "prose-p:my-[1em] dark:prose-p:text-muted",
855
+ "dark:prose-ul:text-muted dark:prose-ol:text-muted",
856
+ "dark:prose-strong:text-default",
857
+ "dark:prose-a:text-muted prose-a:font-semibold prose-a:no-underline prose-a:border-b prose-a:border-muted prose-a:transition-colors prose-a:duration-300 prose-a:ease-out prose-a:hover:border-[var(--ui-text-dimmed)]",
858
+ "prose-hr:max-w-1/2 prose-hr:mx-auto prose-hr:my-[2em]",
859
+ "prose-figure:bg-neutral-100 dark:prose-figure:bg-neutral-800 prose-figure:rounded-lg",
860
+ "prose-img:rounded-lg prose-img:border prose-img:border-accented prose-img:shadow-md",
861
+ "prose-video:rounded-lg prose-video:border prose-video:border-accented prose-video:shadow-md",
862
+ "prose-figcaption:text-center prose-figcaption:py-1 prose-figcaption:m-0",
863
+ "[&_:first-child]:mt-0 [&_:last-child]:mb-0"
827
864
  ],
828
- dts: "src/components.d.ts",
829
- resolvers: [soubiranResolver()]
830
- },
831
- ui: { colors: { neutral: "neutral" } }
832
- }),
833
- markdown({
834
- headEnabled: true,
835
- wrapperClasses: [
836
- "slide-enter-content",
837
- "max-w-none",
838
- "prose prose-neutral dark:prose-invert",
839
- "prose-headings:text-default prose-h2:text-[1.125em] prose-h2:mb-[0.5em] prose-h3:text-[1em]",
840
- "prose-p:my-[1em] dark:prose-p:text-muted",
841
- "dark:prose-ul:text-muted dark:prose-ol:text-muted",
842
- "dark:prose-strong:text-default",
843
- "dark:prose-a:text-muted prose-a:font-semibold prose-a:no-underline prose-a:border-b prose-a:border-muted prose-a:transition-colors prose-a:duration-300 prose-a:ease-out prose-a:hover:border-[var(--ui-text-dimmed)]",
844
- "prose-hr:max-w-1/2 prose-hr:mx-auto prose-hr:my-[2em]",
845
- "prose-figure:bg-neutral-100 dark:prose-figure:bg-neutral-800 prose-figure:rounded-lg",
846
- "prose-img:rounded-lg prose-img:border prose-img:border-accented prose-img:shadow-md",
847
- "prose-video:rounded-lg prose-video:border prose-video:border-accented prose-video:shadow-md",
848
- "prose-figcaption:text-center prose-figcaption:py-1 prose-figcaption:m-0",
849
- "[&_:first-child]:mt-0 [&_:last-child]:mb-0"
850
- ],
851
- transforms: options.markdown?.transforms ?? {},
852
- wrapperComponent: options.markdown?.wrapperComponent,
853
- async markdownItSetup(md) {
854
- githubAlerts(md);
855
- implicitFiguresRule(md);
856
- linkAttributesRule(md);
857
- tableOfContentsRule(md);
858
- customLink(md, hostname);
859
- customImage(md, hostname);
860
- await shikiHighlight(md);
861
- },
862
- frontmatterPreprocess(frontmatter, frontmatterOptions, id, defaults) {
863
- createAssert(options.seo.assert?.rules)(id, frontmatter);
864
- og(id, frontmatter, hostname);
865
- canonical(id, frontmatter, hostname);
866
- structuredData(id, frontmatter, {
867
- name: title,
868
- hostname,
869
- person: options.seo.person,
870
- extractPage: options.extractPage,
871
- getPageConfig: options.seo.structuredData?.pageConfig
872
- });
873
- frontmatter.page = options.extractPage(id);
874
- return {
875
- head: defaults(frontmatter, frontmatterOptions),
876
- frontmatter
877
- };
878
- }
879
- }),
880
- fonts({ google: { families: [
881
- {
882
- name: "DM Sans",
883
- styles: "ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000"
884
- },
865
+ transforms: options.markdown?.transforms ?? {},
866
+ wrapperComponent: options.markdown?.wrapperComponent,
867
+ async markdownItSetup(md) {
868
+ githubAlerts(md);
869
+ implicitFiguresRule(md);
870
+ linkAttributesRule(md);
871
+ tableOfContentsRule(md);
872
+ customLink(md, hostname);
873
+ customImage(md, hostname);
874
+ await shikiHighlight(md);
875
+ },
876
+ frontmatterPreprocess(frontmatter, frontmatterOptions, id, defaults) {
877
+ createAssert(options.seo.assert?.rules)(id, frontmatter);
878
+ og(id, frontmatter, hostname);
879
+ canonical(id, frontmatter, hostname);
880
+ structuredData(id, frontmatter, {
881
+ name: title,
882
+ hostname,
883
+ person: options.seo.person ?? seo.person,
884
+ extractPage: options.extractPage,
885
+ getPageConfig: options.seo.structuredData?.pageConfig
886
+ });
887
+ frontmatter.page = options.extractPage(id);
888
+ return {
889
+ head: defaults(frontmatter, frontmatterOptions),
890
+ frontmatter
891
+ };
892
+ }
893
+ }),
894
+ fonts({ google: { families: [
895
+ {
896
+ name: "DM Sans",
897
+ styles: "ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000"
898
+ },
899
+ {
900
+ name: "DM Mono",
901
+ styles: "ital,wght@0,300;0,400;0,500;1,300;1,400;1,500"
902
+ },
903
+ {
904
+ name: "Sofia Sans",
905
+ styles: "ital,wght@0,1..1000;1,1..1000"
906
+ }
907
+ ] } }),
908
+ icons({ autoInstall: true }),
909
+ apiPlugin(options.apiCategories),
910
+ markdownPlugin(),
911
+ metaPlugin(hostname),
885
912
  {
886
- name: "DM Mono",
887
- styles: "ital,wght@0,300;0,400;0,500;1,300;1,400;1,500"
913
+ name: "await",
914
+ async closeBundle() {
915
+ await resolveAll();
916
+ }
888
917
  },
889
918
  {
890
- name: "Sofia Sans",
891
- styles: "ital,wght@0,1..1000;1,1..1000"
892
- }
893
- ] } }),
894
- icons({ autoInstall: true }),
895
- apiPlugin(options.apiCategories),
896
- markdownPlugin(),
897
- metaPlugin(hostname),
898
- {
899
- name: "await",
900
- async closeBundle() {
901
- await resolveAll();
902
- }
903
- },
904
- {
905
- name: "extract-config",
906
- configResolved(resolvedConfig) {
907
- Object.assign(config, resolvedConfig);
919
+ name: "extract-config",
920
+ configResolved(resolvedConfig) {
921
+ Object.assign(config, resolvedConfig);
922
+ }
908
923
  }
909
- }
910
- ],
911
- optimizeDeps: {
912
- include: [
913
- "vue",
914
- "ofetch",
915
- "reka-ui",
916
- "vue-router",
917
- "@unhead/vue",
918
- "partysocket",
919
- "@iconify/vue"
920
924
  ],
921
- exclude: ["@soubiran/ui"]
922
- },
923
- resolve: { alias: { "@": resolve("./src") } },
924
- ssgOptions: {
925
- formatting: "minify",
926
- onPageRendered(route, renderedHTML) {
927
- routes.add(route);
928
- return renderedHTML;
929
- },
930
- onFinished() {
931
- sitemap(config, hostname, Array.from(routes));
925
+ optimizeDeps: { exclude: ["@soubiran/ui"] },
926
+ resolve: { alias: { "@": resolve("./src") } },
927
+ ssgOptions: {
928
+ formatting: "minify",
929
+ onPageRendered(route, renderedHTML) {
930
+ routes.add(route);
931
+ return renderedHTML;
932
+ },
933
+ onFinished() {
934
+ sitemap(config, hostname, Array.from(routes));
935
+ }
932
936
  }
933
- }
934
- }), config);
937
+ }), config);
938
+ };
935
939
 
936
940
  //#endregion
937
941
  export { vite_config_default as default };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@soubiran/vite",
3
3
  "type": "module",
4
- "version": "0.1.4",
4
+ "version": "0.2.0",
5
5
  "author": "Estéban Soubiran <esteban@soubiran.dev>",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/Barbapapazes",
@@ -58,7 +58,7 @@
58
58
  "vite": "npm:rolldown-vite@7.1.20",
59
59
  "vite-ssg": "^28.2.2",
60
60
  "vue-router": "^4.6.3",
61
- "@soubiran/ui": "0.1.4"
61
+ "@soubiran/ui": "0.2.0"
62
62
  },
63
63
  "devDependencies": {
64
64
  "tsdown": "^0.18.3"