mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-09-11 15:26:19 +03:00
Moves resolveProjectPath
to wasp/dev
(#1759)
This commit is contained in:
parent
abcb1cb7b0
commit
0e7a951742
@ -1,4 +1,4 @@
|
||||
const { resolveProjectPath } = require('wasp/client')
|
||||
const { resolveProjectPath } = require('wasp/dev')
|
||||
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
|
@ -1,4 +1,4 @@
|
||||
const { resolveProjectPath } = require('wasp/client')
|
||||
const { resolveProjectPath } = require('wasp/dev')
|
||||
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
|
@ -1,4 +1,4 @@
|
||||
const { resolveProjectPath } = require('wasp/client')
|
||||
const { resolveProjectPath } = require('wasp/dev')
|
||||
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
|
@ -1,15 +1,3 @@
|
||||
import { join as joinPaths } from 'path';
|
||||
|
||||
// PUBLIC API
|
||||
/**
|
||||
* Wasp runs the client code in the `web-app` directory which is nested in the
|
||||
* .wasp/out/web-app directory. This function resolves a project root dir path
|
||||
* to be relative to the `web-app` directory i.e. `../../../projectDirPath`.
|
||||
*/
|
||||
export function resolveProjectPath(path: string): string {
|
||||
return joinPaths('../../../', path);
|
||||
}
|
||||
|
||||
// PUBLIC API
|
||||
// NOTE: This is enough to cover Operations and our APIs (src/Wasp/AppSpec/Api.hs).
|
||||
export enum HttpMethod {
|
||||
|
17
waspc/data/Generator/templates/sdk/dev/index.ts
Normal file
17
waspc/data/Generator/templates/sdk/dev/index.ts
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Code found in this module is not meant to be used in user's server or client
|
||||
* code. It is used by the Wasp tooling e.g. in the Tailwind config to resolve
|
||||
* paths to the project root directory.
|
||||
*/
|
||||
|
||||
import { join as joinPaths } from 'path'
|
||||
|
||||
// PUBLIC API
|
||||
/**
|
||||
* Wasp runs the client code in the `web-app` directory which is nested in the
|
||||
* .wasp/out/web-app directory. This function resolves a project root dir path
|
||||
* to be relative to the `web-app` directory i.e. `../../../projectDirPath`.
|
||||
*/
|
||||
export function resolveProjectPath(path: string): string {
|
||||
return joinPaths('../../../', path)
|
||||
}
|
@ -108,7 +108,8 @@
|
||||
"./server/operations": "./dist/server/operations/index.js",
|
||||
"./client/router": "./dist/client/router/index.js",
|
||||
"./client/test": "./dist/client/test/index.js",
|
||||
"./client": "./dist/client/index.js"
|
||||
"./client": "./dist/client/index.js",
|
||||
"./dev": "./dist/dev/index.js"
|
||||
},
|
||||
{=!
|
||||
TypeScript doesn't care about the redirects we define above in "exports" field; those
|
||||
|
@ -13,4 +13,3 @@ export { MiddlewareConfigFn } from './middleware/index.js'
|
||||
|
||||
// PUBLIC API
|
||||
export type DbSeedFn = (prisma: PrismaClient) => Promise<void>
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
const { resolveProjectPath } = require('wasp/client')
|
||||
const { resolveProjectPath } = require('wasp/dev')
|
||||
const { nextui } = require("@nextui-org/react");
|
||||
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
|
@ -1,4 +1,4 @@
|
||||
const { resolveProjectPath } = require('wasp/client')
|
||||
const { resolveProjectPath } = require('wasp/dev')
|
||||
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
|
@ -1,4 +1,4 @@
|
||||
const { resolveProjectPath } = require('wasp/client')
|
||||
const { resolveProjectPath } = require('wasp/dev')
|
||||
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
|
@ -296,7 +296,7 @@ generateTailwindConfigFile :: NewProjectDetails -> File
|
||||
generateTailwindConfigFile newProjectDetails =
|
||||
( "tailwind.config.cjs",
|
||||
[trimming|
|
||||
const { resolveProjectPath } = require('wasp/client')
|
||||
const { resolveProjectPath } = require('wasp/dev')
|
||||
const colors = require('tailwindcss/colors')
|
||||
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
|
@ -88,6 +88,7 @@ genSdkReal spec =
|
||||
genFileCopy [relfile|client/test/vitest/helpers.tsx|],
|
||||
genFileCopy [relfile|client/test/index.ts|],
|
||||
genFileCopy [relfile|client/index.ts|],
|
||||
genFileCopy [relfile|dev/index.ts|],
|
||||
genServerConfigFile spec,
|
||||
genTsConfigJson,
|
||||
genServerUtils spec,
|
||||
|
@ -40,7 +40,7 @@ Make sure to use the `.cjs` extension for these config files, if you name them w
|
||||
1. Add `./tailwind.config.cjs`.
|
||||
|
||||
```js title="./tailwind.config.cjs"
|
||||
const { resolveProjectPath } = require('wasp/client')
|
||||
const { resolveProjectPath } = require('wasp/dev')
|
||||
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
|
Loading…
Reference in New Issue
Block a user