@c15t/cli 1.3.4-canary-20250626090931 → 1.4.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/dist/index.mjs +30 -30
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -704,7 +704,7 @@ export const c15tConfig = {
|
|
|
704
704
|
} satisfies ConsentManagerOptions;
|
|
705
705
|
|
|
706
706
|
// Use in your app layout:
|
|
707
|
-
// <ConsentManagerProvider {
|
|
707
|
+
// <ConsentManagerProvider options={c15tConfig}>
|
|
708
708
|
// {children}
|
|
709
709
|
// <CookieBanner />
|
|
710
710
|
// <ConsentManagerDialog />
|
|
@@ -728,7 +728,7 @@ export const c15tConfig = {
|
|
|
728
728
|
} satisfies ConsentManagerOptions;
|
|
729
729
|
|
|
730
730
|
// Use in your app layout:
|
|
731
|
-
// <ConsentManagerProvider {
|
|
731
|
+
// <ConsentManagerProvider options={c15tConfig}>
|
|
732
732
|
// {children}
|
|
733
733
|
// <CookieBanner />
|
|
734
734
|
// <ConsentManagerDialog />
|
|
@@ -754,7 +754,7 @@ export const c15tConfig = {
|
|
|
754
754
|
} satisfies ConsentManagerOptions;
|
|
755
755
|
|
|
756
756
|
// Use in your app layout:
|
|
757
|
-
// <ConsentManagerProvider {
|
|
757
|
+
// <ConsentManagerProvider options={c15tConfig}>
|
|
758
758
|
// {children}
|
|
759
759
|
// <CookieBanner />
|
|
760
760
|
// <ConsentManagerDialog />
|
|
@@ -802,34 +802,34 @@ function findLayoutFile(project, projectRoot) {
|
|
|
802
802
|
function generateOptionsText(mode, backendURL, useEnvFile, proxyNextjs) {
|
|
803
803
|
switch(mode){
|
|
804
804
|
case 'c15t':
|
|
805
|
-
if (proxyNextjs) return `
|
|
806
|
-
mode
|
|
807
|
-
backendURL
|
|
808
|
-
consentCategories
|
|
809
|
-
ignoreGeoLocation
|
|
810
|
-
`;
|
|
811
|
-
if (useEnvFile) return `
|
|
812
|
-
mode
|
|
813
|
-
backendURL
|
|
814
|
-
consentCategories
|
|
815
|
-
ignoreGeoLocation
|
|
816
|
-
`;
|
|
817
|
-
return `
|
|
818
|
-
mode
|
|
819
|
-
backendURL
|
|
820
|
-
consentCategories
|
|
821
|
-
|
|
822
|
-
`;
|
|
805
|
+
if (proxyNextjs) return `{
|
|
806
|
+
mode: 'c15t',
|
|
807
|
+
backendURL: '/api/c15t',
|
|
808
|
+
consentCategories: ['necessary', 'marketing'], // Optional: Specify which consent categories to show in the banner.
|
|
809
|
+
ignoreGeoLocation: true, // Useful for development to always view the banner.
|
|
810
|
+
}`;
|
|
811
|
+
if (useEnvFile) return `{
|
|
812
|
+
mode: 'c15t',
|
|
813
|
+
backendURL: process.env.NEXT_PUBLIC_C15T_URL!,
|
|
814
|
+
consentCategories: ['necessary', 'marketing'], // Optional: Specify which consent categories to show in the banner.
|
|
815
|
+
ignoreGeoLocation: true, // Useful for development to always view the banner.
|
|
816
|
+
}`;
|
|
817
|
+
return `{
|
|
818
|
+
mode: 'c15t',
|
|
819
|
+
backendURL: '${backendURL || 'https://your-instance.c15t.dev'}',
|
|
820
|
+
consentCategories: ['necessary', 'marketing'], // Optional: Specify which consent categories to show in the banner.
|
|
821
|
+
ignoreGeoLocation: true, // Useful for development to always view the banner.
|
|
822
|
+
}`;
|
|
823
823
|
case 'custom':
|
|
824
|
-
return `
|
|
825
|
-
mode
|
|
826
|
-
endpointHandlers
|
|
827
|
-
`;
|
|
824
|
+
return `{
|
|
825
|
+
mode: 'custom',
|
|
826
|
+
endpointHandlers: createCustomHandlers(),
|
|
827
|
+
}`;
|
|
828
828
|
default:
|
|
829
|
-
return `
|
|
830
|
-
mode
|
|
831
|
-
consentCategories
|
|
832
|
-
`;
|
|
829
|
+
return `{
|
|
830
|
+
mode: 'offline',
|
|
831
|
+
consentCategories: ['necessary', 'marketing'], // Optional: Specify which consent categories to show in the banner.
|
|
832
|
+
}`;
|
|
833
833
|
}
|
|
834
834
|
}
|
|
835
835
|
function updateImports(layoutFile, packageName, mode) {
|
|
@@ -861,7 +861,7 @@ function wrapJsxContent(originalJsx, optionsText) {
|
|
|
861
861
|
const hasHtmlTag = originalJsx.includes('<html') || originalJsx.includes('</html>');
|
|
862
862
|
const hasBodyTag = originalJsx.includes('<body') || originalJsx.includes('</body>');
|
|
863
863
|
const providerWrapper = (content)=>`
|
|
864
|
-
<ConsentManagerProvider ${optionsText}>
|
|
864
|
+
<ConsentManagerProvider options={${optionsText}}>
|
|
865
865
|
<CookieBanner />
|
|
866
866
|
<ConsentManagerDialog />
|
|
867
867
|
${content}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c15t/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "The CLI for c15t",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.mjs",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"posthog-node": "^4.11.7",
|
|
30
30
|
"ts-morph": "^25.0.1",
|
|
31
31
|
"zod": "^3.24.2",
|
|
32
|
-
"@c15t/backend": "1.
|
|
33
|
-
"@c15t/react": "1.
|
|
32
|
+
"@c15t/backend": "1.4.1",
|
|
33
|
+
"@c15t/react": "1.4.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/figlet": "^1.7.0",
|