-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ref(build): Add central build
directory to packages without CDN bundles (Part 1)
#4854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
67e5952
adjust `prepack.ts` to distinguish between packages with/-out bundles
Lms24 883ba49
add build dir to `@sentry/core`
Lms24 92c07de
add build dir to `@sentry/gatsby`
Lms24 f03d3b6
add build dir to `@sentry/hub`
Lms24 25ff8a6
add build dir to `@sentry/minimal`
Lms24 0a56148
prepack: use dynamic imports instead of child process
Lms24 356775d
adjust prepack.ts to exit with error when package-specific prepack.ts…
Lms24 c0cf355
apply review suggestions
Lms24 d70d4ef
change variable name, add error message
Lms24 f918c59
Update scripts/prepack.ts
AbhiPrasad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,9 @@ | ||
# Info: the paths in this file are specified so that they align with the file | ||
# structure in `./build` where this file is copied to. This is done by the | ||
# prepack script `sentry-javascript/scripts/prepack.ts`. | ||
|
||
* | ||
|
||
!/dist/**/* | ||
!/esm/**/* | ||
!/build/types/**/* | ||
!/types/**/* |
This file contains hidden or 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 hidden or 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 |
---|---|---|
|
@@ -3,6 +3,6 @@ | |
|
||
"compilerOptions": { | ||
"module": "commonjs", | ||
"outDir": "dist" | ||
"outDir": "build/dist" | ||
} | ||
} |
This file contains hidden or 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 |
---|---|---|
|
@@ -3,6 +3,6 @@ | |
|
||
"compilerOptions": { | ||
"module": "es6", | ||
"outDir": "esm" | ||
"outDir": "build/esm" | ||
} | ||
} |
This file contains hidden or 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 hidden or 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,6 +1,13 @@ | ||
# Info: the paths in this file are specified so that they align with the file | ||
# structure in `./build` where this file is copied to. This is done by the | ||
# prepack script `sentry-javascript/scripts/prepack.ts`. | ||
|
||
* | ||
|
||
!/dist/**/* | ||
!/esm/**/* | ||
!/build/types/**/* | ||
!/types/**/* | ||
|
||
# Gatsby specific | ||
!gatsby-browser.js | ||
!gatsby-node.js |
This file contains hidden or 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 hidden or 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,27 @@ | ||
/* eslint-disable no-console */ | ||
|
||
// DO NOT RUN this script yourself! | ||
// This is invoked from the main `prepack.ts` script in `sentry-javascript/scripts/prepack.ts`. | ||
|
||
import * as fs from 'fs'; | ||
import * as path from 'path'; | ||
|
||
const PACKAGE_ASSETS = ['gatsby-browser.js', 'gatsby-node.js']; | ||
|
||
export function prepack(buildDir: string): boolean { | ||
// copy package-specific assets to build dir | ||
return PACKAGE_ASSETS.every(asset => { | ||
const assetPath = path.resolve(asset); | ||
try { | ||
if (!fs.existsSync(assetPath)) { | ||
console.error(`Asset ${asset} does not exist.`); | ||
return false; | ||
} | ||
fs.copyFileSync(assetPath, path.resolve(buildDir, asset)); | ||
} catch (error) { | ||
console.error(`Error while copying ${asset} to ${buildDir}`); | ||
return false; | ||
} | ||
return true; | ||
}); | ||
} |
This file contains hidden or 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 |
---|---|---|
|
@@ -3,6 +3,6 @@ | |
|
||
"compilerOptions": { | ||
"module": "commonjs", | ||
"outDir": "dist" | ||
"outDir": "build/dist" | ||
} | ||
} |
This file contains hidden or 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 |
---|---|---|
|
@@ -3,6 +3,6 @@ | |
|
||
"compilerOptions": { | ||
"module": "es6", | ||
"outDir": "esm" | ||
"outDir": "build/esm" | ||
} | ||
} |
This file contains hidden or 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,9 @@ | ||
# Info: the paths in this file are specified so that they align with the file | ||
# structure in `./build` where this file is copied to. This is done by the | ||
# prepack script `sentry-javascript/scripts/prepack.ts`. | ||
|
||
* | ||
|
||
!/dist/**/* | ||
!/esm/**/* | ||
!/build/types/**/* | ||
!/types/**/* |
This file contains hidden or 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 hidden or 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 |
---|---|---|
|
@@ -3,6 +3,6 @@ | |
|
||
"compilerOptions": { | ||
"module": "commonjs", | ||
"outDir": "dist" | ||
"outDir": "build/dist" | ||
} | ||
} |
This file contains hidden or 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 |
---|---|---|
|
@@ -3,6 +3,6 @@ | |
|
||
"compilerOptions": { | ||
"module": "es6", | ||
"outDir": "esm" | ||
"outDir": "build/esm" | ||
} | ||
} |
This file contains hidden or 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,9 @@ | ||
# Info: the paths in this file are specified so that they align with the file | ||
# structure in `./build` where this file is copied to. This is done by the | ||
# prepack script `sentry-javascript/scripts/prepack.ts`. | ||
|
||
* | ||
|
||
!/dist/**/* | ||
!/esm/**/* | ||
!/build/types/**/* | ||
!/types/**/* |
This file contains hidden or 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 hidden or 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 |
---|---|---|
|
@@ -3,6 +3,6 @@ | |
|
||
"compilerOptions": { | ||
"module": "commonjs", | ||
"outDir": "dist" | ||
"outDir": "build/dist" | ||
} | ||
} |
This file contains hidden or 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 |
---|---|---|
|
@@ -3,6 +3,6 @@ | |
|
||
"compilerOptions": { | ||
"module": "es6", | ||
"outDir": "esm" | ||
"outDir": "build/esm" | ||
} | ||
} |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.