@woodsportal/hubspot-kit 1.0.2
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 +31 -0
- package/LICENSE +21 -0
- package/README.md +62 -0
- package/SECURITY.md +27 -0
- package/dist/chunk-JDGIAYHX.js +87 -0
- package/dist/chunk-JDGIAYHX.js.map +1 -0
- package/dist/chunk-U4KFGTEW.js +136 -0
- package/dist/chunk-U4KFGTEW.js.map +1 -0
- package/dist/cli.js +1849 -0
- package/dist/cli.js.map +1 -0
- package/dist/exec-K5C6LZP4.js +10 -0
- package/dist/exec-K5C6LZP4.js.map +1 -0
- package/dist/index.d.ts +228 -0
- package/dist/index.js +204 -0
- package/dist/index.js.map +1 -0
- package/dist/vite/index.d.ts +17 -0
- package/dist/vite/index.js +9 -0
- package/dist/vite/index.js.map +1 -0
- package/examples/README.md +12 -0
- package/examples/fixtures/adopted-module-hybrid/public/fields.json +1 -0
- package/examples/fixtures/adopted-module-hybrid/public/module.html +1 -0
- package/examples/fixtures/adopted-module-hybrid/woodscli.json +7 -0
- package/examples/fixtures/adopted-module-monolith/public/fields.json +1 -0
- package/examples/fixtures/adopted-module-monolith/woodscli.json +7 -0
- package/examples/fixtures/adopted-theme-minimal/src/theme/templates/page.html +1 -0
- package/examples/fixtures/adopted-theme-minimal/src/theme/theme.json +1 -0
- package/examples/fixtures/adopted-theme-minimal/woodscli.json +7 -0
- package/examples/fixtures/existing-module-hybrid/public/fields.json +1 -0
- package/examples/fixtures/existing-module-hybrid/public/module.html +1 -0
- package/examples/fixtures/existing-theme-minimal/templates/page.html +1 -0
- package/examples/fixtures/existing-theme-minimal/theme.json +1 -0
- package/examples/greenfield/module-hybrid-cdn/README.md +9 -0
- package/examples/greenfield/module-hybrid-cdn/index.html +1 -0
- package/examples/greenfield/module-hybrid-cdn/package.json +14 -0
- package/examples/greenfield/module-hybrid-cdn/public/fields.json +1 -0
- package/examples/greenfield/module-hybrid-cdn/public/module.html +1 -0
- package/examples/greenfield/module-hybrid-cdn/src/main.tsx +2 -0
- package/examples/greenfield/module-hybrid-cdn/vite.config.dev.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn/vite.config.hubspot.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn/woodscli.json +8 -0
- package/examples/greenfield/module-hybrid-cdn/wphs.adapter.ts +7 -0
- package/examples/greenfield/module-monolith/package.json +12 -0
- package/examples/greenfield/module-monolith/public/fields.json +1 -0
- package/examples/greenfield/module-monolith/vite.config.dev.mjs +1 -0
- package/examples/greenfield/module-monolith/vite.config.monolith.mjs +1 -0
- package/examples/greenfield/module-monolith/woodscli.json +25 -0
- package/examples/greenfield/module-monolith/wphs.adapter.ts +7 -0
- package/examples/greenfield/theme-starter/package.json +11 -0
- package/examples/greenfield/theme-starter/src/theme/css/main.css +1 -0
- package/examples/greenfield/theme-starter/src/theme/templates/base.html +1 -0
- package/examples/greenfield/theme-starter/src/theme/templates/page.html +1 -0
- package/examples/greenfield/theme-starter/src/theme/theme.json +1 -0
- package/examples/greenfield/theme-starter/theme.json +6 -0
- package/examples/greenfield/theme-starter/vite.config.dev.mjs +1 -0
- package/examples/greenfield/theme-starter/woodscli.json +7 -0
- package/examples/manifest.json +20 -0
- package/examples/smoke/run-matrix.mjs +100 -0
- package/package.json +94 -0
- package/scripts/audit-module-config-fields.mjs +73 -0
- package/scripts/audit-parity.mjs +22 -0
- package/scripts/audit-tdz-split.mjs +111 -0
- package/scripts/build-cdn.mjs +36 -0
- package/scripts/check-hubspot-bundle-size.mjs +58 -0
- package/scripts/config-files.mjs +53 -0
- package/scripts/detect-layout.mjs +70 -0
- package/scripts/ensure-wphs-workspace.mjs +53 -0
- package/scripts/generate-cdn-manifest.mjs +92 -0
- package/scripts/generate-module-config-example.mjs +57 -0
- package/scripts/hubspot-module-postbuild.mjs +151 -0
- package/scripts/load-portal-cdn-config.mjs +91 -0
- package/scripts/migrate-sdk-3-api.mjs +144 -0
- package/scripts/module-config-dir.mjs +12 -0
- package/scripts/portal-env-mode.mjs +24 -0
- package/scripts/portal-vite-env.mjs +39 -0
- package/scripts/project-root.mjs +30 -0
- package/scripts/publish-cdn-github.mjs +273 -0
- package/scripts/read-woodsportal-config.mjs +40 -0
- package/scripts/resolve-cdn-base-url.mjs +32 -0
- package/scripts/resolve-consumer-dep.mjs +25 -0
- package/scripts/resolve-portal-build-id.mjs +67 -0
- package/scripts/run-dev.mjs +93 -0
- package/scripts/run-hubspot-module-postbuild.mjs +19 -0
- package/scripts/run-vite-build.mjs +33 -0
- package/scripts/tailwind/prefix-plugin.js +291 -0
- package/scripts/tailwind/prefix.env.js +11 -0
- package/scripts/tailwind/tailwind-content-plugin.js +27 -0
- package/scripts/tailwind/tailwind-content.js +267 -0
- package/scripts/verify-cdn-api-endpoint.mjs +68 -0
- package/scripts/vite/ensure-dev-kit-shims.js +49 -0
- package/scripts/vite/ensure-dev-module-config-shim.js +1 -0
- package/scripts/vite/module-config-store.js +242 -0
- package/scripts/vite/plugins.d.ts +9 -0
- package/scripts/vite/portal-build-shared.js +110 -0
- package/scripts/vite/react-dev-plugin-options.js +21 -0
- package/scripts/vite/resolve-from-project-root.js +31 -0
- package/scripts/vite/sdk-log-bridge.js +104 -0
- package/scripts/watch-hubspot.mjs +86 -0
- package/scripts/wphs-paths.mjs +115 -0
- package/scripts/write-audit-artifacts.mjs +56 -0
- package/templates/hubspot.config.yml.example +10 -0
- package/templates/module-hybrid-cdn/README.md +9 -0
- package/templates/module-hybrid-cdn/hubspot.config.yml.example +10 -0
- package/templates/module-hybrid-cdn/index.html +1 -0
- package/templates/module-hybrid-cdn/package.json +14 -0
- package/templates/module-hybrid-cdn/public/fields.json +1 -0
- package/templates/module-hybrid-cdn/public/module.html +1 -0
- package/templates/module-hybrid-cdn/src/main.tsx +2 -0
- package/templates/module-hybrid-cdn/vite.config.dev.mjs +1 -0
- package/templates/module-hybrid-cdn/vite.config.hubspot.mjs +1 -0
- package/templates/module-hybrid-cdn/woodscli.json +8 -0
- package/templates/module-hybrid-cdn/wphs.adapter.ts +7 -0
- package/templates/module-monolith/hubspot.config.yml.example +10 -0
- package/templates/module-monolith/package.json +12 -0
- package/templates/module-monolith/public/fields.json +1 -0
- package/templates/module-monolith/vite.config.dev.mjs +1 -0
- package/templates/module-monolith/vite.config.monolith.mjs +1 -0
- package/templates/module-monolith/woodscli.json +25 -0
- package/templates/module-monolith/wphs.adapter.ts +7 -0
- package/templates/theme-starter/hubspot.config.yml.example +10 -0
- package/templates/theme-starter/package.json +11 -0
- package/templates/theme-starter/src/theme/css/main.css +1 -0
- package/templates/theme-starter/src/theme/templates/base.html +1 -0
- package/templates/theme-starter/src/theme/templates/page.html +1 -0
- package/templates/theme-starter/src/theme/theme.json +1 -0
- package/templates/theme-starter/theme.json +6 -0
- package/templates/theme-starter/vite.config.dev.mjs +1 -0
- package/templates/theme-starter/woodscli.json +7 -0
- package/vite/vite.config.audit.mjs +33 -0
- package/vite/vite.config.cdn-app.mjs +44 -0
- package/vite/vite.config.cdn-esm.mjs +35 -0
- package/vite/vite.config.cdn-vendor.mjs +33 -0
- package/vite/vite.config.dev.mjs +62 -0
- package/vite/vite.config.hubspot.mjs +33 -0
- package/vite/vite.config.monolith.mjs +55 -0
- package/vite/vite.config.tdz-audit.mjs +58 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Monolith HubSpot module build — single IIFE module.js from localDev entry.
|
|
3
|
+
* Re-export from consumer: vite.config.monolith.mjs
|
|
4
|
+
*/
|
|
5
|
+
import { defineConfig } from 'vite'
|
|
6
|
+
import react from '@vitejs/plugin-react'
|
|
7
|
+
import tailwindcss from '@tailwindcss/vite'
|
|
8
|
+
import { dirname, resolve } from 'node:path'
|
|
9
|
+
import { fileURLToPath } from 'node:url'
|
|
10
|
+
import { createRequire } from 'node:module'
|
|
11
|
+
|
|
12
|
+
import { readWoodsportalConfig } from '../scripts/read-woodsportal-config.mjs'
|
|
13
|
+
|
|
14
|
+
const require = createRequire(import.meta.url)
|
|
15
|
+
const kitRoot = dirname(require.resolve('@woodsportal/hubspot-kit/package.json'))
|
|
16
|
+
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
17
|
+
|
|
18
|
+
const { root, config } = readWoodsportalConfig(__dirname)
|
|
19
|
+
const outDir = config?.module?.outDir ?? 'dist/HubSpot.Module'
|
|
20
|
+
const entry = config?.entries?.localDev ?? 'src/main.tsx'
|
|
21
|
+
|
|
22
|
+
export default defineConfig({
|
|
23
|
+
plugins: [react(), tailwindcss()],
|
|
24
|
+
resolve: {
|
|
25
|
+
alias: {
|
|
26
|
+
'@': resolve(root, 'src'),
|
|
27
|
+
'@wphs/adapter': resolve(root, config?.dev?.adapter ?? './wphs.adapter.ts'),
|
|
28
|
+
'@/dev/module-config': resolve(kitRoot, 'src/dev-module-config'),
|
|
29
|
+
'@woodsportal/hubspot-kit/dev/bootstrap': resolve(kitRoot, 'src/dev/bootstrap.tsx'),
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
define: {
|
|
33
|
+
'process.env.NODE_ENV': JSON.stringify('production'),
|
|
34
|
+
'process.env': {},
|
|
35
|
+
process: JSON.stringify({ env: {} }),
|
|
36
|
+
},
|
|
37
|
+
build: {
|
|
38
|
+
outDir: resolve(root, outDir),
|
|
39
|
+
copyPublicDir: false,
|
|
40
|
+
cssCodeSplit: false,
|
|
41
|
+
lib: {
|
|
42
|
+
entry: resolve(root, entry),
|
|
43
|
+
name: 'HubSpotModule',
|
|
44
|
+
fileName: () => 'module.js',
|
|
45
|
+
formats: ['iife'],
|
|
46
|
+
},
|
|
47
|
+
rollupOptions: {
|
|
48
|
+
output: {
|
|
49
|
+
assetFileNames: 'module.css',
|
|
50
|
+
inlineDynamicImports: true,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
minify: true,
|
|
54
|
+
},
|
|
55
|
+
})
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TDZ audit config: production plugins with route code-splitting + no inlineDynamicImports.
|
|
3
|
+
* Usage: yarn vite build --config vite.config.tdz-audit.mjs
|
|
4
|
+
*/
|
|
5
|
+
import viteReact from '@vitejs/plugin-react'
|
|
6
|
+
import { TanStackRouterVite } from '@tanstack/router-plugin/vite'
|
|
7
|
+
import { defineConfig } from 'vite'
|
|
8
|
+
import { resolve, dirname } from 'node:path'
|
|
9
|
+
import { fileURLToPath } from 'node:url'
|
|
10
|
+
import tailwindcss from '@tailwindcss/vite'
|
|
11
|
+
import tailwindPrefixPlugin from './scripts/tailwind/prefix-plugin.js'
|
|
12
|
+
import TailwindContentPlugin from './scripts/tailwind/tailwind-content-plugin.js'
|
|
13
|
+
import isPrefix from './scripts/tailwind/prefix.env.js'
|
|
14
|
+
|
|
15
|
+
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
16
|
+
const mode = 'production'
|
|
17
|
+
|
|
18
|
+
export default defineConfig({
|
|
19
|
+
plugins: [
|
|
20
|
+
TanStackRouterVite({ autoCodeSplitting: true }),
|
|
21
|
+
viteReact({
|
|
22
|
+
babel: { plugins: ['babel-plugin-react-compiler'] },
|
|
23
|
+
}),
|
|
24
|
+
tailwindcss(),
|
|
25
|
+
...(isPrefix(mode)
|
|
26
|
+
? [tailwindPrefixPlugin(), TailwindContentPlugin()]
|
|
27
|
+
: []),
|
|
28
|
+
],
|
|
29
|
+
resolve: {
|
|
30
|
+
alias: { '@': resolve(__dirname, './src') },
|
|
31
|
+
},
|
|
32
|
+
define: {
|
|
33
|
+
'process.env.NODE_ENV': JSON.stringify('production'),
|
|
34
|
+
'process.env': {},
|
|
35
|
+
process: JSON.stringify({ env: {} }),
|
|
36
|
+
},
|
|
37
|
+
build: {
|
|
38
|
+
outDir: 'dist/TdzAudit',
|
|
39
|
+
emptyOutDir: true,
|
|
40
|
+
copyPublicDir: false,
|
|
41
|
+
cssCodeSplit: true,
|
|
42
|
+
lib: {
|
|
43
|
+
entry: 'src/main.tsx',
|
|
44
|
+
name: 'TdzAuditModule',
|
|
45
|
+
fileName: () => 'module.js',
|
|
46
|
+
formats: ['iife'],
|
|
47
|
+
},
|
|
48
|
+
rollupOptions: {
|
|
49
|
+
external: [],
|
|
50
|
+
output: {
|
|
51
|
+
assetFileNames: 'module.css',
|
|
52
|
+
inlineDynamicImports: false,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
minify: true,
|
|
56
|
+
sourcemap: true,
|
|
57
|
+
},
|
|
58
|
+
})
|