@payloadcms/figma 0.0.1-alpha.1 → 0.0.1-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/control-plane.d.ts.map +1 -1
- package/dist/api/control-plane.js +2 -7
- package/dist/api/control-plane.js.map +1 -1
- package/dist/api/figma-api.js +3 -3
- package/dist/api/figma-api.js.map +1 -1
- package/dist/auth/jwt-validator.js.map +1 -1
- package/dist/auth/oauth-flow.d.ts.map +1 -1
- package/dist/auth/oauth-flow.js +3 -6
- package/dist/auth/oauth-flow.js.map +1 -1
- package/dist/auth/project-token.d.ts.map +1 -1
- package/dist/auth/project-token.js +1 -4
- package/dist/auth/project-token.js.map +1 -1
- package/dist/auth/refresh.d.ts.map +1 -1
- package/dist/auth/refresh.js +19 -28
- package/dist/auth/refresh.js.map +1 -1
- package/dist/auth/types.d.ts +1 -1
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/auth/types.js.map +1 -1
- package/dist/cli.js +1 -3
- package/dist/cli.js.map +1 -1
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +17 -10
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/init.d.ts +4 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +21 -85
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/list-tokens.d.ts +1 -1
- package/dist/commands/list-tokens.d.ts.map +1 -1
- package/dist/commands/list-tokens.js +6 -5
- package/dist/commands/list-tokens.js.map +1 -1
- package/dist/commands/login.d.ts +2 -11
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +4 -7
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logout.d.ts +1 -1
- package/dist/commands/logout.js +1 -1
- package/dist/commands/logout.js.map +1 -1
- package/dist/exports/client.d.ts +3 -0
- package/dist/exports/client.d.ts.map +1 -0
- package/dist/exports/client.js +4 -0
- package/dist/exports/client.js.map +1 -0
- package/dist/oauth/components/LoginButton/index.d.ts +9 -0
- package/dist/oauth/components/LoginButton/index.d.ts.map +1 -0
- package/dist/oauth/components/LoginButton/index.js +52 -0
- package/dist/oauth/components/LoginButton/index.js.map +1 -0
- package/dist/oauth/components/LoginButton/index.scss +10 -0
- package/dist/oauth/components/LogoutButton/index.d.ts +7 -0
- package/dist/oauth/components/LogoutButton/index.d.ts.map +1 -0
- package/dist/oauth/components/LogoutButton/index.js +67 -0
- package/dist/oauth/components/LogoutButton/index.js.map +1 -0
- package/dist/oauth/components/LogoutButton/index.scss +10 -0
- package/dist/oauth/defaults.d.ts +10 -0
- package/dist/oauth/defaults.d.ts.map +1 -0
- package/dist/oauth/defaults.js +91 -0
- package/dist/oauth/defaults.js.map +1 -0
- package/dist/oauth/endpoints/getLoginEndpoint.d.ts +13 -0
- package/dist/oauth/endpoints/getLoginEndpoint.d.ts.map +1 -0
- package/dist/oauth/endpoints/getLoginEndpoint.js +237 -0
- package/dist/oauth/endpoints/getLoginEndpoint.js.map +1 -0
- package/dist/oauth/endpoints/getLogoutEndpoint.d.ts +12 -0
- package/dist/oauth/endpoints/getLogoutEndpoint.d.ts.map +1 -0
- package/dist/oauth/endpoints/getLogoutEndpoint.js +99 -0
- package/dist/oauth/endpoints/getLogoutEndpoint.js.map +1 -0
- package/dist/oauth/endpoints/getMetaEndpoint.d.ts +13 -0
- package/dist/oauth/endpoints/getMetaEndpoint.d.ts.map +1 -0
- package/dist/oauth/endpoints/getMetaEndpoint.js +25 -0
- package/dist/oauth/endpoints/getMetaEndpoint.js.map +1 -0
- package/dist/oauth/endpoints/getRedirectToLoginEndpoint.d.ts +13 -0
- package/dist/oauth/endpoints/getRedirectToLoginEndpoint.d.ts.map +1 -0
- package/dist/oauth/endpoints/getRedirectToLoginEndpoint.js +21 -0
- package/dist/oauth/endpoints/getRedirectToLoginEndpoint.js.map +1 -0
- package/dist/oauth/exports/client.d.ts +3 -0
- package/dist/oauth/exports/client.d.ts.map +1 -0
- package/dist/oauth/exports/client.js +4 -0
- package/dist/oauth/exports/client.js.map +1 -0
- package/dist/oauth/hooks/afterLogout.d.ts +8 -0
- package/dist/oauth/hooks/afterLogout.d.ts.map +1 -0
- package/dist/oauth/hooks/afterLogout.js +27 -0
- package/dist/oauth/hooks/afterLogout.js.map +1 -0
- package/dist/oauth/hooks/me.d.ts +5 -0
- package/dist/oauth/hooks/me.d.ts.map +1 -0
- package/dist/oauth/hooks/me.js +55 -0
- package/dist/oauth/hooks/me.js.map +1 -0
- package/dist/oauth/hooks/refresh.d.ts +8 -0
- package/dist/oauth/hooks/refresh.d.ts.map +1 -0
- package/dist/oauth/hooks/refresh.js +91 -0
- package/dist/oauth/hooks/refresh.js.map +1 -0
- package/dist/oauth/index.d.ts +4 -0
- package/dist/oauth/index.d.ts.map +1 -0
- package/dist/oauth/index.js +222 -0
- package/dist/oauth/index.js.map +1 -0
- package/dist/oauth/strategy/index.d.ts +54 -0
- package/dist/oauth/strategy/index.d.ts.map +1 -0
- package/dist/oauth/strategy/index.js +280 -0
- package/dist/oauth/strategy/index.js.map +1 -0
- package/dist/oauth/types.d.ts +192 -0
- package/dist/oauth/types.d.ts.map +1 -0
- package/dist/oauth/types.js +3 -0
- package/dist/oauth/types.js.map +1 -0
- package/dist/oauth/utilities/clearCookie.d.ts +9 -0
- package/dist/oauth/utilities/clearCookie.d.ts.map +1 -0
- package/dist/oauth/utilities/clearCookie.js +21 -0
- package/dist/oauth/utilities/clearCookie.js.map +1 -0
- package/dist/oauth/utilities/createCookieOptions.d.ts +10 -0
- package/dist/oauth/utilities/createCookieOptions.d.ts.map +1 -0
- package/dist/oauth/utilities/createCookieOptions.js +42 -0
- package/dist/oauth/utilities/createCookieOptions.js.map +1 -0
- package/dist/oauth/utilities/createDebugLogger.d.ts +4 -0
- package/dist/oauth/utilities/createDebugLogger.d.ts.map +1 -0
- package/dist/oauth/utilities/createDebugLogger.js +16 -0
- package/dist/oauth/utilities/createDebugLogger.js.map +1 -0
- package/dist/oauth/utilities/extractOrigin.d.ts +2 -0
- package/dist/oauth/utilities/extractOrigin.d.ts.map +1 -0
- package/dist/oauth/utilities/extractOrigin.js +12 -0
- package/dist/oauth/utilities/extractOrigin.js.map +1 -0
- package/dist/oauth/utilities/getAdminCollectionSlug.d.ts +3 -0
- package/dist/oauth/utilities/getAdminCollectionSlug.d.ts.map +1 -0
- package/dist/oauth/utilities/getAdminCollectionSlug.js +18 -0
- package/dist/oauth/utilities/getAdminCollectionSlug.js.map +1 -0
- package/dist/oauth/utilities/getAdminPath.d.ts +8 -0
- package/dist/oauth/utilities/getAdminPath.d.ts.map +1 -0
- package/dist/oauth/utilities/getAdminPath.js +9 -0
- package/dist/oauth/utilities/getAdminPath.js.map +1 -0
- package/dist/oauth/utilities/getAuthorizeURL.d.ts +17 -0
- package/dist/oauth/utilities/getAuthorizeURL.d.ts.map +1 -0
- package/dist/oauth/utilities/getAuthorizeURL.js +45 -0
- package/dist/oauth/utilities/getAuthorizeURL.js.map +1 -0
- package/dist/oauth/utilities/getCookieExpiration.d.ts +4 -0
- package/dist/oauth/utilities/getCookieExpiration.d.ts.map +1 -0
- package/dist/oauth/utilities/getCookieExpiration.js +11 -0
- package/dist/oauth/utilities/getCookieExpiration.js.map +1 -0
- package/dist/oauth/utilities/getSecondsFromTokenExp.d.ts +2 -0
- package/dist/oauth/utilities/getSecondsFromTokenExp.d.ts.map +1 -0
- package/dist/oauth/utilities/getSecondsFromTokenExp.js +7 -0
- package/dist/oauth/utilities/getSecondsFromTokenExp.js.map +1 -0
- package/dist/oauth/utilities/getTokenExp.d.ts +6 -0
- package/dist/oauth/utilities/getTokenExp.d.ts.map +1 -0
- package/dist/oauth/utilities/getTokenExp.js +20 -0
- package/dist/oauth/utilities/getTokenExp.js.map +1 -0
- package/dist/oauth/utilities/getUsernameField.d.ts +9 -0
- package/dist/oauth/utilities/getUsernameField.d.ts.map +1 -0
- package/dist/oauth/utilities/getUsernameField.js +20 -0
- package/dist/oauth/utilities/getUsernameField.js.map +1 -0
- package/dist/oauth/utilities/hasUserTokenPropsChanged.d.ts +8 -0
- package/dist/oauth/utilities/hasUserTokenPropsChanged.d.ts.map +1 -0
- package/dist/oauth/utilities/hasUserTokenPropsChanged.js +25 -0
- package/dist/oauth/utilities/hasUserTokenPropsChanged.js.map +1 -0
- package/dist/oauth/utilities/mergeHeaders.d.ts +2 -0
- package/dist/oauth/utilities/mergeHeaders.d.ts.map +1 -0
- package/dist/oauth/utilities/mergeHeaders.js +37 -0
- package/dist/oauth/utilities/mergeHeaders.js.map +1 -0
- package/dist/oauth/utilities/refreshTokens.d.ts +16 -0
- package/dist/oauth/utilities/refreshTokens.d.ts.map +1 -0
- package/dist/oauth/utilities/refreshTokens.js +67 -0
- package/dist/oauth/utilities/refreshTokens.js.map +1 -0
- package/dist/plugin/build-config.d.ts +7 -1
- package/dist/plugin/build-config.d.ts.map +1 -1
- package/dist/plugin/build-config.js +29 -2
- package/dist/plugin/build-config.js.map +1 -1
- package/dist/types/config.d.ts +0 -11
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js +1 -1
- package/dist/types/config.js.map +1 -1
- package/dist/utils/config.d.ts +0 -22
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +0 -46
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/messages.js +11 -11
- package/dist/utils/messages.js.map +1 -1
- package/dist/utils/payload-config-ast.d.ts +17 -1
- package/dist/utils/payload-config-ast.d.ts.map +1 -1
- package/dist/utils/payload-config-ast.js +166 -14
- package/dist/utils/payload-config-ast.js.map +1 -1
- package/dist/utils/payload-config-modifier.d.ts +2 -1
- package/dist/utils/payload-config-modifier.d.ts.map +1 -1
- package/dist/utils/payload-config-modifier.js +50 -79
- package/dist/utils/payload-config-modifier.js.map +1 -1
- package/dist/utils/payload-package-check.d.ts.map +1 -1
- package/dist/utils/payload-package-check.js +14 -33
- package/dist/utils/payload-package-check.js.map +1 -1
- package/dist/utils/project.d.ts +1 -1
- package/dist/utils/project.d.ts.map +1 -1
- package/dist/utils/project.js +3 -5
- package/dist/utils/project.js.map +1 -1
- package/dist/utils/s3-upload.d.ts.map +1 -1
- package/dist/utils/s3-upload.js +3 -8
- package/dist/utils/s3-upload.js.map +1 -1
- package/dist/utils/token-display.d.ts.map +1 -1
- package/dist/utils/token-display.js +3 -2
- package/dist/utils/token-display.js.map +1 -1
- package/package.json +9 -3
- package/dist/api/control-plane.spec.d.ts +0 -2
- package/dist/api/control-plane.spec.d.ts.map +0 -1
- package/dist/api/control-plane.spec.js +0 -296
- package/dist/api/control-plane.spec.js.map +0 -1
- package/dist/api/figma-api.spec.d.ts +0 -14
- package/dist/api/figma-api.spec.d.ts.map +0 -1
- package/dist/api/figma-api.spec.js +0 -201
- package/dist/api/figma-api.spec.js.map +0 -1
- package/dist/auth/__tests__/fixtures.d.ts +0 -26
- package/dist/auth/__tests__/fixtures.d.ts.map +0 -1
- package/dist/auth/__tests__/fixtures.js +0 -67
- package/dist/auth/__tests__/fixtures.js.map +0 -1
- package/dist/auth/__tests__/mocks.d.ts +0 -33
- package/dist/auth/__tests__/mocks.d.ts.map +0 -1
- package/dist/auth/__tests__/mocks.js +0 -63
- package/dist/auth/__tests__/mocks.js.map +0 -1
- package/dist/auth/callback-server.spec.d.ts +0 -2
- package/dist/auth/callback-server.spec.d.ts.map +0 -1
- package/dist/auth/callback-server.spec.js +0 -85
- package/dist/auth/callback-server.spec.js.map +0 -1
- package/dist/auth/crypto-utils.spec.d.ts +0 -2
- package/dist/auth/crypto-utils.spec.d.ts.map +0 -1
- package/dist/auth/crypto-utils.spec.js +0 -36
- package/dist/auth/crypto-utils.spec.js.map +0 -1
- package/dist/auth/jwt-validator.spec.d.ts +0 -10
- package/dist/auth/jwt-validator.spec.d.ts.map +0 -1
- package/dist/auth/jwt-validator.spec.js +0 -236
- package/dist/auth/jwt-validator.spec.js.map +0 -1
- package/dist/auth/oauth-flow.spec.d.ts +0 -2
- package/dist/auth/oauth-flow.spec.d.ts.map +0 -1
- package/dist/auth/oauth-flow.spec.js +0 -134
- package/dist/auth/oauth-flow.spec.js.map +0 -1
- package/dist/auth/pkce.spec.d.ts +0 -2
- package/dist/auth/pkce.spec.d.ts.map +0 -1
- package/dist/auth/pkce.spec.js +0 -32
- package/dist/auth/pkce.spec.js.map +0 -1
- package/dist/auth/project-token.spec.d.ts +0 -2
- package/dist/auth/project-token.spec.d.ts.map +0 -1
- package/dist/auth/project-token.spec.js +0 -332
- package/dist/auth/project-token.spec.js.map +0 -1
- package/dist/auth/refresh.spec.d.ts +0 -2
- package/dist/auth/refresh.spec.d.ts.map +0 -1
- package/dist/auth/refresh.spec.js +0 -105
- package/dist/auth/refresh.spec.js.map +0 -1
- package/dist/auth/token-store.spec.d.ts +0 -2
- package/dist/auth/token-store.spec.d.ts.map +0 -1
- package/dist/auth/token-store.spec.js +0 -276
- package/dist/auth/token-store.spec.js.map +0 -1
- package/dist/commands/__tests__/test-utils.d.ts +0 -28
- package/dist/commands/__tests__/test-utils.d.ts.map +0 -1
- package/dist/commands/__tests__/test-utils.js +0 -34
- package/dist/commands/__tests__/test-utils.js.map +0 -1
- package/dist/commands/deploy.spec.d.ts +0 -2
- package/dist/commands/deploy.spec.d.ts.map +0 -1
- package/dist/commands/deploy.spec.js +0 -18
- package/dist/commands/deploy.spec.js.map +0 -1
- package/dist/commands/init.spec.d.ts +0 -2
- package/dist/commands/init.spec.d.ts.map +0 -1
- package/dist/commands/init.spec.js +0 -283
- package/dist/commands/init.spec.js.map +0 -1
- package/dist/plugin/build-config.spec.d.ts +0 -2
- package/dist/plugin/build-config.spec.d.ts.map +0 -1
- package/dist/plugin/build-config.spec.js +0 -72
- package/dist/plugin/build-config.spec.js.map +0 -1
- package/dist/utils/asset-collection.spec.d.ts +0 -2
- package/dist/utils/asset-collection.spec.d.ts.map +0 -1
- package/dist/utils/asset-collection.spec.js +0 -155
- package/dist/utils/asset-collection.spec.js.map +0 -1
- package/dist/utils/build-detection.spec.d.ts +0 -2
- package/dist/utils/build-detection.spec.d.ts.map +0 -1
- package/dist/utils/build-detection.spec.js +0 -110
- package/dist/utils/build-detection.spec.js.map +0 -1
- package/dist/utils/config.spec.d.ts +0 -2
- package/dist/utils/config.spec.d.ts.map +0 -1
- package/dist/utils/config.spec.js +0 -167
- package/dist/utils/config.spec.js.map +0 -1
- package/dist/utils/download-template.spec.d.ts +0 -2
- package/dist/utils/download-template.spec.d.ts.map +0 -1
- package/dist/utils/download-template.spec.js +0 -76
- package/dist/utils/download-template.spec.js.map +0 -1
- package/dist/utils/env-management.spec.d.ts +0 -2
- package/dist/utils/env-management.spec.d.ts.map +0 -1
- package/dist/utils/env-management.spec.js +0 -123
- package/dist/utils/env-management.spec.js.map +0 -1
- package/dist/utils/git.spec.d.ts +0 -2
- package/dist/utils/git.spec.d.ts.map +0 -1
- package/dist/utils/git.spec.js +0 -99
- package/dist/utils/git.spec.js.map +0 -1
- package/dist/utils/lambda-config.spec.d.ts +0 -2
- package/dist/utils/lambda-config.spec.d.ts.map +0 -1
- package/dist/utils/lambda-config.spec.js +0 -141
- package/dist/utils/lambda-config.spec.js.map +0 -1
- package/dist/utils/payload-config-ast.spec.d.ts +0 -2
- package/dist/utils/payload-config-ast.spec.d.ts.map +0 -1
- package/dist/utils/payload-config-ast.spec.js +0 -303
- package/dist/utils/payload-config-ast.spec.js.map +0 -1
- package/dist/utils/payload-config-modifier.int.spec.d.ts +0 -2
- package/dist/utils/payload-config-modifier.int.spec.d.ts.map +0 -1
- package/dist/utils/payload-config-modifier.int.spec.js +0 -116
- package/dist/utils/payload-config-modifier.int.spec.js.map +0 -1
- package/dist/utils/payload-config-modifier.spec.d.ts +0 -2
- package/dist/utils/payload-config-modifier.spec.d.ts.map +0 -1
- package/dist/utils/payload-config-modifier.spec.js +0 -162
- package/dist/utils/payload-config-modifier.spec.js.map +0 -1
- package/dist/utils/payload-package-check.spec.d.ts +0 -2
- package/dist/utils/payload-package-check.spec.d.ts.map +0 -1
- package/dist/utils/payload-package-check.spec.js +0 -148
- package/dist/utils/payload-package-check.spec.js.map +0 -1
- package/dist/utils/project.spec.d.ts +0 -2
- package/dist/utils/project.spec.d.ts.map +0 -1
- package/dist/utils/project.spec.js +0 -222
- package/dist/utils/project.spec.js.map +0 -1
- package/dist/utils/s3-upload.spec.d.ts +0 -2
- package/dist/utils/s3-upload.spec.d.ts.map +0 -1
- package/dist/utils/s3-upload.spec.js +0 -140
- package/dist/utils/s3-upload.spec.js.map +0 -1
package/dist/utils/git.spec.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { execSync } from 'child_process';
|
|
2
|
-
import fs from 'fs/promises';
|
|
3
|
-
import os from 'os';
|
|
4
|
-
import path from 'path';
|
|
5
|
-
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
|
6
|
-
import { isGitRepo, tryInitRepoAndCommit } from './git.js';
|
|
7
|
-
describe('git utilities', ()=>{
|
|
8
|
-
let testDir;
|
|
9
|
-
beforeEach(async ()=>{
|
|
10
|
-
// Create test directory in OS temp directory to avoid parent git repo
|
|
11
|
-
testDir = path.join(os.tmpdir(), `figma-cli-git-test-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`);
|
|
12
|
-
await fs.mkdir(testDir, {
|
|
13
|
-
recursive: true
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
afterEach(async ()=>{
|
|
17
|
-
try {
|
|
18
|
-
await fs.rm(testDir, {
|
|
19
|
-
force: true,
|
|
20
|
-
recursive: true
|
|
21
|
-
});
|
|
22
|
-
} catch {
|
|
23
|
-
// Ignore cleanup errors
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
describe('isGitRepo', ()=>{
|
|
27
|
-
it('should return false for non-git directory', ()=>{
|
|
28
|
-
expect(isGitRepo(testDir)).toBe(false);
|
|
29
|
-
});
|
|
30
|
-
it('should return true for git repository', ()=>{
|
|
31
|
-
execSync('git init', {
|
|
32
|
-
cwd: testDir,
|
|
33
|
-
stdio: 'ignore'
|
|
34
|
-
});
|
|
35
|
-
expect(isGitRepo(testDir)).toBe(true);
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
describe('tryInitRepoAndCommit', ()=>{
|
|
39
|
-
it('should initialize git repo and create initial commit', async ()=>{
|
|
40
|
-
// Create a file to commit
|
|
41
|
-
await fs.writeFile(path.join(testDir, 'README.md'), '# Test Project');
|
|
42
|
-
const result = tryInitRepoAndCommit(testDir);
|
|
43
|
-
expect(result).toBe(true);
|
|
44
|
-
expect(isGitRepo(testDir)).toBe(true);
|
|
45
|
-
// Verify commit exists
|
|
46
|
-
const log = execSync('git log --oneline', {
|
|
47
|
-
cwd: testDir,
|
|
48
|
-
encoding: 'utf-8'
|
|
49
|
-
});
|
|
50
|
-
expect(log).toContain('feat: initial commit');
|
|
51
|
-
});
|
|
52
|
-
it('should return false if already a git repo', ()=>{
|
|
53
|
-
execSync('git init', {
|
|
54
|
-
cwd: testDir,
|
|
55
|
-
stdio: 'ignore'
|
|
56
|
-
});
|
|
57
|
-
const result = tryInitRepoAndCommit(testDir);
|
|
58
|
-
expect(result).toBe(false);
|
|
59
|
-
});
|
|
60
|
-
it('should create main branch when no default configured', async ()=>{
|
|
61
|
-
await fs.writeFile(path.join(testDir, 'README.md'), '# Test Project');
|
|
62
|
-
tryInitRepoAndCommit(testDir);
|
|
63
|
-
const branch = execSync('git branch --show-current', {
|
|
64
|
-
cwd: testDir,
|
|
65
|
-
encoding: 'utf-8'
|
|
66
|
-
});
|
|
67
|
-
expect(branch.trim()).toBe('main');
|
|
68
|
-
});
|
|
69
|
-
it('should stage all files for initial commit', async ()=>{
|
|
70
|
-
await fs.writeFile(path.join(testDir, 'file1.txt'), 'content 1');
|
|
71
|
-
await fs.writeFile(path.join(testDir, 'file2.txt'), 'content 2');
|
|
72
|
-
await fs.mkdir(path.join(testDir, 'subdir'));
|
|
73
|
-
await fs.writeFile(path.join(testDir, 'subdir', 'file3.txt'), 'content 3');
|
|
74
|
-
tryInitRepoAndCommit(testDir);
|
|
75
|
-
// Check that all files are committed
|
|
76
|
-
const files = execSync('git ls-files', {
|
|
77
|
-
cwd: testDir,
|
|
78
|
-
encoding: 'utf-8'
|
|
79
|
-
});
|
|
80
|
-
expect(files).toContain('file1.txt');
|
|
81
|
-
expect(files).toContain('file2.txt');
|
|
82
|
-
expect(files).toContain('subdir/file3.txt');
|
|
83
|
-
});
|
|
84
|
-
it('should handle empty directory gracefully', ()=>{
|
|
85
|
-
// Empty directory should still create repo but commit might fail
|
|
86
|
-
const result = tryInitRepoAndCommit(testDir);
|
|
87
|
-
// Either succeeds with empty commit or fails gracefully
|
|
88
|
-
// Both are acceptable behaviors
|
|
89
|
-
if (result) {
|
|
90
|
-
expect(isGitRepo(testDir)).toBe(true);
|
|
91
|
-
} else {
|
|
92
|
-
// Failed gracefully, no error thrown
|
|
93
|
-
expect(true).toBe(true);
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
//# sourceMappingURL=git.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/git.spec.ts"],"sourcesContent":["import { execSync } from 'child_process'\nimport fs from 'fs/promises'\nimport os from 'os'\nimport path from 'path'\nimport { afterEach, beforeEach, describe, expect, it } from 'vitest'\n\nimport { isGitRepo, tryInitRepoAndCommit } from './git.js'\n\ndescribe('git utilities', () => {\n let testDir: string\n\n beforeEach(async () => {\n // Create test directory in OS temp directory to avoid parent git repo\n testDir = path.join(\n os.tmpdir(),\n `figma-cli-git-test-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`,\n )\n await fs.mkdir(testDir, { recursive: true })\n })\n\n afterEach(async () => {\n try {\n await fs.rm(testDir, { force: true, recursive: true })\n } catch {\n // Ignore cleanup errors\n }\n })\n\n describe('isGitRepo', () => {\n it('should return false for non-git directory', () => {\n expect(isGitRepo(testDir)).toBe(false)\n })\n\n it('should return true for git repository', () => {\n execSync('git init', { cwd: testDir, stdio: 'ignore' })\n expect(isGitRepo(testDir)).toBe(true)\n })\n })\n\n describe('tryInitRepoAndCommit', () => {\n it('should initialize git repo and create initial commit', async () => {\n // Create a file to commit\n await fs.writeFile(path.join(testDir, 'README.md'), '# Test Project')\n\n const result = tryInitRepoAndCommit(testDir)\n\n expect(result).toBe(true)\n expect(isGitRepo(testDir)).toBe(true)\n\n // Verify commit exists\n const log = execSync('git log --oneline', { cwd: testDir, encoding: 'utf-8' })\n expect(log).toContain('feat: initial commit')\n })\n\n it('should return false if already a git repo', () => {\n execSync('git init', { cwd: testDir, stdio: 'ignore' })\n\n const result = tryInitRepoAndCommit(testDir)\n\n expect(result).toBe(false)\n })\n\n it('should create main branch when no default configured', async () => {\n await fs.writeFile(path.join(testDir, 'README.md'), '# Test Project')\n\n tryInitRepoAndCommit(testDir)\n\n const branch = execSync('git branch --show-current', { cwd: testDir, encoding: 'utf-8' })\n expect(branch.trim()).toBe('main')\n })\n\n it('should stage all files for initial commit', async () => {\n await fs.writeFile(path.join(testDir, 'file1.txt'), 'content 1')\n await fs.writeFile(path.join(testDir, 'file2.txt'), 'content 2')\n await fs.mkdir(path.join(testDir, 'subdir'))\n await fs.writeFile(path.join(testDir, 'subdir', 'file3.txt'), 'content 3')\n\n tryInitRepoAndCommit(testDir)\n\n // Check that all files are committed\n const files = execSync('git ls-files', { cwd: testDir, encoding: 'utf-8' })\n expect(files).toContain('file1.txt')\n expect(files).toContain('file2.txt')\n expect(files).toContain('subdir/file3.txt')\n })\n\n it('should handle empty directory gracefully', () => {\n // Empty directory should still create repo but commit might fail\n const result = tryInitRepoAndCommit(testDir)\n\n // Either succeeds with empty commit or fails gracefully\n // Both are acceptable behaviors\n if (result) {\n expect(isGitRepo(testDir)).toBe(true)\n } else {\n // Failed gracefully, no error thrown\n expect(true).toBe(true)\n }\n })\n })\n})\n"],"names":["execSync","fs","os","path","afterEach","beforeEach","describe","expect","it","isGitRepo","tryInitRepoAndCommit","testDir","join","tmpdir","Date","now","Math","random","toString","substring","mkd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MAAMiB,IAAI,CAAC;YACpB;QACF;IACF;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lambda-config.spec.d.ts","sourceRoot":"","sources":["../../src/utils/lambda-config.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import fs from 'fs/promises';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
|
4
|
-
import { applyLambdaModifications } from './lambda-config.js';
|
|
5
|
-
describe('applyLambdaModifications', ()=>{
|
|
6
|
-
const testDir = path.join(process.cwd(), '.test-lambda-config');
|
|
7
|
-
beforeEach(async ()=>{
|
|
8
|
-
await fs.mkdir(testDir, {
|
|
9
|
-
recursive: true
|
|
10
|
-
});
|
|
11
|
-
// Create minimal Next.js project structure
|
|
12
|
-
await fs.writeFile(path.join(testDir, 'package.json'), JSON.stringify({
|
|
13
|
-
name: 'test-project',
|
|
14
|
-
scripts: {
|
|
15
|
-
build: 'next build'
|
|
16
|
-
}
|
|
17
|
-
}, null, 2));
|
|
18
|
-
await fs.writeFile(path.join(testDir, 'next.config.js'), `export default {}\n`);
|
|
19
|
-
});
|
|
20
|
-
afterEach(async ()=>{
|
|
21
|
-
await fs.rm(testDir, {
|
|
22
|
-
force: true,
|
|
23
|
-
recursive: true
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
it('should create run.sh with correct permissions', async ()=>{
|
|
27
|
-
await applyLambdaModifications(testDir);
|
|
28
|
-
const runShPath = path.join(testDir, 'run.sh');
|
|
29
|
-
const content = await fs.readFile(runShPath, 'utf-8');
|
|
30
|
-
expect(content).toContain('#!/bin/bash -x');
|
|
31
|
-
expect(content).toContain('NODE_ENV=production exec node server.js');
|
|
32
|
-
// Check executable permissions
|
|
33
|
-
const stats = await fs.stat(runShPath);
|
|
34
|
-
expect(stats.mode & 0o111).toBeTruthy(); // Has execute bit
|
|
35
|
-
});
|
|
36
|
-
it('should create build_for_lambda.sh with correct permissions', async ()=>{
|
|
37
|
-
await applyLambdaModifications(testDir);
|
|
38
|
-
const buildShPath = path.join(testDir, 'build_for_lambda.sh');
|
|
39
|
-
const content = await fs.readFile(buildShPath, 'utf-8');
|
|
40
|
-
expect(content).toContain('cp -r .next/static .next/standalone/.next/static');
|
|
41
|
-
expect(content).toContain('zip -r --symlinks lambda.zip .');
|
|
42
|
-
const stats = await fs.stat(buildShPath);
|
|
43
|
-
expect(stats.mode & 0o111).toBeTruthy();
|
|
44
|
-
});
|
|
45
|
-
it('should add standalone output to next.config.js', async ()=>{
|
|
46
|
-
await applyLambdaModifications(testDir);
|
|
47
|
-
const nextConfig = await fs.readFile(path.join(testDir, 'next.config.js'), 'utf-8');
|
|
48
|
-
expect(nextConfig).toContain("output: 'standalone'");
|
|
49
|
-
});
|
|
50
|
-
it('should create .npmrc with node-linker=hoisted', async ()=>{
|
|
51
|
-
await applyLambdaModifications(testDir);
|
|
52
|
-
const npmrc = await fs.readFile(path.join(testDir, '.npmrc'), 'utf-8');
|
|
53
|
-
expect(npmrc).toContain('node-linker=hoisted');
|
|
54
|
-
});
|
|
55
|
-
it('should add lambda:buildzip script to package.json', async ()=>{
|
|
56
|
-
await applyLambdaModifications(testDir);
|
|
57
|
-
const packageJson = JSON.parse(await fs.readFile(path.join(testDir, 'package.json'), 'utf-8'));
|
|
58
|
-
expect(packageJson.scripts['lambda:buildzip']).toBe('npm run build && ./build_for_lambda.sh');
|
|
59
|
-
});
|
|
60
|
-
it('should handle complex next.config.js with existing properties', async ()=>{
|
|
61
|
-
// Create a more complex config file
|
|
62
|
-
await fs.writeFile(path.join(testDir, 'next.config.js'), `export default {
|
|
63
|
-
reactStrictMode: true,
|
|
64
|
-
images: {
|
|
65
|
-
domains: ['example.com'],
|
|
66
|
-
},
|
|
67
|
-
}
|
|
68
|
-
`);
|
|
69
|
-
await applyLambdaModifications(testDir);
|
|
70
|
-
const nextConfig = await fs.readFile(path.join(testDir, 'next.config.js'), 'utf-8');
|
|
71
|
-
expect(nextConfig).toContain("output: 'standalone'");
|
|
72
|
-
expect(nextConfig).toContain('reactStrictMode: true');
|
|
73
|
-
expect(nextConfig).toContain("domains: ['example.com']");
|
|
74
|
-
});
|
|
75
|
-
it('should not duplicate output if already present', async ()=>{
|
|
76
|
-
// Create config with output already set
|
|
77
|
-
await fs.writeFile(path.join(testDir, 'next.config.js'), `export default {
|
|
78
|
-
output: 'standalone',
|
|
79
|
-
reactStrictMode: true,
|
|
80
|
-
}
|
|
81
|
-
`);
|
|
82
|
-
await applyLambdaModifications(testDir);
|
|
83
|
-
const nextConfig = await fs.readFile(path.join(testDir, 'next.config.js'), 'utf-8');
|
|
84
|
-
// Should only contain output once
|
|
85
|
-
const outputCount = (nextConfig.match(/output:/g) || []).length;
|
|
86
|
-
expect(outputCount).toBe(1);
|
|
87
|
-
});
|
|
88
|
-
it('should throw error if config object cannot be found', async ()=>{
|
|
89
|
-
// Create config with function call but no variable declaration
|
|
90
|
-
await fs.writeFile(path.join(testDir, 'next.config.js'), `export default withSomeWrapper({})
|
|
91
|
-
`);
|
|
92
|
-
await expect(applyLambdaModifications(testDir)).rejects.toThrow('Could not find Next.js config object');
|
|
93
|
-
});
|
|
94
|
-
it('should work with next.config.mjs', async ()=>{
|
|
95
|
-
// Remove .js file and create .mjs instead
|
|
96
|
-
await fs.rm(path.join(testDir, 'next.config.js'), {
|
|
97
|
-
force: true
|
|
98
|
-
});
|
|
99
|
-
await fs.writeFile(path.join(testDir, 'next.config.mjs'), `export default {
|
|
100
|
-
reactStrictMode: true,
|
|
101
|
-
}
|
|
102
|
-
`);
|
|
103
|
-
await applyLambdaModifications(testDir);
|
|
104
|
-
const nextConfig = await fs.readFile(path.join(testDir, 'next.config.mjs'), 'utf-8');
|
|
105
|
-
expect(nextConfig).toContain("output: 'standalone'");
|
|
106
|
-
expect(nextConfig).toContain('reactStrictMode: true');
|
|
107
|
-
});
|
|
108
|
-
it('should handle wrapped export (e.g., withPayload)', async ()=>{
|
|
109
|
-
// Create config with wrapped export
|
|
110
|
-
await fs.writeFile(path.join(testDir, 'next.config.js'), `import { withPayload } from '@payloadcms/next/withPayload'
|
|
111
|
-
|
|
112
|
-
/** @type {import('next').NextConfig} */
|
|
113
|
-
const nextConfig = {
|
|
114
|
-
reactStrictMode: true,
|
|
115
|
-
webpack: (webpackConfig) => {
|
|
116
|
-
webpackConfig.resolve.extensionAlias = {
|
|
117
|
-
'.js': ['.ts', '.tsx', '.js', '.jsx'],
|
|
118
|
-
}
|
|
119
|
-
return webpackConfig
|
|
120
|
-
},
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export default withPayload(nextConfig, { devBundleServerPackages: false })
|
|
124
|
-
`);
|
|
125
|
-
await applyLambdaModifications(testDir);
|
|
126
|
-
const nextConfig = await fs.readFile(path.join(testDir, 'next.config.js'), 'utf-8');
|
|
127
|
-
expect(nextConfig).toContain("output: 'standalone'");
|
|
128
|
-
expect(nextConfig).toContain('reactStrictMode: true');
|
|
129
|
-
expect(nextConfig).toContain('webpack: (webpackConfig)');
|
|
130
|
-
expect(nextConfig).toContain('withPayload(nextConfig');
|
|
131
|
-
});
|
|
132
|
-
it('should throw error if no next config file exists', async ()=>{
|
|
133
|
-
// Remove config file
|
|
134
|
-
await fs.rm(path.join(testDir, 'next.config.js'), {
|
|
135
|
-
force: true
|
|
136
|
-
});
|
|
137
|
-
await expect(applyLambdaModifications(testDir)).rejects.toThrow('Could not find next.config.js or next.config.mjs');
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
//# sourceMappingURL=lambda-config.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/lambda-config.spec.ts"],"sourcesContent":["import fs from 'fs/promises'\nimport path from 'path'\nimport { afterEach, beforeEach, describe, expect, it } from 'vitest'\n\nimport { applyLambdaModifications } from './lambda-config.js'\n\ndescribe('applyLambdaModifications', () => {\n const testDir = path.join(process.cwd(), '.test-lambda-config')\n\n beforeEach(async () => {\n await fs.mkdir(testDir, { recursive: true })\n\n // Create minimal Next.js project structure\n await fs.writeFile(\n path.join(testDir, 'package.json'),\n JSON.stringify(\n {\n name: 'test-project',\n scripts: {\n build: 'next build',\n },\n },\n null,\n 2,\n ),\n )\n\n await fs.writeFile(path.join(testDir, 'next.config.js'), `export default {}\\n`)\n })\n\n afterEach(async () => {\n await fs.rm(testDir, { force: true, recursive: true })\n })\n\n it('should create run.sh with correct permissions', async () => {\n await applyLambdaModifications(testDir)\n\n const runShPath = path.join(testDir, 'run.sh')\n const content = await fs.readFile(runShPath, 'utf-8')\n\n expect(content).toContain('#!/bin/bash -x')\n expect(content).toContain('NODE_ENV=production exec node server.js')\n\n // Check executable permissions\n const stats = await fs.stat(runShPath)\n expect(stats.mode & 0o111).toBeTruthy() // Has execute bit\n })\n\n it('should create build_for_lambda.sh with correct permissions', async () => {\n await applyLambdaModifications(testDir)\n\n const buildShPath = path.join(testDir, 'build_for_lambda.sh')\n const content = await fs.readFile(buildShPath, 'utf-8')\n\n expect(content).toContain('cp -r .next/static .next/standalone/.next/static')\n expect(content).toContain('zip -r --symlinks lambda.zip .')\n\n const stats = await fs.stat(buildShPath)\n expect(stats.mode & 0o111).toBeTruthy()\n })\n\n it('should add standalone output to next.config.js', async () => {\n await applyLambdaModifications(testDir)\n\n const nextConfig = await fs.readFile(path.join(testDir, 'next.config.js'), 'utf-8')\n expect(nextConfig).toContain(\"output: 'standalone'\")\n })\n\n it('should create .npmrc with node-linker=hoisted', async () => {\n await applyLambdaModifications(testDir)\n\n const npmrc = await fs.readFile(path.join(testDir, '.npmrc'), 'utf-8')\n expect(npmrc).toContain('node-linker=hoisted')\n })\n\n it('should add lambda:buildzip script to package.json', async () => {\n await applyLambdaModifications(testDir)\n\n const packageJson = JSON.parse(await fs.readFile(path.join(testDir, 'package.json'), 'utf-8'))\n\n expect(packageJson.scripts['lambda:buildzip']).toBe('npm run build && ./build_for_lambda.sh')\n })\n\n it('should handle complex next.config.js with existing properties', async () => {\n // Create a more complex config file\n await fs.writeFile(\n path.join(testDir, 'next.config.js'),\n `export default {\n reactStrictMode: true,\n images: {\n domains: ['example.com'],\n },\n}\n`,\n )\n\n await applyLambdaModifications(testDir)\n\n const nextConfig = await fs.readFile(path.join(testDir, 'next.config.js'), 'utf-8')\n expect(nextConfig).toContain(\"output: 'standalone'\")\n expect(nextConfig).toContain('reactStrictMode: true')\n expect(nextConfig).toContain(\"domains: ['example.com']\")\n })\n\n it('should not duplicate output if already present', async () => {\n // Create config with output already set\n await fs.writeFile(\n path.join(testDir, 'next.config.js'),\n `export default {\n output: 'standalone',\n reactStrictMode: true,\n}\n`,\n )\n\n await applyLambdaModifications(testDir)\n\n const nextConfig = await fs.readFile(path.join(testDir, 'next.config.js'), 'utf-8')\n // Should only contain output once\n const outputCount = (nextConfig.match(/output:/g) || []).length\n expect(outputCount).toBe(1)\n })\n\n it('should throw error if config object cannot be found', async () => {\n // Create config with function call but no variable declaration\n await fs.writeFile(\n path.join(testDir, 'next.config.js'),\n `export default withSomeWrapper({})\n`,\n )\n\n await expect(applyLambdaModifications(testDir)).rejects.toThrow(\n 'Could not find Next.js config object',\n )\n })\n\n it('should work with next.config.mjs', async () => {\n // Remove .js file and create .mjs instead\n await fs.rm(path.join(testDir, 'next.config.js'), { force: true })\n await fs.writeFile(\n path.join(testDir, 'next.config.mjs'),\n `export default {\n reactStrictMode: true,\n}\n`,\n )\n\n await applyLambdaModifications(testDir)\n\n const nextConfig = await fs.readFile(path.join(testDir, 'next.config.mjs'), 'utf-8')\n expect(nextConfig).toContain(\"output: 'standalone'\")\n expect(nextConfig).toContain('reactStrictMode: true')\n })\n\n it('should handle wrapped export (e.g., withPayload)', async () => {\n // Create config with wrapped export\n await fs.writeFile(\n path.join(testDir, 'next.config.js'),\n `import { withPayload } from '@payloadcms/next/withPayload'\n\n/** @type {import('next').NextConfig} */\nconst nextConfig = {\n reactStrictMode: true,\n webpack: (webpackConfig) => {\n webpackConfig.resolve.extensionAlias = {\n '.js': ['.ts', '.tsx', '.js', '.jsx'],\n }\n return webpackConfig\n },\n}\n\nexport default withPayload(nextConfig, { devBundleServerPackages: false })\n`,\n )\n\n await applyLambdaModifications(testDir)\n\n const nextConfig = await fs.readFile(path.join(testDir, 'next.config.js'), 'utf-8')\n expect(nextConfig).toContain(\"output: 'standalone'\")\n expect(nextConfig).toContain('reactStrictMode: true')\n expect(nextConfig).toContain('webpack: (webpackConfig)')\n expect(nextConfig).toContain('withPayload(nextConfig')\n })\n\n it('should throw error if no next config file exists', async () => {\n // Remove config file\n await fs.rm(path.join(testDir, 'next.config.js'), { force: true })\n\n await expect(applyLambdaModifications(testDir)).rejects.toThrow(\n 'Could not find next.config.js or next.config.mjs',\n )\n })\n})\n"],"names":["fs","path","afterEach","beforeEach","describe","expect","it","applyLambdaModifications","testDir","join","process","cwd","mkdir","recursive","writeFile","JSON","stringify","name","scripts","build","rm","force","runShPath","content","readFile","toContain","stats","stat","mode","toBeTruthy","buildShPath","nextConfig","npmrc","packageJson","parse","toBe","outputCount","match","length","rejects","toThrow"],"mappings":"AAAA,OAAOA,QAAQ,cAAa;AAC5B,OAAOC,UAAU,OAAM;AACvB,SAASC,SAAS,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,SAAQ;AAEpE,SAASC,wBAAwB,QAAQ,qBAAoB;AAE7DH,SAAS,4BAA4B;IACnC,MAAMI,UAAUP,KAAKQ,IAAI,CAACC,QAAQC,GAAG,IAAI;IAEzCR,WAAW;QACT,MAAMH,GAAGY,KAAK,CAACJ,SAAS;YAAEK,WAAW;QAAK;QAE1C,2CAA2C;QAC3C,MAAMb,GAAGc,SAAS,CAChBb,KAAKQ,IAAI,CAACD,SAAS,iBACnBO,KAAKC,SAAS,CACZ;YACEC,MAAM;YACNC,SAAS;gBACPC,OAAO;YACT;QACF,GACA,MACA;QAIJ,MAAMnB,GAAGc,SAAS,CAACb,KAAKQ,IAAI,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;QAChE,MAAMrB,GAAGc,SAAS,CAChBb,KAAKQ,IAAI,CAACD,SAAS,oBACnB,CAAC;;;AAGP,CAAC;QAGG,MAAMD,yBAAyBC;QAE/B,MAAMuB,aAAa,MAAM/B,GAAGwB,QAAQ,CAACvB,KAAKQ,IAAI,CAACD,SAAS,oBAAoB;QAC5EH,OAAO0B,YAAYN,SAAS,CAAC;QAC7BpB,OAAO0B,YAAYN,SAAS,CAAC;IAC/B;IAEAnB,GAAG,oDAAoD;QACrD,oCAAoC;QACpC,MAAMN,GAAGc,SAAS,CAChBb,KAAKQ,IAAI,CAACD,SAAS,mBACnB,CAAC;;;;;;;;;;;;;;AAcP,CAAC;QAGG,MAAMD,yBAAyBC;QAE/B,MAAMuB,aAAa,MAAM/B,GAAGwB,QAAQ,CAACvB,KAAKQ,IAAI,CAACD,SAAS,mBAAmB;QAC3EH,OAAO0B,YAAYN,SAAS,CAAC;QAC7BpB,OAAO0B,YAAYN,SAAS,CAAC;QAC7BpB,OAAO0B,YAAYN,SAAS,CAAC;QAC7BpB,OAAO0B,YAAYN,SAAS,CAAC;IAC/B;IAEAnB,GAAG,oDAAoD;QACrD,qBAAqB;QACrB,MAAMN,GAAGoB,EAAE,CAACnB,KAAKQ,IAAI,CAACD,SAAS,mBAAmB;YAAEa,OAAO;QAAK;QAEhE,MAAMhB,OAAOE,yBAAyBC,UAAU+B,OAAO,CAACC,OAAO,CAC7D;IAEJ;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"payload-config-ast.spec.d.ts","sourceRoot":"","sources":["../../src/utils/payload-config-ast.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,303 +0,0 @@
|
|
|
1
|
-
import { Project } from 'ts-morph';
|
|
2
|
-
import { beforeEach, describe, expect, it } from 'vitest';
|
|
3
|
-
import { applyModifications, detectRequiredChanges } from './payload-config-ast.js';
|
|
4
|
-
describe('payload-config-ast - detection', ()=>{
|
|
5
|
-
let project;
|
|
6
|
-
beforeEach(()=>{
|
|
7
|
-
project = new Project({
|
|
8
|
-
useInMemoryFileSystem: true
|
|
9
|
-
});
|
|
10
|
-
});
|
|
11
|
-
describe('detectRequiredChanges', ()=>{
|
|
12
|
-
it('should detect buildConfig from payload needs change', ()=>{
|
|
13
|
-
const sourceFile = project.createSourceFile('test.ts', `
|
|
14
|
-
import { buildConfig } from 'payload'
|
|
15
|
-
|
|
16
|
-
export default buildConfig({
|
|
17
|
-
db: mongooseAdapter({ url: 'mongodb://localhost' }),
|
|
18
|
-
secret: 'test-secret',
|
|
19
|
-
})
|
|
20
|
-
`.trim());
|
|
21
|
-
const result = detectRequiredChanges(sourceFile);
|
|
22
|
-
expect(result.needsImportChange).toBe(true);
|
|
23
|
-
expect(result.hasOtherPayloadImports).toBe(false);
|
|
24
|
-
});
|
|
25
|
-
it('should detect buildConfig from @payloadcms/figma already correct', ()=>{
|
|
26
|
-
const sourceFile = project.createSourceFile('test.ts', `
|
|
27
|
-
import { buildConfig } from '@payloadcms/figma'
|
|
28
|
-
|
|
29
|
-
export default buildConfig({
|
|
30
|
-
collections: [],
|
|
31
|
-
})
|
|
32
|
-
`.trim());
|
|
33
|
-
const result = detectRequiredChanges(sourceFile);
|
|
34
|
-
expect(result.needsImportChange).toBe(false);
|
|
35
|
-
});
|
|
36
|
-
it('should detect buildConfig alias and find the aliased call', ()=>{
|
|
37
|
-
const sourceFile = project.createSourceFile('test.ts', `
|
|
38
|
-
import { buildConfig as createConfig } from 'payload'
|
|
39
|
-
|
|
40
|
-
export default createConfig({})
|
|
41
|
-
`.trim());
|
|
42
|
-
const result = detectRequiredChanges(sourceFile);
|
|
43
|
-
expect(result.hasAlias).toBe(true);
|
|
44
|
-
expect(result.needsImportChange).toBe(true);
|
|
45
|
-
expect(result.buildConfigNotFound).toBeUndefined();
|
|
46
|
-
});
|
|
47
|
-
it('should detect other payload imports to preserve', ()=>{
|
|
48
|
-
const sourceFile = project.createSourceFile('test.ts', `
|
|
49
|
-
import { buildConfig, CollectionConfig } from 'payload'
|
|
50
|
-
|
|
51
|
-
export default buildConfig({})
|
|
52
|
-
`.trim());
|
|
53
|
-
const result = detectRequiredChanges(sourceFile);
|
|
54
|
-
expect(result.needsImportChange).toBe(true);
|
|
55
|
-
expect(result.hasOtherPayloadImports).toBe(true);
|
|
56
|
-
});
|
|
57
|
-
it('should detect db property with mongoose adapter', ()=>{
|
|
58
|
-
const sourceFile = project.createSourceFile('test.ts', `
|
|
59
|
-
import { buildConfig } from 'payload'
|
|
60
|
-
import { mongooseAdapter } from '@payloadcms/db-mongodb'
|
|
61
|
-
|
|
62
|
-
export default buildConfig({
|
|
63
|
-
db: mongooseAdapter({ url: 'mongodb://localhost' }),
|
|
64
|
-
})
|
|
65
|
-
`.trim());
|
|
66
|
-
const result = detectRequiredChanges(sourceFile);
|
|
67
|
-
expect(result.dbProperty).toBeDefined();
|
|
68
|
-
expect(result.dbProperty?.adapter).toBe('mongooseAdapter');
|
|
69
|
-
expect(result.dbProperty?.importSource).toBe('@payloadcms/db-mongodb');
|
|
70
|
-
});
|
|
71
|
-
it('should detect db property with postgres adapter', ()=>{
|
|
72
|
-
const sourceFile = project.createSourceFile('test.ts', `
|
|
73
|
-
import { buildConfig } from 'payload'
|
|
74
|
-
import { postgresAdapter } from '@payloadcms/db-postgres'
|
|
75
|
-
|
|
76
|
-
export default buildConfig({
|
|
77
|
-
db: postgresAdapter({ pool: {} }),
|
|
78
|
-
})
|
|
79
|
-
`.trim());
|
|
80
|
-
const result = detectRequiredChanges(sourceFile);
|
|
81
|
-
expect(result.dbProperty).toBeDefined();
|
|
82
|
-
expect(result.dbProperty?.adapter).toBe('postgresAdapter');
|
|
83
|
-
expect(result.dbProperty?.importSource).toBe('@payloadcms/db-postgres');
|
|
84
|
-
});
|
|
85
|
-
it('should detect secret property', ()=>{
|
|
86
|
-
const sourceFile = project.createSourceFile('test.ts', `
|
|
87
|
-
import { buildConfig } from 'payload'
|
|
88
|
-
|
|
89
|
-
export default buildConfig({
|
|
90
|
-
secret: 'test-secret-123',
|
|
91
|
-
})
|
|
92
|
-
`.trim());
|
|
93
|
-
const result = detectRequiredChanges(sourceFile);
|
|
94
|
-
expect(result.secretProperty).toBe(true);
|
|
95
|
-
});
|
|
96
|
-
it('should detect default editor with lexicalEditor no args', ()=>{
|
|
97
|
-
const sourceFile = project.createSourceFile('test.ts', `
|
|
98
|
-
import { buildConfig } from 'payload'
|
|
99
|
-
import { lexicalEditor } from '@payloadcms/richtext-lexical'
|
|
100
|
-
|
|
101
|
-
export default buildConfig({
|
|
102
|
-
editor: lexicalEditor(),
|
|
103
|
-
})
|
|
104
|
-
`.trim());
|
|
105
|
-
const result = detectRequiredChanges(sourceFile);
|
|
106
|
-
expect(result.editorProperty).toBeDefined();
|
|
107
|
-
expect(result.editorProperty?.isDefault).toBe(true);
|
|
108
|
-
expect(result.editorProperty?.importSource).toBe('@payloadcms/richtext-lexical');
|
|
109
|
-
});
|
|
110
|
-
it('should detect custom editor with lexicalEditor args', ()=>{
|
|
111
|
-
const sourceFile = project.createSourceFile('test.ts', `
|
|
112
|
-
import { buildConfig } from 'payload'
|
|
113
|
-
import { lexicalEditor } from '@payloadcms/richtext-lexical'
|
|
114
|
-
|
|
115
|
-
export default buildConfig({
|
|
116
|
-
editor: lexicalEditor({ features: [] }),
|
|
117
|
-
})
|
|
118
|
-
`.trim());
|
|
119
|
-
const result = detectRequiredChanges(sourceFile);
|
|
120
|
-
expect(result.editorProperty).toBeDefined();
|
|
121
|
-
expect(result.editorProperty?.isDefault).toBe(false);
|
|
122
|
-
});
|
|
123
|
-
it('should return null when buildConfig call not found', ()=>{
|
|
124
|
-
const sourceFile = project.createSourceFile('test.ts', `
|
|
125
|
-
import { buildConfig } from 'payload'
|
|
126
|
-
|
|
127
|
-
const config = { collections: [] }
|
|
128
|
-
`.trim());
|
|
129
|
-
const result = detectRequiredChanges(sourceFile);
|
|
130
|
-
expect(result.buildConfigNotFound).toBe(true);
|
|
131
|
-
});
|
|
132
|
-
it('should prefer buildConfig call in export default over other calls', ()=>{
|
|
133
|
-
const sourceFile = project.createSourceFile('test.ts', `
|
|
134
|
-
import { buildConfig } from 'payload'
|
|
135
|
-
import { mongooseAdapter } from '@payloadcms/db-mongodb'
|
|
136
|
-
|
|
137
|
-
// Some other buildConfig call that should be ignored
|
|
138
|
-
const otherConfig = buildConfig({ collections: [] })
|
|
139
|
-
|
|
140
|
-
export default buildConfig({
|
|
141
|
-
db: mongooseAdapter({ url: 'mongodb://localhost' }),
|
|
142
|
-
secret: 'test-secret',
|
|
143
|
-
})
|
|
144
|
-
`.trim());
|
|
145
|
-
const result = detectRequiredChanges(sourceFile);
|
|
146
|
-
// Should find the export default buildConfig call with db property
|
|
147
|
-
expect(result.buildConfigNotFound).toBeUndefined();
|
|
148
|
-
expect(result.dbProperty).toBeDefined();
|
|
149
|
-
expect(result.dbProperty?.adapter).toBe('mongooseAdapter');
|
|
150
|
-
expect(result.secretProperty).toBe(true);
|
|
151
|
-
});
|
|
152
|
-
it('should detect aliased buildConfig in export default', ()=>{
|
|
153
|
-
const sourceFile = project.createSourceFile('test.ts', `
|
|
154
|
-
import { buildConfig as createConfig } from 'payload'
|
|
155
|
-
import { postgresAdapter } from '@payloadcms/db-postgres'
|
|
156
|
-
|
|
157
|
-
export default createConfig({
|
|
158
|
-
db: postgresAdapter({ pool: {} }),
|
|
159
|
-
})
|
|
160
|
-
`.trim());
|
|
161
|
-
const result = detectRequiredChanges(sourceFile);
|
|
162
|
-
expect(result.hasAlias).toBe(true);
|
|
163
|
-
expect(result.buildConfigNotFound).toBeUndefined();
|
|
164
|
-
expect(result.dbProperty).toBeDefined();
|
|
165
|
-
expect(result.dbProperty?.adapter).toBe('postgresAdapter');
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
describe('applyModifications', ()=>{
|
|
169
|
-
it('should remove db property', ()=>{
|
|
170
|
-
const sourceFile = project.createSourceFile('test.ts', `
|
|
171
|
-
import { buildConfig } from 'payload'
|
|
172
|
-
import { mongooseAdapter } from '@payloadcms/db-mongodb'
|
|
173
|
-
|
|
174
|
-
export default buildConfig({
|
|
175
|
-
db: mongooseAdapter({ url: 'mongodb://localhost' }),
|
|
176
|
-
collections: [],
|
|
177
|
-
})
|
|
178
|
-
`.trim());
|
|
179
|
-
const detection = detectRequiredChanges(sourceFile);
|
|
180
|
-
const { changes, modified } = applyModifications(sourceFile, detection);
|
|
181
|
-
expect(modified).toBe(true);
|
|
182
|
-
expect(changes).toContain('Removed db property');
|
|
183
|
-
expect(sourceFile.getFullText()).not.toContain('db:');
|
|
184
|
-
});
|
|
185
|
-
it('should remove secret property', ()=>{
|
|
186
|
-
const sourceFile = project.createSourceFile('test.ts', `
|
|
187
|
-
import { buildConfig } from 'payload'
|
|
188
|
-
|
|
189
|
-
export default buildConfig({
|
|
190
|
-
secret: 'test-secret',
|
|
191
|
-
collections: [],
|
|
192
|
-
})
|
|
193
|
-
`.trim());
|
|
194
|
-
const detection = detectRequiredChanges(sourceFile);
|
|
195
|
-
const { changes, modified } = applyModifications(sourceFile, detection);
|
|
196
|
-
expect(modified).toBe(true);
|
|
197
|
-
expect(changes).toContain('Removed secret property');
|
|
198
|
-
expect(sourceFile.getFullText()).not.toContain('secret:');
|
|
199
|
-
});
|
|
200
|
-
it('should remove default editor property', ()=>{
|
|
201
|
-
const sourceFile = project.createSourceFile('test.ts', `
|
|
202
|
-
import { buildConfig } from 'payload'
|
|
203
|
-
import { lexicalEditor } from '@payloadcms/richtext-lexical'
|
|
204
|
-
|
|
205
|
-
export default buildConfig({
|
|
206
|
-
editor: lexicalEditor(),
|
|
207
|
-
collections: [],
|
|
208
|
-
})
|
|
209
|
-
`.trim());
|
|
210
|
-
const detection = detectRequiredChanges(sourceFile);
|
|
211
|
-
const { changes, modified } = applyModifications(sourceFile, detection);
|
|
212
|
-
expect(modified).toBe(true);
|
|
213
|
-
expect(changes).toContain('Removed default editor property');
|
|
214
|
-
expect(sourceFile.getFullText()).not.toContain('editor:');
|
|
215
|
-
});
|
|
216
|
-
it('should preserve custom editor', ()=>{
|
|
217
|
-
const sourceFile = project.createSourceFile('test.ts', `
|
|
218
|
-
import { buildConfig } from 'payload'
|
|
219
|
-
import { lexicalEditor } from '@payloadcms/richtext-lexical'
|
|
220
|
-
|
|
221
|
-
export default buildConfig({
|
|
222
|
-
editor: lexicalEditor({ features: [] }),
|
|
223
|
-
collections: [],
|
|
224
|
-
})
|
|
225
|
-
`.trim());
|
|
226
|
-
const detection = detectRequiredChanges(sourceFile);
|
|
227
|
-
applyModifications(sourceFile, detection);
|
|
228
|
-
expect(sourceFile.getFullText()).toContain('editor:');
|
|
229
|
-
});
|
|
230
|
-
it('should replace buildConfig import when no other payload imports', ()=>{
|
|
231
|
-
const sourceFile = project.createSourceFile('test.ts', `
|
|
232
|
-
import { buildConfig } from 'payload'
|
|
233
|
-
|
|
234
|
-
export default buildConfig({})
|
|
235
|
-
`.trim());
|
|
236
|
-
const detection = detectRequiredChanges(sourceFile);
|
|
237
|
-
const { changes, modified } = applyModifications(sourceFile, detection);
|
|
238
|
-
expect(modified).toBe(true);
|
|
239
|
-
expect(changes).toContain('Changed buildConfig import to @payloadcms/figma');
|
|
240
|
-
expect(sourceFile.getFullText()).toContain("from '@payloadcms/figma'");
|
|
241
|
-
expect(sourceFile.getFullText()).not.toContain("from 'payload'");
|
|
242
|
-
});
|
|
243
|
-
it('should split buildConfig import when other payload imports exist', ()=>{
|
|
244
|
-
const sourceFile = project.createSourceFile('test.ts', `
|
|
245
|
-
import { buildConfig, CollectionConfig } from 'payload'
|
|
246
|
-
|
|
247
|
-
export default buildConfig({})
|
|
248
|
-
`.trim());
|
|
249
|
-
const detection = detectRequiredChanges(sourceFile);
|
|
250
|
-
const { changes, modified } = applyModifications(sourceFile, detection);
|
|
251
|
-
expect(modified).toBe(true);
|
|
252
|
-
expect(changes).toContain('Split buildConfig import to @payloadcms/figma');
|
|
253
|
-
const fullText = sourceFile.getFullText();
|
|
254
|
-
expect(fullText).toMatch(/import\s*\{\s*CollectionConfig\s*\}\s*from\s*['"]payload['"]/);
|
|
255
|
-
expect(fullText).toMatch(/import\s*\{\s*buildConfig\s*\}\s*from\s*['"]@payloadcms\/figma['"]/);
|
|
256
|
-
});
|
|
257
|
-
it('should remove db adapter import', ()=>{
|
|
258
|
-
const sourceFile = project.createSourceFile('test.ts', `
|
|
259
|
-
import { buildConfig } from 'payload'
|
|
260
|
-
import { mongooseAdapter } from '@payloadcms/db-mongodb'
|
|
261
|
-
|
|
262
|
-
export default buildConfig({
|
|
263
|
-
db: mongooseAdapter({ url: 'mongodb://localhost' }),
|
|
264
|
-
})
|
|
265
|
-
`.trim());
|
|
266
|
-
const detection = detectRequiredChanges(sourceFile);
|
|
267
|
-
const { changes, modified } = applyModifications(sourceFile, detection);
|
|
268
|
-
expect(modified).toBe(true);
|
|
269
|
-
expect(changes).toContain('Removed mongooseAdapter import');
|
|
270
|
-
expect(sourceFile.getFullText()).not.toContain('@payloadcms/db-mongodb');
|
|
271
|
-
});
|
|
272
|
-
it('should remove lexicalEditor import when default', ()=>{
|
|
273
|
-
const sourceFile = project.createSourceFile('test.ts', `
|
|
274
|
-
import { buildConfig } from 'payload'
|
|
275
|
-
import { lexicalEditor } from '@payloadcms/richtext-lexical'
|
|
276
|
-
|
|
277
|
-
export default buildConfig({
|
|
278
|
-
editor: lexicalEditor(),
|
|
279
|
-
})
|
|
280
|
-
`.trim());
|
|
281
|
-
const detection = detectRequiredChanges(sourceFile);
|
|
282
|
-
const { changes, modified } = applyModifications(sourceFile, detection);
|
|
283
|
-
expect(modified).toBe(true);
|
|
284
|
-
expect(changes).toContain('Removed lexicalEditor import');
|
|
285
|
-
expect(sourceFile.getFullText()).not.toContain('@payloadcms/richtext-lexical');
|
|
286
|
-
});
|
|
287
|
-
it('should track modified flag correctly when no changes needed', ()=>{
|
|
288
|
-
const sourceFile = project.createSourceFile('test.ts', `
|
|
289
|
-
import { buildConfig } from '@payloadcms/figma'
|
|
290
|
-
|
|
291
|
-
export default buildConfig({
|
|
292
|
-
collections: [],
|
|
293
|
-
})
|
|
294
|
-
`.trim());
|
|
295
|
-
const detection = detectRequiredChanges(sourceFile);
|
|
296
|
-
const { changes, modified } = applyModifications(sourceFile, detection);
|
|
297
|
-
expect(modified).toBe(false);
|
|
298
|
-
expect(changes).toHaveLength(0);
|
|
299
|
-
});
|
|
300
|
-
});
|
|
301
|
-
});
|
|
302
|
-
|
|
303
|
-
//# sourceMappingURL=payload-config-ast.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/payload-config-ast.spec.ts"],"sourcesContent":["import { Project } from 'ts-morph'\nimport { beforeEach, describe, expect, it } from 'vitest'\n\nimport { applyModifications, detectRequiredChanges } from './payload-config-ast.js'\n\ndescribe('payload-config-ast - detection', () => {\n let project: Project\n\n beforeEach(() => {\n project = new Project({ useInMemoryFileSystem: true })\n })\n\n describe('detectRequiredChanges', () => {\n it('should detect buildConfig from payload needs change', () => {\n const sourceFile = project.createSourceFile(\n 'test.ts',\n `\nimport { buildConfig } from 'payload'\n\nexport default buildConfig({\n db: mongooseAdapter({ url: 'mongodb://localhost' }),\n secret: 'test-secret',\n})\n `.trim(),\n )\n\n const result = detectRequiredChanges(sourceFile)\n\n expect(result.needsImportChange).toBe(true)\n expect(result.hasOtherPayloadImports).toBe(false)\n })\n\n it('should detect buildConfig from @payloadcms/figma already correct', () => {\n const sourceFile = project.createSourceFile(\n 'test.ts',\n `\nimport { buildConfig } from '@payloadcms/figma'\n\nexport default buildConfig({\n collections: [],\n})\n `.trim(),\n )\n\n const result = detectRequiredChanges(sourceFile)\n\n expect(result.needsImportChange).toBe(false)\n })\n\n it('should detect buildConfig alias and find the aliased call', () => {\n const sourceFile = project.createSourceFile(\n 'test.ts',\n `\nimport { buildConfig as createConfig } from 'payload'\n\nexport default createConfig({})\n `.trim(),\n )\n\n const result = detectRequiredChanges(sourceFile)\n\n expect(result.hasAlias).toBe(true)\n expect(result.needsImportChange).toBe(true)\n expect(result.buildConfigNotFound).toBeUndefined()\n })\n\n it('should detect other payload imports to preserve', () => {\n const sourceFile = project.createSourceFile(\n 'test.ts',\n `\nimport { buildConfig, CollectionConfig } from 'payload'\n\nexport default buildConfig({})\n `.trim(),\n )\n\n const result = detectRequiredChanges(sourceFile)\n\n expect(result.needsImportChange).toBe(true)\n expect(result.hasOtherPayloadImports).toBe(true)\n })\n\n it('should detect db property with mongoose adapter', () => {\n const sourceFile = project.createSourceFile(\n 'test.ts',\n `\nimport { buildConfig } from 'payload'\nimport { mongooseAdapter } from '@payloadcms/db-mongodb'\n\nexport default buildConfig({\n db: mongooseAdapter({ url: 'mongodb://localhost' }),\n})\n `.trim(),\n )\n\n const result = detectRequiredChanges(sourceFile)\n\n expect(result.dbProperty).toBeDefined()\n expect(result.dbProperty?.adapter).toBe('mongooseAdapter')\n expect(result.dbProperty?.importSource).toBe('@payloadcms/db-mongodb')\n })\n\n it('should detect db property with postgres adapter', () => {\n const sourceFile = project.createSourceFile(\n 'test.ts',\n `\nimport { buildConfig } from 'payload'\nimport { postgresAdapter } from '@payloadcms/db-postgres'\n\nexport default buildConfig({\n db: postgresAdapter({ pool: {} }),\n})\n `.trim(),\n )\n\n const result = detectRequiredChanges(sourceFile)\n\n expect(result.dbProperty).toBeDefined()\n expect(result.dbProperty?.adapter).toBe('postgresAdapter')\n expect(result.dbProperty?.importSource).toBe('@payloadcms/db-postgres')\n })\n\n it('should detect secret property', () => {\n const sourceFile = project.createSourceFile(\n 'test.ts',\n `\nimport { buildConfig } from 'payload'\n\nexport default buildConfig({\n secret: 'test-secret-123',\n})\n `.trim(),\n )\n\n const result = detectRequiredChanges(sourceFile)\n\n expect(result.secretProperty).toBe(true)\n })\n\n it('should detect default editor with lexicalEditor no args', () => {\n const sourceFile = project.createSourceFile(\n 'test.ts',\n `\nimport { buildConfig } from 'payload'\nimport { lexicalEditor } from '@payloadcms/richtext-lexical'\n\nexport default buildConfig({\n editor: lexicalEditor(),\n})\n `.trim(),\n )\n\n const result = detectRequiredChanges(sourceFile)\n\n expect(result.editorProperty).toBeDefined()\n expect(result.editorProperty?.isDefault).toBe(true)\n expect(result.editorProperty?.importSource).toBe('@payloadcms/richtext-lexical')\n })\n\n it('should detect custom editor with lexicalEditor args', () => {\n const sourceFile = project.createSourceFile(\n 'test.ts',\n `\nimport { buildConfig } from 'payload'\nimport { lexicalEditor } from '@payloadcms/richtext-lexical'\n\nexport default buildConfig({\n editor: lexicalEditor({ features: [] }),\n})\n `.trim(),\n )\n\n const result = detectRequiredChanges(sourceFile)\n\n expect(result.editorProperty).toBeDefined()\n expect(result.editorProperty?.isDefault).toBe(false)\n })\n\n it('should return null when buildConfig call not found', () => {\n const sourceFile = project.createSourceFile(\n 'test.ts',\n `\nimport { buildConfig } from 'payload'\n\nconst config = { collections: [] }\n `.trim(),\n )\n\n const result = detectRequiredChanges(sourceFile)\n\n expect(result.buildConfigNotFound).toBe(true)\n })\n\n it('should prefer buildConfig call in export default over other calls', () => {\n const sourceFile = project.createSourceFile(\n 'test.ts',\n `\nimport { buildConfig } from 'payload'\nimport { mongooseAdapter } from '@payloadcms/db-mongodb'\n\n// Some other buildConfig call that should be ignored\nconst otherConfig = buildConfig({ collections: [] })\n\nexport default buildConfig({\n db: mongooseAdapter({ url: 'mongodb://localhost' }),\n secret: 'test-secret',\n})\n `.trim(),\n )\n\n const result = detectRequiredChanges(sourceFile)\n\n // Should find the export default buildConfig call with db property\n expect(result.buildConfigNotFound).toBeUndefined()\n expect(result.dbProperty).toBeDefined()\n expect(result.dbProperty?.adapter).toBe('mongooseAdapter')\n expect(result.secretProperty).toBe(true)\n })\n\n it('should detect aliased buildConfig in export default', () => {\n const sourceFile = project.createSourceFile(\n 'test.ts',\n `\nimport { buildConfig as createConfig } from 'payload'\nimport { postgresAdapter } from '@payloadcms/db-postgres'\n\nexport default createConfig({\n db: postgresAdapter({ pool: {} }),\n})\n `.trim(),\n )\n\n const result = detectRequiredChanges(sourceFile)\n\n expect(result.hasAlias).toBe(true)\n expect(result.buildConfigNotFound).toBeUndefined()\n expect(result.dbProperty).toBeDefined()\n expect(result.dbProperty?.adapter).toBe('postgresAdapter')\n })\n })\n\n describe('applyModifications', () => {\n it('should remove db property', () => {\n const sourceFile = project.createSourceFile(\n 'test.ts',\n `\nimport { buildConfig } from 'payload'\nimport { mongooseAdapter } from '@payloadcms/db-mongodb'\n\nexport default buildConfig({\n db: mongooseAdapter({ url: 'mongodb://localhost' }),\n collections: [],\n})\n `.trim(),\n )\n\n const detection = detectRequiredChanges(sourceFile)\n const { changes, modified } = applyModifications(sourceFile, detection)\n\n expect(modified).toBe(true)\n expect(changes).toContain('Removed db property')\n expect(sourceFile.getFullText()).not.toContain('db:')\n })\n\n it('should remove secret property', () => {\n const sourceFile = project.createSourceFile(\n 'test.ts',\n `\nimport { buildConfig } from 'payload'\n\nexport default buildConfig({\n secret: 'test-secret',\n collections: [],\n})\n `.trim(),\n )\n\n const detection = detectRequiredChanges(sourceFile)\n const { changes, modified } = applyModifications(sourceFile, detection)\n\n expect(modified).toBe(true)\n expect(changes).toContain('Removed secret property')\n expect(sourceFile.getFullText()).not.toContain('secret:')\n })\n\n it('should remove default editor property', () => {\n const sourceFile = project.createSourceFile(\n 'test.ts',\n `\nimport { buildConfig } from 'payload'\nimport { lexicalEditor } from '@payloadcms/richtext-lexical'\n\nexport default buildConfig({\n editor: lexicalEditor(),\n collections: [],\n})\n `.trim(),\n )\n\n const detection = detectRequiredChanges(sourceFile)\n const { changes, modified } = applyModifications(sourceFile, detection)\n\n expect(modified).toBe(true)\n expect(changes).toContain('Removed default editor property')\n expect(sourceFile.getFullText()).not.toContain('editor:')\n })\n\n it('should preserve custom editor', () => {\n const sourceFile = project.createSourceFile(\n 'test.ts',\n `\nimport { buildConfig } from 'payload'\nimport { lexicalEditor } from '@payloadcms/richtext-lexical'\n\nexport default buildConfig({\n editor: lexicalEditor({ features: [] }),\n collections: [],\n})\n `.trim(),\n )\n\n const detection = detectRequiredChanges(sourceFile)\n applyModifications(sourceFile, detection)\n\n expect(sourceFile.getFullText()).toContain('editor:')\n })\n\n it('should replace buildConfig import when no other payload imports', () => {\n const sourceFile = project.createSourceFile(\n 'test.ts',\n `\nimport { buildConfig } from 'payload'\n\nexport default buildConfig({})\n `.trim(),\n )\n\n const detection = detectRequiredChanges(sourceFile)\n const { changes, modified } = applyModifications(sourceFile, detection)\n\n expect(modified).toBe(true)\n expect(changes).toContain('Changed buildConfig import to @payloadcms/figma')\n expect(sourceFile.getFullText()).toContain(\"from '@payloadcms/figma'\")\n expect(sourceFile.getFullText()).not.toContain(\"from 'payload'\")\n })\n\n it('should split buildConfig import when other payload imports exist', () => {\n const sourceFile = project.createSourceFile(\n 'test.ts',\n `\nimport { buildConfig, CollectionConfig } from 'payload'\n\nexport default buildConfig({})\n `.trim(),\n )\n\n const detection = detectRequiredChanges(sourceFile)\n const { changes, modified } = applyModifications(sourceFile, detection)\n\n expect(modified).toBe(true)\n expect(changes).toContain('Split buildConfig import to @payloadcms/figma')\n const fullText = sourceFile.getFullText()\n expect(fullText).toMatch(/import\\s*\\{\\s*CollectionConfig\\s*\\}\\s*from\\s*['\"]payload['\"]/)\n expect(fullText).toMatch(/import\\s*\\{\\s*buildConfig\\s*\\}\\s*from\\s*['\"]@payloadcms\\/figma['\"]/)\n })\n\n it('should remove db adapter import', () => {\n const sourceFile = project.createSourceFile(\n 'test.ts',\n `\nimport { buildConfig } from 'payload'\nimport { mongooseAdapter } from '@payloadcms/db-mongodb'\n\nexport default buildConfig({\n db: mongooseAdapter({ url: 'mongodb://localhost' }),\n})\n `.trim(),\n )\n\n const detection = detectRequiredChanges(sourceFile)\n const { changes, modified } = applyModifications(sourceFile, detection)\n\n expect(modified).toBe(true)\n expect(changes).toContain('Removed mongooseAdapter import')\n expect(sourceFile.getFullText()).not.toContain('@payloadcms/db-mongodb')\n })\n\n it('should remove lexicalEditor import when default', () => {\n const sourceFile = project.createSourceFile(\n 'test.ts',\n `\nimport { buildConfig } from 'payload'\nimport { lexicalEditor } from '@payloadcms/richtext-lexical'\n\nexport default buildConfig({\n editor: lexicalEditor(),\n})\n `.trim(),\n )\n\n const detection = detectRequiredChanges(sourceFile)\n const { changes, modified } = applyModifications(sourceFile, detection)\n\n expect(modified).toBe(true)\n expect(changes).toContain('Removed lexicalEditor import')\n expect(sourceFile.getFullText()).not.toContain('@payloadcms/richtext-lexical')\n })\n\n it('should track modified flag correctly when no changes needed', () => {\n const sourceFile = project.createSourceFile(\n 'test.ts',\n `\nimport { buildConfig } from '@payloadcms/figma'\n\nexport default buildConfig({\n collections: [],\n})\n `.trim(),\n )\n\n const detection = detectRequiredChanges(sourceFile)\n const { changes, modified } = applyModifications(sourceFile, detection)\n\n expect(modified).toBe(false)\n expect(changes).toHaveLength(0)\n })\n })\n})\n"],"names":["Project","beforeEach","describe","expect","it","applyModifications","detectRequiredChanges","project","useInMemoryFileSystem","sourceFile","createSourceFile","trim","result","needsImportChange","toBe","hasOtherPayloadImports","hasAlias","buildConfigNotFound","toBeUndefined","dbProperty","toBeDefined","adapter","importSource","secretProperty","editorProperty","isDefault","detection","changes","modified","toContain","getFullText","not","fullText","toMatch","toHaveLength"],"mappings":"AAAA,SAASA,OAAO,QAAQ,WAAU;AAClC,SAASC,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,SAAQ;AAEzD,SAASC,kBAAkB,EAAEC,qBAAqB,QAAQ,0BAAyB;AAEnFJ,SAAS,kCAAkC;IACzC,IAAIK;IAEJN,WAAW;QACTM,UAAU,IAAIP,QAAQ;YAAEQ,uBAAuB;QAAK;IACtD;IAEAN,SAAS,yBAAyB;QAChCE,GAAG,uDAAuD;YACxD,MAAMK,aAAaF,QAAQG,gBAAgB,CACzC,WACA,CAAC;;;;;;;QAOD,CAAC,CAACC,IAAI;YAGR,MAAMC,SAASN,sBAAsBG;YAErCN,OAAOS,OAAOC,iBAAiB,EAAEC,IAAI,CAAC;YACtCX,OAAOS,OAAOG,sBAAsB,EA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C,OAAO,CAAC;YACzB9B,OAAO6B,UAAUC,OAAO,CAAC;QAC3B;QAEA7B,GAAG,mCAAmC;YACpC,MAAMK,aAAaF,QAAQG,gBAAgB,CACzC,WACA,CAAC;;;;;;;QAOD,CAAC,CAACC,IAAI;YAGR,MAAMe,YAAYpB,sBAAsBG;YACxC,MAAM,EAAEkB,OAAO,EAAEC,QAAQ,EAAE,GAAGvB,mBAAmBI,YAAYiB;YAE7DvB,OAAOyB,UAAUd,IAAI,CAAC;YACtBX,OAAOwB,SAASE,SAAS,CAAC;YAC1B1B,OAAOM,WAAWqB,WAAW,IAAIC,GAAG,CAACF,SAAS,CAAC;QACjD;QAEAzB,GAAG,mDAAmD;YACpD,MAAMK,aAAaF,QAAQG,gBAAgB,CACzC,WACA,CAAC;;;;;;;QAOD,CAAC,CAACC,IAAI;YAGR,MAAMe,YAAYpB,sBAAsBG;YACxC,MAAM,EAAEkB,OAAO,EAAEC,QAAQ,EAAE,GAAGvB,mBAAmBI,YAAYiB;YAE7DvB,OAAOyB,UAAUd,IAAI,CAAC;YACtBX,OAAOwB,SAASE,SAAS,CAAC;YAC1B1B,OAAOM,WAAWqB,WAAW,IAAIC,GAAG,CAACF,SAAS,CAAC;QACjD;QAEAzB,GAAG,+DAA+D;YAChE,MAAMK,aAAaF,QAAQG,gBAAgB,CACzC,WACA,CAAC;;;;;;QAMD,CAAC,CAACC,IAAI;YAGR,MAAMe,YAAYpB,sBAAsBG;YACxC,MAAM,EAAEkB,OAAO,EAAEC,QAAQ,EAAE,GAAGvB,mBAAmBI,YAAYiB;YAE7DvB,OAAOyB,UAAUd,IAAI,CAAC;YACtBX,OAAOwB,SAASO,YAAY,CAAC;QAC/B;IACF;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"payload-config-modifier.int.spec.d.ts","sourceRoot":"","sources":["../../src/utils/payload-config-modifier.int.spec.ts"],"names":[],"mappings":""}
|