@hubspot/cli 8.0.4-experimental.0 → 8.0.5-experimental.0
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/commands/cms/__tests__/upload.test.js +4 -0
- package/commands/project/__tests__/migrate.test.js +2 -2
- package/commands/project/migrate.js +4 -4
- package/lang/en.d.ts +2 -2
- package/lang/en.js +2 -2
- package/lib/projects/platformVersion.d.ts +1 -1
- package/lib/projects/platformVersion.js +1 -2
- package/package.json +2 -2
|
@@ -8,6 +8,7 @@ import * as modulesLib from '@hubspot/local-dev-lib/cms/modules';
|
|
|
8
8
|
import * as ignoreRulesLib from '@hubspot/local-dev-lib/ignoreRules';
|
|
9
9
|
import * as themesLib from '@hubspot/local-dev-lib/cms/themes';
|
|
10
10
|
import * as configLib from '@hubspot/local-dev-lib/config';
|
|
11
|
+
import * as handleFieldsJSLib from '@hubspot/local-dev-lib/cms/handleFieldsJS';
|
|
11
12
|
import { uiLogger } from '../../../lib/ui/logger.js';
|
|
12
13
|
import * as errorHandlers from '../../../lib/errorHandlers/index.js';
|
|
13
14
|
import * as commonOpts from '../../../lib/commonOpts.js';
|
|
@@ -26,6 +27,7 @@ vi.mock('@hubspot/local-dev-lib/cms/modules');
|
|
|
26
27
|
vi.mock('@hubspot/local-dev-lib/ignoreRules');
|
|
27
28
|
vi.mock('@hubspot/local-dev-lib/cms/themes');
|
|
28
29
|
vi.mock('@hubspot/local-dev-lib/config');
|
|
30
|
+
vi.mock('@hubspot/local-dev-lib/cms/handleFieldsJS');
|
|
29
31
|
vi.mock('../../../lib/errorHandlers/index.js');
|
|
30
32
|
vi.mock('../../../lib/commonOpts.js');
|
|
31
33
|
vi.mock('../../../lib/prompts/uploadPrompt.js');
|
|
@@ -53,6 +55,7 @@ const hasUploadErrorsSpy = vi.spyOn(uploadFolderLib, 'hasUploadErrors');
|
|
|
53
55
|
const processExitSpy = vi.spyOn(process, 'exit');
|
|
54
56
|
const logErrorSpy = vi.spyOn(errorHandlers, 'logError');
|
|
55
57
|
const getConfigAccountIfExistsSpy = vi.spyOn(configLib, 'getConfigAccountIfExists');
|
|
58
|
+
const isConvertableFieldJsSpy = vi.spyOn(handleFieldsJSLib, 'isConvertableFieldJs');
|
|
56
59
|
describe('commands/cms/upload', () => {
|
|
57
60
|
beforeEach(() => {
|
|
58
61
|
// @ts-expect-error Mock implementation
|
|
@@ -67,6 +70,7 @@ describe('commands/cms/upload', () => {
|
|
|
67
70
|
getThemePreviewUrlSpy.mockReturnValue(undefined);
|
|
68
71
|
// Mock config to prevent reading actual config file in CI
|
|
69
72
|
getConfigAccountIfExistsSpy.mockReturnValue(undefined);
|
|
73
|
+
isConvertableFieldJsSpy.mockReturnValue(false);
|
|
70
74
|
});
|
|
71
75
|
describe('command', () => {
|
|
72
76
|
it('should have the correct command structure', () => {
|
|
@@ -9,7 +9,7 @@ import { uiBetaTag, uiCommandReference } from '../../../lib/ui/index.js';
|
|
|
9
9
|
vi.mock('../../../lib/app/migrate');
|
|
10
10
|
vi.mock('../../../lib/projects/config');
|
|
11
11
|
vi.mock('../../../lib/ui');
|
|
12
|
-
const { v2025_2 } = PLATFORM_VERSIONS;
|
|
12
|
+
const { v2025_2, v2026_3_beta } = PLATFORM_VERSIONS;
|
|
13
13
|
describe('commands/project/migrate', () => {
|
|
14
14
|
const yargsMock = yargs;
|
|
15
15
|
const optionsSpy = vi.spyOn(yargsMock, 'option').mockReturnValue(yargsMock);
|
|
@@ -48,7 +48,7 @@ describe('commands/project/migrate', () => {
|
|
|
48
48
|
migrateCommand.builder(yargsMock);
|
|
49
49
|
expect(optionsSpy).toHaveBeenCalledWith('platform-version', {
|
|
50
50
|
type: 'string',
|
|
51
|
-
choices: [v2025_2],
|
|
51
|
+
choices: [v2025_2, v2026_3_beta],
|
|
52
52
|
default: v2025_2,
|
|
53
53
|
});
|
|
54
54
|
expect(optionsSpy).toHaveBeenCalledWith('unstable', {
|
|
@@ -13,7 +13,7 @@ import { getHasMigratableThemes, migrateThemes2025_2, } from '../../lib/theme/mi
|
|
|
13
13
|
import { hasFeature } from '../../lib/hasFeature.js';
|
|
14
14
|
import { FEATURES } from '../../lib/constants.js';
|
|
15
15
|
import { trackCommandMetadataUsage, trackCommandUsage, } from '../../lib/usageTracking.js';
|
|
16
|
-
const { v2025_2,
|
|
16
|
+
const { v2025_2, v2026_3_beta } = PLATFORM_VERSIONS;
|
|
17
17
|
const command = 'migrate';
|
|
18
18
|
const describe = commands.project.migrate.describe;
|
|
19
19
|
async function handler(args) {
|
|
@@ -26,8 +26,8 @@ async function handler(args) {
|
|
|
26
26
|
}
|
|
27
27
|
if (projectConfig?.projectConfig) {
|
|
28
28
|
await renderInline(getWarningBox({
|
|
29
|
-
title: lib.migrate.projectMigrationWarningTitle,
|
|
30
|
-
message: lib.migrate.projectMigrationWarning,
|
|
29
|
+
title: lib.migrate.projectMigrationWarningTitle(platformVersion),
|
|
30
|
+
message: lib.migrate.projectMigrationWarning(platformVersion),
|
|
31
31
|
}));
|
|
32
32
|
}
|
|
33
33
|
try {
|
|
@@ -67,7 +67,7 @@ function projectMigrateBuilder(yargs) {
|
|
|
67
67
|
yargs
|
|
68
68
|
.option('platform-version', {
|
|
69
69
|
type: 'string',
|
|
70
|
-
choices: [v2025_2,
|
|
70
|
+
choices: [v2025_2, v2026_3_beta],
|
|
71
71
|
default: v2025_2,
|
|
72
72
|
})
|
|
73
73
|
.option('unstable', {
|
package/lang/en.d.ts
CHANGED
|
@@ -3923,8 +3923,8 @@ export declare const lib: {
|
|
|
3923
3923
|
componentsToBeMigrated: (components: string) => string;
|
|
3924
3924
|
componentsThatWillNotBeMigrated: (components: string) => string;
|
|
3925
3925
|
sourceContentsMoved: (newLocation: string) => string;
|
|
3926
|
-
projectMigrationWarningTitle: string;
|
|
3927
|
-
projectMigrationWarning: string;
|
|
3926
|
+
projectMigrationWarningTitle: (platformVersion: string) => string;
|
|
3927
|
+
projectMigrationWarning: (platformVersion: string) => string;
|
|
3928
3928
|
exitWithoutMigrating: string;
|
|
3929
3929
|
success: {
|
|
3930
3930
|
downloadedProject: (projectName: string, projectDest: string) => string;
|
package/lang/en.js
CHANGED
|
@@ -3946,8 +3946,8 @@ export const lib = {
|
|
|
3946
3946
|
componentsToBeMigrated: (components) => `The following features will be migrated: ${components}`,
|
|
3947
3947
|
componentsThatWillNotBeMigrated: (components) => `[NOTE] These features are not yet supported for migration but will be available later: ${components}`,
|
|
3948
3948
|
sourceContentsMoved: (newLocation) => `The contents of your old source directory have been moved to ${newLocation}, move any required files to the new source directory.`,
|
|
3949
|
-
projectMigrationWarningTitle:
|
|
3950
|
-
projectMigrationWarning: uiBetaTag(`Running the ${uiCommandReference('hs project migrate')} command will permanently upgrade your project to platformVersion
|
|
3949
|
+
projectMigrationWarningTitle: (platformVersion) => `Important: Migrating to platformVersion ${platformVersion} is irreversible`,
|
|
3950
|
+
projectMigrationWarning: (platformVersion) => uiBetaTag(`Running the ${uiCommandReference('hs project migrate')} command will permanently upgrade your project to platformVersion ${platformVersion}. This action cannot be undone. To ensure you have access to your original files, they will be copied to a new directory (archive) for safekeeping.\n\nThis command will guide you through the process, prompting you to enter the required fields and will download the new project source code into your project source directory.`, false),
|
|
3951
3951
|
exitWithoutMigrating: 'Exiting without migrating',
|
|
3952
3952
|
success: {
|
|
3953
3953
|
downloadedProject: (projectName, projectDest) => `Saved ${projectName} to ${projectDest}`,
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
*
|
|
5
5
|
* We are unable to reliably support versions of projects that are newer than any given CLI release
|
|
6
6
|
* */
|
|
7
|
-
export declare const LATEST_SUPPORTED_PLATFORM_VERSION
|
|
7
|
+
export declare const LATEST_SUPPORTED_PLATFORM_VERSION = "2026.03";
|
|
8
8
|
export declare function isV2Project(platformVersion?: string | null): boolean;
|
|
9
9
|
export declare function isUnsupportedPlatformVersion(platformVersion?: string | null): boolean;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { PLATFORM_VERSIONS } from '@hubspot/local-dev-lib/constants/projects';
|
|
2
1
|
/**
|
|
3
2
|
* Used to surface warnings when users attempt to interact with new platform versions
|
|
4
3
|
* that were released after this version of the CLI was released.
|
|
5
4
|
*
|
|
6
5
|
* We are unable to reliably support versions of projects that are newer than any given CLI release
|
|
7
6
|
* */
|
|
8
|
-
export const LATEST_SUPPORTED_PLATFORM_VERSION =
|
|
7
|
+
export const LATEST_SUPPORTED_PLATFORM_VERSION = '2026.03';
|
|
9
8
|
function parsePlatformVersion(platformVersion) {
|
|
10
9
|
const [year, minor] = platformVersion.split(/[.-]/);
|
|
11
10
|
return {
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cli",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.5-experimental.0",
|
|
4
4
|
"description": "The official CLI for developing on HubSpot",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": "https://github.com/HubSpot/hubspot-cli",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@hubspot/cms-dev-server": "1.2.16",
|
|
10
|
-
"@hubspot/local-dev-lib": "0.7.
|
|
10
|
+
"@hubspot/local-dev-lib": "0.7.2-experimental.0",
|
|
11
11
|
"@hubspot/project-parsing-lib": "0.12.0",
|
|
12
12
|
"@hubspot/serverless-dev-runtime": "7.0.7",
|
|
13
13
|
"@hubspot/ui-extensions-dev-server": "1.1.8",
|