Skip to content

Commit

Permalink
[added] Deprecation warning for individual file use in the Bower release
Browse files Browse the repository at this point in the history
Preparatory step for react-bootstrap#693
  • Loading branch information
mtscout6 committed Jun 11, 2015
1 parent f2da250 commit 3a254a1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/utils/deprecationWarning.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function deprecationWarning(oldname, newname, link) {
console.warn(message);

if (link) {
console.warn(`You can read more about it here ${link}`);
console.warn(`You can read more about it at ${link}`);
}
}
}
5 changes: 4 additions & 1 deletion tools/amd/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ const bowerJson = path.join(bowerRoot, 'bower.json');
const readme = path.join(__dirname, 'README.md');
const license = path.join(repoRoot, 'LICENSE');

const babelOptions = {modules: 'amd'};
const babelOptions = {
__reactBootstrapDeprecationWarning: true,
modules: 'amd'
};

const libDestination = path.join(bowerRoot, 'lib');
const factoriesDestination = path.join(libDestination, 'factories');
Expand Down
8 changes: 7 additions & 1 deletion tools/buildBabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ export function buildContent(content, filename, destination, babelOptions={}) {
}

export function buildFile(filename, destination, babelOptions={}) {
const content = fs.readFileSync(filename, {encoding: 'utf8'});
let content = fs.readFileSync(filename, {encoding: 'utf8'});
if (babelOptions.__reactBootstrapDeprecationWarning) {
content = `console.warn('This file is deprecated, and will be removed in v0.24.0. Use react-bootstrap.js or react-bootstrap.min.js instead.');
console.warn('You can read more about it at https://github.com/react-bootstrap/react-bootstrap/issues/693');
${content}`;
}

if(babelUtil.canCompile(filename)) {
// Get file basename without the extension (in case not .js)
let outputName = path.basename(filename, path.extname(filename));
Expand Down

0 comments on commit 3a254a1

Please sign in to comment.