-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: simplify runtime aliasing and mocking
- Loading branch information
Showing
43 changed files
with
420 additions
and
1,096 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,20 @@ | ||
const mockFn = (input: any) => input | ||
const noop = (input: any) => input | ||
|
||
export const useSchemaOrg = /* @__PURE__ */ mockFn | ||
export const injectSchemaOrg = /* @__PURE__ */ mockFn | ||
export const defineArticle = /* @__PURE__ */ mockFn | ||
export const defineBreadcrumb = /* @__PURE__ */ mockFn | ||
export const defineComment = /* @__PURE__ */ mockFn | ||
export const defineEvent = /* @__PURE__ */ mockFn | ||
export const defineHowTo = /* @__PURE__ */ mockFn | ||
export const defineOrganization = /* @__PURE__ */ mockFn | ||
export const definePerson = /* @__PURE__ */ mockFn | ||
export const defineImage = /* @__PURE__ */ mockFn | ||
export const defineLocalBusiness = /* @__PURE__ */ mockFn | ||
export const defineProduct = /* @__PURE__ */ mockFn | ||
export const defineQuestion = /* @__PURE__ */ mockFn | ||
export const defineReview = /* @__PURE__ */ mockFn | ||
export const defineRecipe = /* @__PURE__ */ mockFn | ||
export const defineVideo = /* @__PURE__ */ mockFn | ||
export const defineWebPage = /* @__PURE__ */ mockFn | ||
export const defineWebSite = /* @__PURE__ */ mockFn | ||
export const useSchemaOrg = /* @__PURE__ */ noop | ||
export const defineArticle = /* @__PURE__ */ noop | ||
export const defineBreadcrumb = /* @__PURE__ */ noop | ||
export const defineComment = /* @__PURE__ */ noop | ||
export const defineEvent = /* @__PURE__ */ noop | ||
export const defineHowTo = /* @__PURE__ */ noop | ||
export const defineOrganization = /* @__PURE__ */ noop | ||
export const definePerson = /* @__PURE__ */ noop | ||
export const defineImage = /* @__PURE__ */ noop | ||
export const defineLocalBusiness = /* @__PURE__ */ noop | ||
export const defineProduct = /* @__PURE__ */ noop | ||
export const defineQuestion = /* @__PURE__ */ noop | ||
export const defineReview = /* @__PURE__ */ noop | ||
export const defineRecipe = /* @__PURE__ */ noop | ||
export const defineVideo = /* @__PURE__ */ noop | ||
export const defineWebPage = /* @__PURE__ */ noop | ||
export const defineWebSite = /* @__PURE__ */ noop | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './nodes' | ||
export * from './SchemaOrgDebug' |
22 changes: 11 additions & 11 deletions
22
...es/schema-org/runtime/components/nodes.ts → ...ma-org/runtime-simple/components/nodes.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './useSchemaOrg' |
8 changes: 6 additions & 2 deletions
8
...a-org/runtime/composables/useSchemaOrg.ts → ...untime-simple/composables/useSchemaOrg.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
packages/schema-org/runtime/index.ts → packages/schema-org/runtime-simple/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
export * from './provider' | ||
export * from './composables' | ||
export * from './components' | ||
|
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
packages/schema-org/runtime/composables/injectSchemaOrg.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './createSchemaOrg' | ||
export * from './injectSchemaOrg' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { inject } from 'vue' | ||
import { PROVIDE_KEY } from './createSchemaOrg' | ||
import type { SchemaOrgVuePlugin } from './createSchemaOrg' | ||
|
||
export function injectSchemaOrg() { | ||
let client: SchemaOrgVuePlugin | undefined | ||
try { | ||
client = inject<SchemaOrgVuePlugin>(PROVIDE_KEY) | ||
} | ||
catch (e) {} | ||
|
||
if (!client) | ||
console.warn('[@vueuse/schema-org] Failed to find plugin, you may have forgotten to apply app.use(schemaOrg)') | ||
|
||
return client | ||
} |
Oops, something went wrong.