Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/remix/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,12 @@ module.exports = {
rules: {
'@sentry-internal/sdk/no-async-await': 'off',
},
overrides: [
{
files: ['scripts/**/*.ts'],
parserOptions: {
project: ['../../tsconfig.dev.json'],
},
},
],
};
4 changes: 4 additions & 0 deletions packages/remix/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# The paths in this file are specified so that they align with the file structure in `./build` after this file is copied
# into it by the prepack script `scripts/prepack.ts`.

!/scripts/**/*
34 changes: 34 additions & 0 deletions packages/remix/scripts/prepack.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* eslint-disable no-console */

import * as fs from 'fs';
import * as path from 'path';

const PACKAGE_ASSETS = ['scripts/sentry-upload-sourcemaps.js', 'scripts/createRelease.js'];

export function prepack(buildDir: string): boolean {
// copy package-specific assets to build dir
return PACKAGE_ASSETS.every(asset => {
const assetPath = path.resolve(asset);
const destinationPath = path.resolve(buildDir, asset);
try {
if (!fs.existsSync(assetPath)) {
console.error(`\nERROR: Asset '${asset}' does not exist.`);
return false;
}
const scriptsDir = path.resolve(buildDir, 'scripts');
if (!fs.existsSync(scriptsDir)) {
console.log('Creating missing directory', scriptsDir);
fs.mkdirSync(scriptsDir);
}
console.log(`Copying ${path.basename(asset)} to ${path.relative('../..', destinationPath)}.`);
fs.copyFileSync(assetPath, destinationPath);
} catch (error) {
console.error(
`\nERROR: Error while copying ${path.basename(asset)} to ${path.relative('../..', destinationPath)}:\n`,
error,
);
return false;
}
return true;
});
}