chore(build): update npm package information

This commit is contained in:
Tim Lancina
2015-11-02 11:29:08 -06:00
parent 88c24f9d5d
commit f72a0e0f5a
7 changed files with 63 additions and 98 deletions

View File

@@ -18,6 +18,62 @@ We are also building out a number of starter projects, including the Ionic 2 sta
[https://github.com/driftyco/ionic2-starter](https://github.com/driftyco/ionic2-starter)
### Distribution
## Distribution
- [npm: ionic-framework](https://www.npmjs.com/package/ionic-framework)
## Ionic Framework Package
The ionic-framework package comes with both frontend dependencies, located in 'dist', and a Node API, located in 'tooling'.
### Bundles:
- `css/`
- the Ionic CSS stylesheet
- `fonts/`
- Ionicons and Roboto fonts
- `js/`
- `ionic.js` the Ionic module, in System register format
- `ionic.bundle.js` the Ionic bundle, contains:
- es6-module-loader.js
- system.js
- angular2.dev.js
- router.dev.js (angular2 router)
- ionic.js
- web-animations.min.js
- `web-animations.min.js` web animations API polyfill
### Source files:
- `src/es5` - Ionic ES5 source files in both CommonJS and System module formats
- `src/es6` - Ionic ES6 source files
- `src/ts` - Ionic TypeScript source files (typings still missing)
- `scss` - Ionic Sass source files
---------
### Tooling
At the moment, ionic-framework exports one function, `generate`, that can be used to scaffold new pages in an Ionic app. It is used by the [Ionic CLI's](https://github.com/driftyco/ionic-cli) `generate` command.
#### Methods
`generate(config)`
Creates the js, html, and scss file for a new page, based on the supplied [Generator](#generators).
- **config** (Object) Config object, with the following options:
- `appDirectory` - root directory of the Ionic project
- `generator` - which [generator](#generators) to use, default is `page`.
- `name` -
Example:
```
var ionic = require('ionic-framework');
ionic.generate({ appDirectory: process.cwd(), generator: 'tabs', name: 'MyTabsPage' })
```
#### Generators
- `page`, a blank page
- `tabs`, a page with tab navigation
- `sidemenu`

View File

@@ -497,47 +497,3 @@ gulp.task('demos:docs', ['sass.demos:docs', 'bundle.demos:docs'], function() {
gulp.task('demos', ['demos:all']);
gulp.task('publish', function(done) {
var version = flags.version;
var ngVersion = flags.ngVersion;
var dryRun = flags['dry-run'];
if (!version || !ngVersion) {
console.error("\nERR: You need to provide a version for Ionic as well as " +
"the version of Angular it depends on.\n\n" +
"gulp publish -v {version} -a {ngVersion}\n");
return
}
if (version.indexOf("alpha") + version.indexOf("-") > -2 ||
ngVersion.indexOf("alpha") + ngVersion.indexOf("-") > -2)
{
console.error("\n ERR: Just provide version number. Instead of 2.0.0-alpha.10, just enter 10\n");
return
}
var exec = require('child_process').exec;
var _ = require('lodash');
var fs = require('fs');
runSequence(
'clean',
['bundle', 'sass', 'fonts', 'copy.ts', 'copy.scss', 'copy.web-animations'],
'transpile.common',
function() {
var packageJSONTemplate = _.template(fs.readFileSync('scripts/npm/package.json'));
packageJSONContents = packageJSONTemplate({ 'version': version, 'ngVersion': ngVersion });
fs.writeFileSync('dist/package.json', packageJSONContents);
fs.writeFileSync('dist/README.md', fs.readFileSync('scripts/npm/README.md'));
// publish to npm
if (!dryRun) {
exec('cd dist && npm publish', function (err, stdout, stderr) {
console.log(stdout);
console.error(stderr);
done();
});
}
}
)
})

View File

@@ -1,3 +0,0 @@
module.exports = {
generate: require('./tooling/generate')
};

View File

@@ -1,12 +1,12 @@
{
"name": "ionic2",
"version": "2.0.0-alpha.2",
"name": "ionic-framework",
"version": "2.0.0-alpha.31",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/driftyco/ionic2.git"
},
"main": "index.js",
"main": "tooling/index.js",
"scripts": {
"test": "gulp karma",
"test:generators": "jasmine-node ./tooling/spec",

View File

@@ -1,25 +0,0 @@
# Ionic Framework
### Bundles:
- `css/`
- the Ionic CSS stylesheet
- `fonts/`
- Ionicons and Roboto fonts
- `js/`
- `ionic.js` the Ionic module, in System register format
- `ionic.bundle.js` the Ionic bundle, contains:
- es6-module-loader.js
- system.js
- angular2.dev.js
- router.dev.js (angular2 router)
- ionic.js
- web-animations.min.js
- `web-animations.min.js` web animations API polyfill
### Source files:
- `src/es5` - Ionic ES5 source files in both CommonJS and System module formats
- `src/es6` - Ionic ES6 source files
- `src/ts` - Ionic TypeScript source files (typings still missing)
- `scss` - Ionic Sass source files

View File

@@ -1,22 +0,0 @@
{
"name": "ionic-framework",
"version": "2.0.0-alpha.<%= version %>",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/driftyco/ionic2.git"
},
"files": [
"css",
"fonts",
"js",
"src"
],
"dependencies": {
"angular2": "2.0.0-alpha.<%= ngVersion %>",
"es6-shim": "^0.33.6",
"@reactivex/rxjs": "5.0.0-alpha.4",
"reflect-metadata": "0.1.1",
"zone.js": "0.5.8"
}
}

3
tooling/index.js Normal file
View File

@@ -0,0 +1,3 @@
module.exports = {
generate: require('./generate').generate
};