@woodsportal/hubspot-kit 1.0.40 → 1.0.41-dev.1
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/CHANGELOG.md +1 -1
- package/dist/cli.js +29 -10
- package/dist/cli.js.map +1 -1
- package/package.json +22 -8
- package/scripts/portal-env-mode.mjs +7 -0
- package/scripts/run-dev.mjs +3 -2
- package/scripts/vite/create-dev-server-config.mjs +2 -4
- package/scripts/vite/portal-build-shared.js +23 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
5
|
### CI / CodeBuild
|
|
6
|
-
- **`woodsportal-<env>-cb-hubspot-kit-publish`** — `hubspot-kit-npm
|
|
6
|
+
- **`woodsportal-<env>-cb-hubspot-kit-publish`** — `hubspot-kit-npm.yml` runs `npm run verify` then publishes `@woodsportal/hubspot-kit` (`next` on `dev`, `latest` on `main`). Client-frontend node-push installs kit from npm via `HUBSPOT_KIT_NPM_TAG` override.
|
|
7
7
|
|
|
8
8
|
### Module build id (collaborative CDN deploys)
|
|
9
9
|
- **Rename** `.portal-build-id` → `.module-build-id` (channel baseline); `wp migrate --yes` upgrades legacy projects
|
package/dist/cli.js
CHANGED
|
@@ -2143,6 +2143,7 @@ ${detail}`,
|
|
|
2143
2143
|
// src/cli/commands/deploy.ts
|
|
2144
2144
|
async function runDeploy(ctx, options) {
|
|
2145
2145
|
const tier = options.tier ?? DEFAULT_BUILD_TIER;
|
|
2146
|
+
const skipUpload = options.skipUpload || process.env.PORTAL_MODULE_GIT_ONLY === "1" || process.env.PORTAL_MODULE_GIT_ONLY === "true";
|
|
2146
2147
|
const intro = `${formatProjectLabel(ctx.config)} \xB7 deploy (${tier})`;
|
|
2147
2148
|
const quietSubprocess = shouldQuietSubprocess(ctx, options);
|
|
2148
2149
|
const nested = {
|
|
@@ -2181,15 +2182,19 @@ async function runDeploy(ctx, options) {
|
|
|
2181
2182
|
dryRun: ctx.global.dryRun,
|
|
2182
2183
|
streamOutput: ctx.global.verbose
|
|
2183
2184
|
};
|
|
2185
|
+
if (!skipUpload) {
|
|
2186
|
+
ensureHubSpotCliSetup(ctx, "cms");
|
|
2187
|
+
}
|
|
2184
2188
|
const verifyFlag = tier === "prod" ? ["--prod"] : tier === "stg" ? ["--stg"] : ["--dev"];
|
|
2185
|
-
const tasks = [
|
|
2186
|
-
|
|
2189
|
+
const tasks = [];
|
|
2190
|
+
if (!skipUpload) {
|
|
2191
|
+
tasks.push({
|
|
2187
2192
|
title: "Checking HubSpot CLI",
|
|
2188
2193
|
task: async () => {
|
|
2189
2194
|
ensureHubSpotCliSetup(ctx, "cms");
|
|
2190
2195
|
}
|
|
2191
|
-
}
|
|
2192
|
-
|
|
2196
|
+
});
|
|
2197
|
+
}
|
|
2193
2198
|
if (useCdn) {
|
|
2194
2199
|
tasks.push({
|
|
2195
2200
|
title: `Building CDN (${tier})`,
|
|
@@ -2232,8 +2237,10 @@ async function runDeploy(ctx, options) {
|
|
|
2232
2237
|
await runNodeScriptAsync(kitPath("scripts", "check-hubspot-bundle-size.mjs"), [], execOpts);
|
|
2233
2238
|
await runNodeScriptAsync(kitPath("scripts", "write-audit-artifacts.mjs"), [], execOpts);
|
|
2234
2239
|
}
|
|
2235
|
-
}
|
|
2236
|
-
|
|
2240
|
+
}
|
|
2241
|
+
);
|
|
2242
|
+
if (!skipUpload) {
|
|
2243
|
+
tasks.push({
|
|
2237
2244
|
title: "Uploading to HubSpot",
|
|
2238
2245
|
task: async () => {
|
|
2239
2246
|
await runUpload(ctx, {
|
|
@@ -2242,8 +2249,10 @@ async function runDeploy(ctx, options) {
|
|
|
2242
2249
|
skipPrereqCheck: true
|
|
2243
2250
|
});
|
|
2244
2251
|
}
|
|
2245
|
-
}
|
|
2246
|
-
)
|
|
2252
|
+
});
|
|
2253
|
+
} else if (!ctx.global.quiet && !ctx.global.json) {
|
|
2254
|
+
ctx.logger.info("Skipping HubSpot upload (module git push / PORTAL_MODULE_GIT_ONLY)");
|
|
2255
|
+
}
|
|
2247
2256
|
await runCliTasks(ctx, tasks, {
|
|
2248
2257
|
...options,
|
|
2249
2258
|
intro
|
|
@@ -2333,6 +2342,7 @@ var FORBIDDEN_SHIP_TOKENS = [
|
|
|
2333
2342
|
"src/dev/module-config",
|
|
2334
2343
|
"dev.module-config"
|
|
2335
2344
|
];
|
|
2345
|
+
var FORBIDDEN_FIXTURE_MENU_TOKENS = ["User Home", "Primary Company Deals"];
|
|
2336
2346
|
function hashFile(path) {
|
|
2337
2347
|
return createHash("sha256").update(readFileSync8(path)).digest("hex");
|
|
2338
2348
|
}
|
|
@@ -2366,6 +2376,14 @@ async function runAuditShipBundle(ctx) {
|
|
|
2366
2376
|
violations.push(`${file}: contains forbidden token "${token}"`);
|
|
2367
2377
|
}
|
|
2368
2378
|
}
|
|
2379
|
+
const isCdnAppBundle = /[/\\]dist[/\\]cdn[/\\]app\..*\.js$/i.test(file);
|
|
2380
|
+
if (isCdnAppBundle) {
|
|
2381
|
+
for (const token of FORBIDDEN_FIXTURE_MENU_TOKENS) {
|
|
2382
|
+
if (content.includes(token)) {
|
|
2383
|
+
violations.push(`${file}: contains fixture menu marker "${token}"`);
|
|
2384
|
+
}
|
|
2385
|
+
}
|
|
2386
|
+
}
|
|
2369
2387
|
}
|
|
2370
2388
|
}
|
|
2371
2389
|
if (ctx.global.json) {
|
|
@@ -3874,12 +3892,13 @@ function createProgram() {
|
|
|
3874
3892
|
);
|
|
3875
3893
|
}
|
|
3876
3894
|
);
|
|
3877
|
-
program2.command("deploy").description("Build, publish CDN, upload HubSpot module").option("--tier <tier>", "dev | stg | prod", DEFAULT_BUILD_TIER).option("--skip-publish", "Skip CDN publish").action(async (opts) => {
|
|
3895
|
+
program2.command("deploy").description("Build, publish CDN, upload HubSpot module").option("--tier <tier>", "dev | stg | prod", DEFAULT_BUILD_TIER).option("--skip-publish", "Skip CDN publish").option("--skip-upload", "Skip HubSpot cms upload (e.g. CodeBuild module-git push)").action(async (opts) => {
|
|
3878
3896
|
const global = program2.opts();
|
|
3879
3897
|
await handle(
|
|
3880
3898
|
() => runDeploy(buildContext(global), {
|
|
3881
3899
|
tier: parseBuildTier(opts.tier),
|
|
3882
|
-
skipPublish: opts.skipPublish
|
|
3900
|
+
skipPublish: opts.skipPublish,
|
|
3901
|
+
skipUpload: opts.skipUpload
|
|
3883
3902
|
})
|
|
3884
3903
|
);
|
|
3885
3904
|
});
|