docs: update imports and package names across docs (#9375)
* docs: update imports and package names across docs + reference configs * generate files * fix import * change preview to rc
This commit is contained in:
@@ -15,8 +15,8 @@ In this guide, you’ll find common examples of how you can use the Tax Module i
|
||||
|
||||
```ts
|
||||
import { MedusaRequest, MedusaResponse } from "@medusajs/medusa"
|
||||
import { ITaxModuleService } from "@medusajs/types"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
import { ITaxModuleService } from "@medusajs/framework/types"
|
||||
import { Modules } from "@medusajs/framework/utils"
|
||||
|
||||
export async function GET(
|
||||
req: MedusaRequest,
|
||||
@@ -46,7 +46,7 @@ export async function GET(
|
||||
```ts
|
||||
import { NextResponse } from "next/server"
|
||||
|
||||
import { initialize as initializeTaxModule } from "@medusajs/tax"
|
||||
import { initialize as initializeTaxModule } from "@medusajs/medusa/tax"
|
||||
|
||||
export async function POST(request: Request) {
|
||||
const taxModuleService = await initializeTaxModule()
|
||||
@@ -77,8 +77,8 @@ export async function POST(request: Request) {
|
||||
|
||||
```ts
|
||||
import { MedusaRequest, MedusaResponse } from "@medusajs/medusa"
|
||||
import { ITaxModuleService } from "@medusajs/types"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
import { ITaxModuleService } from "@medusajs/framework/types"
|
||||
import { Modules } from "@medusajs/framework/utils"
|
||||
|
||||
export async function GET(
|
||||
req: MedusaRequest,
|
||||
@@ -100,7 +100,7 @@ export async function GET(
|
||||
```ts
|
||||
import { NextResponse } from "next/server"
|
||||
|
||||
import { initialize as initializeTaxModule } from "@medusajs/tax"
|
||||
import { initialize as initializeTaxModule } from "@medusajs/medusa/tax"
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const taxModuleService = await initializeTaxModule()
|
||||
@@ -123,8 +123,8 @@ export async function GET(request: Request) {
|
||||
|
||||
```ts
|
||||
import { MedusaRequest, MedusaResponse } from "@medusajs/medusa"
|
||||
import { ITaxModuleService } from "@medusajs/types"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
import { ITaxModuleService } from "@medusajs/framework/types"
|
||||
import { Modules } from "@medusajs/framework/utils"
|
||||
|
||||
export async function POST(
|
||||
req: MedusaRequest,
|
||||
@@ -162,7 +162,7 @@ export async function POST(
|
||||
```ts
|
||||
import { NextResponse } from "next/server"
|
||||
|
||||
import { initialize as initializeTaxModule } from "@medusajs/tax"
|
||||
import { initialize as initializeTaxModule } from "@medusajs/medusa/tax"
|
||||
|
||||
export async function POST(request: Request) {
|
||||
const taxModuleService = await initializeTaxModule()
|
||||
@@ -201,8 +201,8 @@ export async function POST(request: Request) {
|
||||
|
||||
```ts
|
||||
import { MedusaRequest, MedusaResponse } from "@medusajs/medusa"
|
||||
import { ITaxModuleService } from "@medusajs/types"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
import { ITaxModuleService } from "@medusajs/framework/types"
|
||||
import { Modules } from "@medusajs/framework/utils"
|
||||
|
||||
export async function GET(
|
||||
req: MedusaRequest,
|
||||
@@ -224,7 +224,7 @@ export async function GET(
|
||||
```ts
|
||||
import { NextResponse } from "next/server"
|
||||
|
||||
import { initialize as initializeTaxModule } from "@medusajs/tax"
|
||||
import { initialize as initializeTaxModule } from "@medusajs/medusa/tax"
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const taxModuleService = await initializeTaxModule()
|
||||
@@ -247,8 +247,8 @@ export async function GET(request: Request) {
|
||||
|
||||
```ts
|
||||
import { MedusaRequest, MedusaResponse } from "@medusajs/medusa"
|
||||
import { ITaxModuleService } from "@medusajs/types"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
import { ITaxModuleService } from "@medusajs/framework/types"
|
||||
import { Modules } from "@medusajs/framework/utils"
|
||||
|
||||
export async function GET(
|
||||
req: MedusaRequest,
|
||||
@@ -296,7 +296,7 @@ export async function GET(
|
||||
```ts
|
||||
import { NextResponse } from "next/server"
|
||||
|
||||
import { initialize as initializeTaxModule } from "@medusajs/tax"
|
||||
import { initialize as initializeTaxModule } from "@medusajs/medusa/tax"
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const taxModuleService = await initializeTaxModule()
|
||||
|
||||
@@ -19,7 +19,7 @@ The `providers` option is an array of either tax module providers, tax plugins,
|
||||
When the Medusa application starts, these providers are registered and can be used to retrieve tax lines.
|
||||
|
||||
```js title="medusa-config.js"
|
||||
const { Modules } = require("@medusajs/utils")
|
||||
const { Modules } = require("@medusajs/framework/utils")
|
||||
|
||||
// ...
|
||||
|
||||
@@ -27,7 +27,7 @@ module.exports = defineConfig({
|
||||
// ...
|
||||
modules: {
|
||||
[Modules.TAX]: {
|
||||
resolve: "@medusajs/tax",
|
||||
resolve: "@medusajs/medusa/tax",
|
||||
options: {
|
||||
providers: [
|
||||
{
|
||||
|
||||
@@ -6,11 +6,11 @@ export const metadata = {
|
||||
|
||||
# {metadata.title}
|
||||
|
||||
The Tax Module is the `@medusajs/tax` NPM package that provides tax-related features in your Medusa and Node.js applications.
|
||||
The Tax Module is the `@medusajs/medusa/tax` NPM package that provides tax-related features in your Medusa and Node.js applications.
|
||||
|
||||
## How to Use Tax Module's Service
|
||||
|
||||
You can use the Tax Module's main service by resolving from the Medusa container the resource `Modules.TAX` imported from `@medusajs/utils`.
|
||||
You can use the Tax Module's main service by resolving from the Medusa container the resource `Modules.TAX` imported from `@medusajs/framework/utils`.
|
||||
|
||||
For example:
|
||||
|
||||
@@ -19,8 +19,8 @@ For example:
|
||||
|
||||
```ts title="src/api/store/custom/route.ts"
|
||||
import { MedusaRequest, MedusaResponse } from "@medusajs/medusa"
|
||||
import { ITaxModuleService } from "@medusajs/types"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
import { ITaxModuleService } from "@medusajs/framework/types"
|
||||
import { Modules } from "@medusajs/framework/utils"
|
||||
|
||||
export async function GET(
|
||||
req: MedusaRequest,
|
||||
@@ -41,8 +41,8 @@ export async function GET(
|
||||
|
||||
```ts title="src/subscribers/custom-handler.ts"
|
||||
import { SubscriberArgs } from "@medusajs/medusa"
|
||||
import { ITaxModuleService } from "@medusajs/types"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
import { ITaxModuleService } from "@medusajs/framework/types"
|
||||
import { Modules } from "@medusajs/framework/utils"
|
||||
|
||||
export default async function subscriberHandler({ container }: SubscriberArgs) {
|
||||
const taxModuleService: ITaxModuleService = container.resolve(
|
||||
@@ -57,9 +57,9 @@ export default async function subscriberHandler({ container }: SubscriberArgs) {
|
||||
<CodeTab label="Workflow Step" value="workflow-step">
|
||||
|
||||
```ts title="src/workflows/hello-world/step1.ts"
|
||||
import { createStep } from "@medusajs/workflows-sdk"
|
||||
import { ITaxModuleService } from "@medusajs/types"
|
||||
import { Modules } from "@medusajs/utils"
|
||||
import { createStep } from "@medusajs/framework/workflows-sdk"
|
||||
import { ITaxModuleService } from "@medusajs/framework/types"
|
||||
import { Modules } from "@medusajs/framework/utils"
|
||||
|
||||
const step1 = createStep("step-1", async (_, { container }) => {
|
||||
const taxModuleService: ITaxModuleService = container.resolve(
|
||||
|
||||
Reference in New Issue
Block a user