-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
37b4800
commit 8d8b81f
Showing
18 changed files
with
249 additions
and
1,187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { build } from "esbuild"; | ||
|
||
async function buildAll(): Promise<void> { | ||
await Promise.all([ | ||
build({ | ||
platform: "node", | ||
format: "esm", | ||
splitting: true, | ||
entryPoints: ["src/index.ts"], | ||
outdir: "dist/node", | ||
bundle: true, | ||
minify: MINIFY, | ||
sourcemap: SOURCEMAP, | ||
banner: esmNodeSupportBanner, | ||
external: ["@opentelemetry/api"], | ||
plugins: [externalCjsToEsmPlugin(peerDependencies)], | ||
}), | ||
build({ | ||
target: "esnext", | ||
format: "esm", | ||
splitting: false, | ||
entryPoints: ["src/index.ts"], | ||
outdir: "dist/edge", | ||
bundle: true, | ||
minify: MINIFY, | ||
sourcemap: SOURCEMAP, | ||
banner: edgeSupportBanner, | ||
external: ["@opentelemetry/api"], | ||
plugins: [ | ||
externalCjsToEsmPlugin(["async_hooks", "events", ...peerDependencies]), | ||
stripEvalEdge, | ||
], | ||
}), | ||
]); | ||
|
||
// Check max size. | ||
const errors: string[] = []; | ||
for (const [file, maxSize] of Object.entries(MAX_SIZES)) { | ||
// eslint-disable-next-line no-await-in-loop | ||
const s = await stat(file); | ||
if (s.size > maxSize) { | ||
errors.push( | ||
`${file}: the size of ${s.size} is over the maximum allowed size of ${maxSize}` | ||
); | ||
} | ||
} | ||
if (errors.length > 0) { | ||
for (const error of errors) { | ||
// eslint-disable-next-line no-console | ||
console.error(error); | ||
} | ||
process.exit(1); | ||
} | ||
} | ||
|
||
void buildAll(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export const GTMScript = ({ id }: { id: string }) => { | ||
return ( | ||
<script | ||
dangerouslySetInnerHTML={{ | ||
__html: ` | ||
(function(w,d,s,l,g,i){w[l]=w[l]||[];w[l].push({'gtm.start': | ||
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], | ||
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= | ||
'/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); | ||
w[g]=function(){w[l].push(arguments);} | ||
})(window,document,'script','dataLayer','gtag','${id}'); | ||
`, | ||
}} | ||
/> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1 @@ | ||
import * as React from 'react'; | ||
|
||
export const GTMScript = ({ id }: { id: string }) => { | ||
return ( | ||
<script | ||
dangerouslySetInnerHTML={{ | ||
__html: ` | ||
(function(w,d,s,l,g,i){w[l]=w[l]||[];w[l].push({'gtm.start': | ||
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], | ||
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= | ||
'/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); | ||
w[g]=function(){w[l].push(arguments);} | ||
})(window,document,'script','dataLayer','gtag','${id}'); | ||
`, | ||
}} | ||
/> | ||
); | ||
}; | ||
export * from './GTMScript' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/sesamy/src/types/index.ts → packages/sesamy/src/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export interface Event { | ||
name: string; | ||
params: any; | ||
params?: Record<string, any>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/tsconfig", | ||
"extends": "@repo/config-typescript/react-jsx-library.json", | ||
"extends": "@repo/typescript-config/library-jsx.json", | ||
"compilerOptions": { | ||
"outDir": "./dist" | ||
"outDir": "./dist", | ||
"lib": ["DOM", "ESNext"], | ||
"paths": { | ||
"@/*": ["./src/*"] | ||
} | ||
}, | ||
"include": ["."], | ||
"exclude": ["dist", "build", "node_modules"] | ||
"exclude": ["node_modules", "dist"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/tsconfig", | ||
"compilerOptions": { | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"noUncheckedIndexedAccess": true, | ||
"skipLibCheck": true, | ||
"strict": true | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
...ages/config-typescript/react-library.json → packages/typescript-config/library-jsx.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/tsconfig", | ||
"display": "React Library", | ||
"display": "JSX Library", | ||
"extends": "./library.json", | ||
"compilerOptions": { | ||
"lib": ["DOM", "DOM.Iterable", "ES2015"] | ||
"jsx": "react-jsx" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/tsconfig", | ||
"display": "Library", | ||
"extends": "./base.json", | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"incremental": true, | ||
"lib": ["ESNext"], | ||
"module": "ESNext", | ||
"moduleResolution": "Node", | ||
"noEmit": true, | ||
"strict": true, | ||
"noUncheckedIndexedAccess": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"esModuleInterop": true, | ||
"isolatedModules": true, | ||
"resolveJsonModule": true, | ||
"skipLibCheck": true, | ||
// Node 16 has 100% ES2021 support (https://node.green/#ES2021) | ||
"target": "ES2021" | ||
}, | ||
"exclude": ["node_modules", "dist"] | ||
} |
2 changes: 1 addition & 1 deletion
2
packages/config-typescript/package.json → packages/typescript-config/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.