@windwalker-io/fusion-next 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2018 Simon Asika
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
17
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
18
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
19
+ OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # Windwalker Fusion
2
+
3
+ [![npm](https://img.shields.io/npm/l/@windwalker-io/fusion.svg)](https://www.npmjs.com/package/@windwalker-io/fusion.svg)
4
+ [![npm](https://img.shields.io/npm/v/@windwalker-io/fusion.svg)](https://www.npmjs.com/package/@windwalker-io/fusion.svg)
5
+ [![npm](https://img.shields.io/npm/dt/@windwalker-io/fusion.svg)](https://www.npmjs.com/package/@windwalker-io/fusion.svg)
6
+
7
+ Windwalker Fusion provides a clean, fluent API to run Gulp tasks for compiling your code.
8
+ Fusion supports several common CSS and JavaScript pre-processors.
9
+
10
+ ## Requirement
11
+
12
+ Node.js 13 up.
13
+
14
+ ## Getting Started
15
+
16
+ ```bash
17
+ mkdir myapp && cd myapp
18
+ npm install @windwalker-io/fusion --save-dev
19
+ cp -r node_modules/@windwalker-io/fusion/config/fusionfile.mjs ./
20
+ ```
21
+
22
+ The `fusionfile.mjs` is your configuration on top of Gulp. The example code is:
23
+
24
+ ```js
25
+ import fusion from '@windwalker-io/fusion';
26
+
27
+ // The task `main`
28
+ fusion.task('main', function () {
29
+ fusion.watch('src/scss/**/*.scss');
30
+
31
+ fusion.sass('src/scss/**/*.scss', 'dist/app.css');
32
+ });
33
+
34
+ fusion.default(['main']);
35
+ ```
36
+
37
+ package.json
38
+
39
+ ```json
40
+ "scripts": {
41
+ "build": "cross-env node_modules/.bin/gulp --gulpfile=fusionfile.mjs",
42
+ "build:dev": "cross-env NODE_ENV=development node_modules/.bin/gulp --gulpfile=fusionfile.mjs",
43
+ "build:prod": "cross-env NODE_ENV=production node_modules/.bin/gulp --gulpfile=fusionfile.mjs",
44
+ "watch": "cross-env NODE_ENV=development node_modules/.bin/gulp --watch --gulpfile=fusionfile.mjs",
45
+ "watch:reload": "cross-env NODE_ENV=development node_modules/.bin/gulp --watch --livereload --gulpfile=fusionfile.mjs"
46
+ },
47
+ ```
package/bin/release.js ADDED
@@ -0,0 +1,48 @@
1
+ import minimist from 'minimist';
2
+ import { execSync as exec } from 'child_process';
3
+ const packageName = '@windwalker-io/fusion-next';
4
+
5
+ const cliInput = minimist(process.argv.slice(2));
6
+
7
+ const args = cliInput._;
8
+
9
+ if (!args.length) {
10
+ console.log('Please provide release type (major | minor | patch | premajor | preminor | prepatch | prerelease)');
11
+ process.exit(255);
12
+ }
13
+
14
+ const help = `
15
+ Usage: release.js -- <arguments for "npm version">
16
+ -b Branch name to push.
17
+ `;
18
+
19
+ if (cliInput['help'] || cliInput['h']) {
20
+ console.log(help);
21
+ process.exit(0);
22
+ }
23
+
24
+ console.log(`>>> yarn build`);
25
+ exec(`yarn build`, { stdio: 'inherit' });
26
+
27
+ console.log(`>>> npm version ${args.join(' ')}`);
28
+ const buffer = exec(`npm version ${args.join(' ')} --no-workspaces-update`);
29
+
30
+ const ver = buffer.toString().split("\n")[1];
31
+
32
+ console.log('>>> Git commit all');
33
+ exec(`git add .`, { stdio: 'inherit' });
34
+ try {
35
+ exec(`git commit -am "Prepare release JS ${packageName} ${ver}."`, { stdio: 'inherit' });
36
+ } catch (e) {
37
+ console.log(e.message);
38
+ }
39
+
40
+ const branch = cliInput['b'] || 'master';
41
+
42
+ console.log('>>> Push to git');
43
+
44
+ exec(`git push origin ${branch}`, { stdio: 'inherit' });
45
+
46
+ console.log('>> Publish to npm');
47
+
48
+ exec(`npm publish`, { stdio: 'inherit' });