fix: strip .js extensions from SDK imports; restore turbopack dev
This commit is contained in:
@@ -3,15 +3,6 @@ import type { NextConfig } from 'next'
|
||||
const config: NextConfig = {
|
||||
reactStrictMode: true,
|
||||
transpilePackages: ['@solana/connector', '@solisting/sdk', '@descro/sdk'],
|
||||
webpack(webpackConfig) {
|
||||
// Workspace SDK packages use .js extensions on TypeScript imports (ESM convention)
|
||||
// but have no compiled output — webpack must resolve .js → .ts
|
||||
webpackConfig.resolve.extensionAlias = {
|
||||
'.js': ['.ts', '.tsx', '.js'],
|
||||
'.mjs': ['.mts', '.mjs'],
|
||||
}
|
||||
return webpackConfig
|
||||
},
|
||||
}
|
||||
|
||||
export default config
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "solisting-app",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"dev": "next dev --turbopack",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"typecheck": "tsc --noEmit"
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// Generated bindings — accounts, instructions, pdas, types, errors, program id
|
||||
export * from './generated/solisting/src/generated/index.js'
|
||||
export * from './generated/solisting/src/generated/index'
|
||||
|
||||
// Hand-written helpers
|
||||
export * from './pda.js'
|
||||
export * from './listing.js'
|
||||
export * from './pda'
|
||||
export * from './listing'
|
||||
// Order exports are imported but we exclude the re-exported deriveEscrowId to avoid duplication
|
||||
// since it's already exported from pda.js
|
||||
export type { OrderAccountWithPda } from './order.js'
|
||||
export { fetchOrdersForListing, fetchOrdersByBuyer, fetchOrder } from './order.js'
|
||||
export type { OrderAccountWithPda } from './order'
|
||||
export { fetchOrdersForListing, fetchOrdersByBuyer, fetchOrder } from './order'
|
||||
|
||||
// Re-export Address for consumers
|
||||
export type { Address, Account } from '@solana/kit'
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
fetchSolistingStateListingAccount,
|
||||
SOLISTING_STATE_LISTING_ACCOUNT_DISCRIMINATOR,
|
||||
type SolistingStateListingAccount,
|
||||
} from './generated/solisting/src/generated/index.js'
|
||||
} from './generated/solisting/src/generated/index'
|
||||
|
||||
const PROGRAM_ADDRESS = address('DzwUAbpRvqcbA8QsEkRbZeXG4TEho5782cMySodrUHBU')
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ import {
|
||||
fetchSolistingStateOrderAccount,
|
||||
SOLISTING_STATE_ORDER_ACCOUNT_DISCRIMINATOR,
|
||||
type SolistingStateOrderAccount,
|
||||
} from './generated/solisting/src/generated/index.js'
|
||||
import { deriveEscrowId } from './pda.js'
|
||||
} from './generated/solisting/src/generated/index'
|
||||
import { deriveEscrowId } from './pda'
|
||||
|
||||
const PROGRAM_ADDRESS = address('DzwUAbpRvqcbA8QsEkRbZeXG4TEho5782cMySodrUHBU')
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { address, getAddressEncoder, type Address, type ProgramDerivedAddress } from '@solana/kit'
|
||||
import { findListingAccountPda, findOrderAccountPda } from './generated/solisting/src/generated/index.js'
|
||||
import { findListingAccountPda, findOrderAccountPda } from './generated/solisting/src/generated/index'
|
||||
|
||||
const PROGRAM_ADDRESS = address('DzwUAbpRvqcbA8QsEkRbZeXG4TEho5782cMySodrUHBU')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user