Skip to content

Commit

Permalink
chore: to npm scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
afeiship committed Sep 7, 2020
1 parent 95f5e39 commit 59b8838
Show file tree
Hide file tree
Showing 22 changed files with 150 additions and 154 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ package-lock.json
.DS_Store
.idea
.vscode

# vscode localhistory
.history
15 changes: 15 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@
**/npm-debug.log
**/node_modules
test
__tests__
src
build
docs
gulpfile.js

.editorconfig
.prettierrc
Gemfile
jest.config.js
LICENSE.txt
Rakefile
express.js
.vscode


# vscode localhistory
.history
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
package-lock=false
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source 'https://rubygems.org'

gem 'fileutils'
gem 'sshkit'
gem 'semver'
32 changes: 27 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
# next-const-adjective
> A lot of adjective
> A lot of adjective.
## install:
[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```bash
npm install -S afeiship/next-const-adjective --registry=https://registry.npm.taobao.org
npm install -S @feizheng/next-const-adjective
```

## usage:
## usage
```js
//DOCS here!
import '@feizheng/next-const-adjective';

const adjs = nx.onstAdjective; // ['xxx','yy'];
```

## license
Code released under [the MIT license](https://github.com/afeiship/next-const-adjective/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@feizheng/next-const-adjective
[version-url]: https://npmjs.org/package/@feizheng/next-const-adjective

[license-image]: https://img.shields.io/npm/l/@feizheng/next-const-adjective
[license-url]: https://github.com/afeiship/next-const-adjective/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@feizheng/next-const-adjective
[size-url]: https://github.com/afeiship/next-const-adjective/blob/master/dist/next-const-adjective.min.js

[download-image]: https://img.shields.io/npm/dm/@feizheng/next-const-adjective
[download-url]: https://www.npmjs.com/package/@feizheng/next-const-adjective
4 changes: 4 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

Dir["./node_modules/@feizheng/rake-*/index.rake"].each do |task|
load task
end
12 changes: 12 additions & 0 deletions __tests__/api.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const nx = require('@feizheng/next-js-core2');
require('../src/next-const-adjective');

describe('api.basic test', () => {
test('nx.constAdjective', function() {
const obj1 = { name: 'fei' };
const obj2 = { email: '1290657123@qq.com' };
const result = {};
nx.constAdjective(result, obj1, obj2);
expect(result.name, obj1.name).toBe(null);
});
});
4 changes: 2 additions & 2 deletions test/test.html → __tests__/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="../node_modules/next-js-core2/dist/next-js-core2.js"></script>
<script src="../src/next-const-adjective.js"></script>
<script src="/node_modules/@feizheng/next-js-core2/dist/next-js-core2.js"></script>
<script src="/next-const-adjective.js"></script>
</head>
<body>
<script>
Expand Down
28 changes: 0 additions & 28 deletions bower.json

This file was deleted.

15 changes: 0 additions & 15 deletions build/build.js

This file was deleted.

5 changes: 1 addition & 4 deletions build/clean.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
(function() {

'use strict';

const gulp = require('gulp');
const config = require('./config');
const $ = require('gulp-load-plugins')({
pattern: ['gulp-*', 'gulp.*', 'del']
});
Expand All @@ -12,5 +10,4 @@
gulp.task('clean', function() {
return $.del('dist');
});

}());
})();
26 changes: 0 additions & 26 deletions build/config.js

This file was deleted.

24 changes: 11 additions & 13 deletions build/scripts.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
(function() {

'use strict';

const gulp = require('gulp');
const config = require('./config');
const saveLicense = require('uglify-save-license');
const $ = require('gulp-load-plugins')({
pattern: ['gulp-*', 'gulp.*', 'del']
pattern: ['gulp-*', 'gulp.*', 'del', '@feizheng/gulp-*']
});

gulp.task('scripts', function () {
return gulp.src('src/*.js')
gulp.task('scripts', function() {
return gulp
.src('src/*.js')
.pipe($.feizheng.pkgHeader())
.pipe(gulp.dest('dist'))
.pipe($.size({title: '[ default size ]:'}))
.pipe($.uglify())
.pipe($.rename({
extname: '.min.js'
}))
.pipe($.size({ title: '[ default size ]:' }))
.pipe($.uglify({ output: { comments: saveLicense } }))
.pipe($.rename({ extname: '.min.js' }))
.pipe(gulp.dest('dist'))
.pipe($.size({title: '[ minimize size ]:'}));
.pipe($.size({ title: '[ minimize size ]:' }));
});

}());
})();
21 changes: 0 additions & 21 deletions build/version.js

This file was deleted.

13 changes: 11 additions & 2 deletions dist/next-const-adjective.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
(function() {
/*!
* name: @feizheng/next-const-adjective
* description: A lot of adjective.
* homepage: https://github.com/afeiship/next-const-adjective
* version: 1.0.0
* date: 2020-09-07T10:26:08.205Z
* license: MIT
*/

(function () {
var global = global || this || window || Function('return this')();
var nx = global.nx || require('next-js-core2');
var nx = global.nx || require('@feizheng/next-js-core2');

nx.constAdjective = [
'温柔',
Expand Down
10 changes: 9 additions & 1 deletion dist/next-const-adjective.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions express.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const express = require('express');
const app = express();
const portNumber = 3000;
const sourceDir = 'src';

app.use(express.static('src'));
app.use(express.static('node_modules'));
app.use(express.static('__tests__'));

app.listen(portNumber, () => {
console.log(`Express web server started: http://localhost:${portNumber}`);
console.log(`Serving content from /${sourceDir}/`);
});
6 changes: 2 additions & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
(function() {

'use strict';

const gulp = require('gulp');
Expand All @@ -10,6 +9,5 @@
require('./build/' + file);
});

gulp.task('default',['build']);

}());
gulp.task('default', gulp.series(['clean', 'scripts']));
})();
9 changes: 9 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// https://jestjs.io/docs/en/configuration
module.exports = {
verbose: true,
testRegex: [/\.spec.js/],
//preset: "jest-puppeteer",
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1'
}
};
39 changes: 23 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "next-const-adjective",
"name": "@feizheng/next-const-adjective",
"version": "1.0.0",
"description": "A lot of adjective",
"description": "A lot of adjective.",
"homepage": "https://github.com/afeiship/next-const-adjective",
"author": {
"name": "afei",
Expand All @@ -10,24 +10,31 @@
"scripts": {
"build": "gulp",
"test": "jest",
"version": "gulp bump"
"start": "node ./express.js"
},
"main": "dist/next-const-adjective.js",
"license": "MIT",
"devDependencies": {
"del": "^2.2.1",
"gulp": "^3.9.1",
"gulp-bump": "^2.7.0",
"gulp-concat": "^2.6.0",
"gulp-load-plugins": "^1.2.0",
"gulp-rename": "^1.2.2",
"gulp-size": "^2.1.0",
"gulp-uglify": "^2.1.2",
"jest": "^23.6.0",
"yargs": "^4.7.1",
"prettier": "^1.14.3"
"@feizheng/gulp-pkg-header": "^1.0.4",
"@feizheng/next-js-core2": "^2.6.0",
"@feizheng/rake-git": "^1.2.1",
"del": "^5.1.0",
"express": "^4.17.1",
"gulp": "^4.0.2",
"gulp-debug": "^4.0.0",
"gulp-header": "^2.0.9",
"gulp-ignore": "^3.0.0",
"gulp-load-plugins": "^2.0.3",
"gulp-rename": "^2.0.0",
"gulp-size": "^3.0.0",
"gulp-uglify": "^3.0.2",
"jest": "^26.1.0",
"prettier": "^2.0.5",
"uglify-js": "3.10.0",
"uglify-save-license": "^0.4.1",
"yargs": "^15.4.0"
},
"dependencies": {
"next-js-core2": "github:afeiship/next-js-core2"
"publishConfig": {
"registry": "https://registry.npmjs.org"
}
}
4 changes: 2 additions & 2 deletions src/next-const-adjective.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function() {
(function () {
var global = global || this || window || Function('return this')();
var nx = global.nx || require('next-js-core2');
var nx = global.nx || require('@feizheng/next-js-core2');

nx.constAdjective = [
'温柔',
Expand Down
Loading

0 comments on commit 59b8838

Please sign in to comment.