🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

create-payload-app

Package Overview
Dependencies
Maintainers
3
Versions
712
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-payload-app - npm Package Compare versions

Comparing version

to
3.40.0-canary.5

4

dist/lib/configure-plugin-project.js

@@ -10,6 +10,9 @@ import fse from 'fs-extra';

const indexTsPath = path.resolve(projectDirPath, './src/index.ts');
const devImportMapPath = path.resolve(projectDirPath, './dev/app/(payload)/admin/importMap.js');
const devPayloadConfig = fse.readFileSync(devPayloadConfigPath, 'utf8');
const devTsConfig = fse.readFileSync(devTsConfigPath, 'utf8');
const indexTs = fse.readFileSync(indexTsPath, 'utf-8');
const devImportMap = fse.readFileSync(devImportMapPath, 'utf-8');
const updatedTsConfig = devTsConfig.replaceAll('plugin-package-name-placeholder', projectName);
const updatedImportMap = devImportMap.replaceAll('plugin-package-name-placeholder', projectName);
let updatedIndexTs = indexTs.replaceAll('plugin-package-name-placeholder', projectName);

@@ -24,4 +27,5 @@ const pluginExportVariableName = toCamelCase(projectName);

fse.writeFileSync(indexTsPath, updatedIndexTs);
fse.writeFileSync(devImportMapPath, updatedImportMap);
};
//# sourceMappingURL=configure-plugin-project.js.map

@@ -61,2 +61,25 @@ import { jest } from '@jest/globals';

});
it('updates project name in plugin template importMap file', async ()=>{
const projectName = 'my-custom-plugin';
const template = {
name: 'plugin',
type: 'plugin',
description: 'Template for creating a Payload plugin',
url: 'https://github.com/payloadcms/payload/templates/plugin'
};
await createProject({
cliArgs: {
...args,
'--local-template': 'plugin'
},
packageManager,
projectDir,
projectName,
template
});
const importMapPath = path.resolve(projectDir, './dev/app/(payload)/admin/importMap.js');
const importMapFile = fse.readFileSync(importMapPath, 'utf-8');
expect(importMapFile).not.toContain('plugin-package-name-placeholder');
expect(importMapFile).toContain('my-custom-plugin');
});
it('creates example', async ()=>{

@@ -63,0 +86,0 @@ const projectName = 'custom-server-example';

2

package.json
{
"name": "create-payload-app",
"version": "3.40.0-canary.4",
"version": "3.40.0-canary.5",
"homepage": "https://payloadcms.com",

@@ -5,0 +5,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet