Skip to content

Commit 33c1a58

Browse files
committed
fix: removed 'payload' missed references [no ci]
1 parent fb82483 commit 33c1a58

File tree

33 files changed

+90
-85
lines changed

33 files changed

+90
-85
lines changed

packages/bundler-vite/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mzinga/bundler-vite",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"description": "The officially supported Vite bundler adapter for MZinga",
55
"repository": {
66
"type": "git",

packages/bundler-vite/src/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export const getViteConfig = async (payloadConfig: SanitizedConfig): Promise<Inl
9898
'@mzinga/db-postgres',
9999
...(Object.keys(absoluteAliases) || []),
100100
],
101-
include: ['payload/components/root', 'react-dom/client'],
101+
include: ['mzinga/components/root', 'react-dom/client'],
102102
},
103103
plugins: [
104104
{
@@ -140,7 +140,7 @@ export const getViteConfig = async (payloadConfig: SanitizedConfig): Promise<Inl
140140
root: path.resolve(__dirname, './'),
141141
server: {
142142
fs: {
143-
allow: [searchForWorkspaceRoot(process.cwd()), path.resolve(__dirname, '../../../payload')],
143+
allow: [searchForWorkspaceRoot(process.cwd()), path.resolve(__dirname, '../../../mzinga')],
144144
},
145145
hmr: {
146146
port: hmrPort,

packages/bundler-vite/src/entry.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Root } from 'mzinga/components/root'
22
// @ts-expect-error
3-
import config from 'payload-config'
3+
import config from 'mzinga-config'
44
import React from 'react'
55
import { createRoot } from 'react-dom/client'
66

packages/bundler-webpack/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mzinga/bundler-webpack",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"description": "The officially supported Webpack bundler adapter for MZinga",
55
"repository": {
66
"type": "git",

packages/bundler-webpack/src/configs/base.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ export const getBaseConfig = (payloadConfig: SanitizedConfig): Configuration =>
8888
dotenv: mockDotENVPath,
8989
path: require.resolve('path-browserify'),
9090
payload$: mockModulePath,
91-
'payload-config': payloadConfig.paths.rawConfig,
92-
'payload-user-css': payloadConfig.admin.css,
91+
mzinga$: mockModulePath,
92+
'mzinga-config': payloadConfig.paths.rawConfig,
93+
'mzinga-user-css': payloadConfig.admin.css,
9394
},
9495
extensions: ['.ts', '.tsx', '.js', '.json'],
9596
fallback: {

packages/create-mzinga-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-mzinga-app",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"license": "MIT",
55
"homepage": "https://mzinga.io",
66
"bin": {

packages/create-mzinga-app/src/lib/configure-payload-config.ts renamed to packages/create-mzinga-app/src/lib/configure-mzinga-config.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,26 @@ export async function configurePayloadConfig(args: {
4444

4545
try {
4646
const possiblePaths = [
47+
path.resolve(args.projectDir, 'src/mzinga.config.ts'),
48+
path.resolve(args.projectDir, 'src/mzinga/mzinga.config.ts'),
4749
path.resolve(args.projectDir, 'src/payload.config.ts'),
4850
path.resolve(args.projectDir, 'src/payload/payload.config.ts'),
4951
]
5052

51-
let payloadConfigPath: string | undefined
53+
let mzingaConfigPath: string | undefined
5254

5355
possiblePaths.forEach((p) => {
54-
if (fse.pathExistsSync(p) && !payloadConfigPath) {
55-
payloadConfigPath = p
56+
if (fse.pathExistsSync(p) && !mzingaConfigPath) {
57+
mzingaConfigPath = p
5658
}
5759
})
5860

59-
if (!payloadConfigPath) {
60-
warning('Unable to update payload.config.ts with plugins')
61+
if (!mzingaConfigPath) {
62+
warning('Unable to update mzinga.config.ts with plugins')
6163
return
6264
}
6365

64-
const configContent = fse.readFileSync(payloadConfigPath, 'utf-8')
66+
const configContent = fse.readFileSync(mzingaConfigPath, 'utf-8')
6567
const configLines = configContent.split('\n')
6668

6769
const dbReplacement = dbPackages[args.dbDetails.type]
@@ -100,7 +102,7 @@ export async function configurePayloadConfig(args: {
100102
})
101103

102104
if (!dbConfigStartLineIndex || !dbConfigEndLineIndex) {
103-
warning('Unable to update payload.config.ts with database adapter import')
105+
warning('Unable to update mzinga.config.ts with database adapter import')
104106
} else {
105107
// Replaces lines between `// database-adapter-config-start` and `// database-adapter-config-end`
106108
configLines.splice(
@@ -110,8 +112,8 @@ export async function configurePayloadConfig(args: {
110112
)
111113
}
112114

113-
fse.writeFileSync(payloadConfigPath, configLines.join('\n'))
115+
fse.writeFileSync(mzingaConfigPath, configLines.join('\n'))
114116
} catch (err: unknown) {
115-
warning('Unable to update payload.config.ts with plugins')
117+
warning('Unable to update mzinga.config.ts with plugins')
116118
}
117119
}

packages/create-mzinga-app/src/lib/create-project.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe('createProject', () => {
6060
name: 'plugin',
6161
type: 'plugin',
6262
url: 'https://github.com/mzinga-io/mzinga-core-plugin-template',
63-
description: 'Template for creating a Payload plugin',
63+
description: 'Template for creating a MZinga plugin',
6464
}
6565
await createProject({
6666
cliArgs: args,
@@ -112,7 +112,7 @@ describe('createProject', () => {
112112
const packageJson = fse.readJsonSync(packageJsonPath)
113113

114114
// Check deps
115-
expect(packageJson.dependencies['payload']).toEqual('^2.0.0')
115+
expect(packageJson.dependencies['mzinga']).toEqual('^0.0.1')
116116
expect(packageJson.dependencies[dbReplacement.packageName]).toEqual(dbReplacement.version)
117117

118118
// Should only have one db adapter
@@ -127,11 +127,11 @@ describe('createProject', () => {
127127
editorReplacement.version,
128128
)
129129

130-
let payloadConfigPath = path.resolve(projectDir, 'src/payload.config.ts')
130+
let payloadConfigPath = path.resolve(projectDir, 'src/mzinga.config.ts')
131131

132132
// Website and ecommerce templates have payload.config.ts in src/payload
133133
if (!fse.existsSync(payloadConfigPath)) {
134-
payloadConfigPath = path.resolve(projectDir, 'src/payload/payload.config.ts')
134+
payloadConfigPath = path.resolve(projectDir, 'src/mzinga/mzinga.config.ts')
135135
}
136136
const content = fse.readFileSync(payloadConfigPath, 'utf-8')
137137

packages/create-mzinga-app/src/lib/create-project.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import path from 'path'
88
import type { CliArgs, DbDetails, PackageManager, ProjectTemplate } from '../types'
99

1010
import { error, success, warning } from '../utils/log'
11-
import { configurePayloadConfig } from './configure-payload-config'
11+
import { configurePayloadConfig } from './configure-mzinga-config'
1212

1313
async function createOrFindProjectDir(projectDir: string): Promise<void> {
1414
const pathExists = await fse.pathExists(projectDir)
@@ -64,7 +64,7 @@ export async function createProject(args: {
6464
await emitter.clone(projectDir)
6565
}
6666

67-
const spinner = ora('Checking latest Payload version...').start()
67+
const spinner = ora('Checking latest MZinga version...').start()
6868

6969
await updatePackageJSON({ projectDir, projectName })
7070
await configurePayloadConfig({ dbDetails, projectDir })

packages/create-mzinga-app/src/lib/select-db.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export async function selectDb(args: CliArgs, projectName: string): Promise<DbDe
6262
{
6363
name: 'value',
6464
initial: `${dbChoice.dbConnectionPrefix}${
65-
projectName === '.' ? `payload-${getRandomDigitSuffix()}` : slugify(projectName)
65+
projectName === '.' ? `mzinga-${getRandomDigitSuffix()}` : slugify(projectName)
6666
}`,
6767
message: `Enter ${dbChoice.title.split(' ')[0]} connection string`, // strip beta from title
6868
type: 'text',

0 commit comments

Comments
 (0)