Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Begin publishing npm tarballs to S3.
(cherry picked from commit bd7e62f)
- Loading branch information
Showing
9 changed files
with
121 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,3 +40,5 @@ bower_components/ | |
npm-debug.log | ||
.ember-cli | ||
DEBUG/ | ||
*.tgz | ||
*.tar.gz |
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,53 @@ | ||
#!/usr/bin/env node | ||
'use strict'; | ||
|
||
const fs = require('fs'); | ||
const path = require('path'); | ||
const execSync = require('child_process').execSync; | ||
|
||
/* | ||
Updates the `package.json`'s `version` string to be the same value that | ||
the built assets will have as `Ember.VERSION`. | ||
*/ | ||
function updatePackageJSONVersion() { | ||
let packageJSONPath = path.join(__dirname, '..', 'package.json'); | ||
let VERSION = require('../broccoli/version').VERSION; | ||
|
||
let pkgContents = fs.readFileSync(packageJSONPath, { encoding: 'utf-8' }); | ||
let pkg = JSON.parse(pkgContents); | ||
pkg._versionPreviouslyCalculated = true; | ||
pkg._originalVersion = pkg.version; | ||
pkg.version = VERSION; | ||
fs.writeFileSync(packageJSONPath, JSON.stringify(pkg, null, 2), { encoding: 'utf-8' }); | ||
} | ||
|
||
/* | ||
Updates the version number listed within the docs/data.json file to match | ||
`Ember.VERSION` and `package.json` version. | ||
This is needed because ember-cli-yuidoc automatically sets the version string | ||
property in the generated `docs/data.json` to | ||
`${packageJsonVersion}.${gitSha}`. | ||
*/ | ||
function updateDocumentationVersion() { | ||
let docsPath = path.join(__dirname, '..', 'docs', 'data.json'); | ||
let VERSION = require('../broccoli/version').VERSION; | ||
|
||
let contents = fs.readFileSync(docsPath, { encoding: 'utf-8' }); | ||
let docs = JSON.parse(contents); | ||
docs.project.version = VERSION; | ||
fs.writeFileSync(docsPath, JSON.stringify(docs, null, 2), { encoding: 'utf-8' }); | ||
} | ||
|
||
updatePackageJSONVersion(); | ||
|
||
// do a production build | ||
execSync('yarn build'); | ||
|
||
// generate docs | ||
execSync('yarn docs'); | ||
updateDocumentationVersion(); | ||
|
||
// using npm pack here because `yarn pack` does not honor the `package.json`'s `files` | ||
// property properly, and therefore the tarball generated is quite large (~7MB). | ||
execSync('npm pack'); |
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
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
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.