chore(scripts): devnew script

This commit is contained in:
Elliot DeNolf
2024-02-26 15:54:47 -05:00
parent a88b35f919
commit 6ba41af6dc
2 changed files with 26 additions and 0 deletions

View File

@@ -13,6 +13,7 @@
"clean:cache": "rimraf node_modules/.cache && rimraf packages/payload/node_modules/.cache",
"clean:unix": "find . \\( -type d \\( -name node_modules -o -name dist -o -name .cache \\) -o -type f -name tsconfig.tsbuildinfo \\) -exec rm -rf {} +",
"dev": "next dev",
"devnew": "cross-env node ./test/devnew.js",
"dev:generate-graphql-schema": "ts-node -T ./test/generateGraphQLSchema.ts",
"dev:generate-types": "ts-node -T ./test/generateTypes.ts",
"dev:postgres": "pnpm --filter payload run dev:postgres",

25
test/devnew.js Normal file
View File

@@ -0,0 +1,25 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const minimist = require('minimist')
const path = require('path')
const { nextDev } = require(path.resolve(__dirname, '..', 'node_modules/next/dist/cli/next-dev'))
main()
async function main() {
const {
_: [testSuiteArg],
...args
} = minimist(process.argv.slice(2))
if (args.turbo) {
process.env.TURBOPACK = '1'
}
const testSuite = testSuiteArg || '_community'
console.log('Using config:', testSuite, '\n')
const PAYLOAD_CONFIG_PATH = path.resolve(testSuite, 'config')
process.env.PAYLOAD_CONFIG_PATH = PAYLOAD_CONFIG_PATH
nextDev({ _: [path.resolve(__dirname, '..')] })
}