@gjsify/cli 0.0.1 → 0.0.3

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.
Files changed (56) hide show
  1. package/lib/actions/build.d.ts +110 -6
  2. package/lib/actions/build.js +98 -21
  3. package/lib/commands/build.d.ts +2 -16
  4. package/lib/commands/build.js +90 -57
  5. package/lib/commands/index.d.ts +1 -0
  6. package/lib/commands/index.js +1 -0
  7. package/lib/config.d.ts +14 -0
  8. package/lib/config.js +63 -0
  9. package/lib/constants.d.ts +1 -0
  10. package/lib/constants.js +1 -0
  11. package/lib/index.d.ts +2 -2
  12. package/lib/index.js +12 -6
  13. package/lib/types/cli-build-options.d.ts +45 -0
  14. package/lib/types/cli-build-options.js +1 -0
  15. package/lib/types/command.d.ts +9 -0
  16. package/lib/types/command.js +1 -0
  17. package/lib/types/config-data-library.d.ts +3 -0
  18. package/lib/types/config-data-library.js +1 -0
  19. package/lib/types/config-data-typescript.d.ts +5 -0
  20. package/lib/types/config-data-typescript.js +1 -0
  21. package/lib/types/config-data.d.ts +11 -0
  22. package/lib/types/config-data.js +1 -0
  23. package/lib/types/cosmiconfig-result.d.ts +5 -0
  24. package/lib/types/cosmiconfig-result.js +1 -0
  25. package/lib/types/index.d.ts +6 -1
  26. package/lib/types/index.js +6 -2
  27. package/package.json +31 -75
  28. package/src/actions/build.ts +121 -0
  29. package/src/actions/index.ts +1 -0
  30. package/src/commands/build.ts +95 -0
  31. package/src/commands/index.ts +1 -0
  32. package/src/config.ts +80 -0
  33. package/src/constants.ts +1 -0
  34. package/src/index.ts +14 -0
  35. package/src/lodash.d.ts +46 -0
  36. package/src/types/cli-build-options.ts +46 -0
  37. package/src/types/command.ts +10 -0
  38. package/src/types/config-data-library.ts +5 -0
  39. package/src/types/config-data-typescript.ts +6 -0
  40. package/src/types/config-data.ts +12 -0
  41. package/src/types/cosmiconfig-result.ts +5 -0
  42. package/src/types/index.ts +6 -0
  43. package/tsconfig.json +13 -0
  44. package/LICENSE +0 -21
  45. package/README.md +0 -78
  46. package/bin/run +0 -5
  47. package/bin/run.cmd +0 -3
  48. package/lib/actions/init.d.ts +0 -0
  49. package/lib/actions/init.js +0 -6
  50. package/lib/defaults.d.ts +0 -6
  51. package/lib/defaults.js +0 -8
  52. package/lib/types/build-options.d.ts +0 -9
  53. package/lib/types/build-options.js +0 -2
  54. package/lib/webpack.config.default.d.ts +0 -47
  55. package/lib/webpack.config.default.js +0 -71
  56. package/oclif.manifest.json +0 -1
package/README.md DELETED
@@ -1,78 +0,0 @@
1
- @gjsify/cli
2
- ===========
3
-
4
- Command line tool for gjsify
5
-
6
- [![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
7
- [![Version](https://img.shields.io/npm/v/@gjsify/cli.svg)](https://npmjs.org/package/@gjsify/cli)
8
- [![Downloads/week](https://img.shields.io/npm/dw/@gjsify/cli.svg)](https://npmjs.org/package/@gjsify/cli)
9
- [![License](https://img.shields.io/npm/l/@gjsify/cli.svg)](https://github.com/gjsify/cli/blob/master/package.json)
10
-
11
- <!-- toc -->
12
- * [Usage](#usage)
13
- * [Commands](#commands)
14
- * [CommonJS compatibility](#commonjs-compatibility)
15
- <!-- tocstop -->
16
- # Usage
17
- <!-- usage -->
18
- ```sh-session
19
- $ npm install -g @gjsify/cli
20
- $ gjsify COMMAND
21
- running command...
22
- $ gjsify (-v|--version|version)
23
- @gjsify/cli/0.0.1 linux-x64 node-v12.14.1
24
- $ gjsify --help [COMMAND]
25
- USAGE
26
- $ gjsify COMMAND
27
- ...
28
- ```
29
- <!-- usagestop -->
30
- # Commands
31
- <!-- commands -->
32
- * [`gjsify build [FILE]`](#gjsify-build-file)
33
- * [`gjsify help [COMMAND]`](#gjsify-help-command)
34
-
35
- ## `gjsify build [FILE]`
36
-
37
- describe the command here
38
-
39
- ```
40
- USAGE
41
- $ gjsify build [FILE]
42
-
43
- OPTIONS
44
- -b, --beautify Beautify build output
45
- -h, --help show CLI help
46
- -m, --minimize Minimize build output
47
- -o, --outputFilename=outputFilename [default: index.js] File name of the output bundle
48
- -p, --outputPath=outputPath [default: ./dist] Output destination path
49
-
50
- EXAMPLE
51
- $ gjsify build ./src/hello.ts
52
- ```
53
-
54
- _See code: [src/commands/build.ts](https://github.com/gjsify/cli/blob/v0.0.1/src/commands/build.ts)_
55
-
56
- ## `gjsify help [COMMAND]`
57
-
58
- display help for gjsify
59
-
60
- ```
61
- USAGE
62
- $ gjsify help [COMMAND]
63
-
64
- ARGUMENTS
65
- COMMAND command to show help for
66
-
67
- OPTIONS
68
- --all see all commands in CLI
69
- ```
70
-
71
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v2.2.3/src/commands/help.ts)_
72
- <!-- commandsstop -->
73
-
74
- # CommonJS compatibility
75
-
76
- Many [npm](https://www.npmjs.com/) modules that don't do IO will just work after being browserified. Others take more work.
77
-
78
- When you require() any of these modules, you will get a gjs-specific shim:
package/bin/run DELETED
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- require('@oclif/command').run()
4
- .then(require('@oclif/command/flush'))
5
- .catch(require('@oclif/errors/handle'))
package/bin/run.cmd DELETED
@@ -1,3 +0,0 @@
1
- @echo off
2
-
3
- node "%~dp0\run" %*
File without changes
@@ -1,6 +0,0 @@
1
- "use strict";
2
- // TODO add npm dev modules:
3
- // ts-loader -D
4
- // typescript -D
5
- // TODO add configs
6
- // tsconfig.json
package/lib/defaults.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export declare const flags: {
2
- outputFilename: string;
3
- outputPath: string;
4
- beautify: boolean;
5
- minimize: boolean;
6
- };
package/lib/defaults.js DELETED
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.flags = {
4
- outputFilename: 'index.js',
5
- outputPath: './dist',
6
- beautify: false,
7
- minimize: true,
8
- };
@@ -1,9 +0,0 @@
1
- export interface BuildOptions {
2
- entry?: string[];
3
- output: {
4
- filename?: string;
5
- path?: string;
6
- };
7
- beautify?: boolean;
8
- minimize?: boolean;
9
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,47 +0,0 @@
1
- import webpack from 'webpack';
2
- export declare const webpackConfigDefault: {
3
- entry: string[];
4
- output: {
5
- path: string;
6
- filename: string;
7
- };
8
- module: {
9
- rules: {
10
- test: RegExp;
11
- loader: string;
12
- exclude: RegExp;
13
- }[];
14
- };
15
- plugins: webpack.ProvidePlugin[];
16
- optimization: {
17
- minimize: boolean;
18
- minimizer: any[];
19
- };
20
- resolve: {
21
- extensions: string[];
22
- alias: {
23
- console: string;
24
- constants: string;
25
- crypto: string;
26
- domain: string;
27
- fs: string;
28
- os: string;
29
- path: string;
30
- process: string;
31
- querystring: string;
32
- stream: string;
33
- tty: string;
34
- zlib: string;
35
- };
36
- };
37
- };
38
- export declare const minimizerConfigDefault: {
39
- sourceMap: boolean;
40
- extractComments: boolean;
41
- terserOptions: {
42
- mangle: boolean;
43
- output: {
44
- beautify: boolean;
45
- };
46
- };
47
- };
@@ -1,71 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const webpack_1 = tslib_1.__importDefault(require("webpack"));
5
- const defaults_1 = require("./defaults");
6
- const path_1 = require("path");
7
- exports.webpackConfigDefault = {
8
- entry: new Array(),
9
- output: {
10
- path: path_1.resolve(__dirname, defaults_1.flags.outputPath),
11
- filename: defaults_1.flags.outputFilename,
12
- },
13
- module: {
14
- rules: [
15
- {
16
- test: /\.tsx?$/,
17
- loader: 'ts-loader',
18
- exclude: /node_modules/,
19
- },
20
- ],
21
- },
22
- plugins: [
23
- new webpack_1.default.ProvidePlugin({
24
- console: '@gjsify/console',
25
- process: '@gjsify/process',
26
- Buffer: ['buffer', 'Buffer'],
27
- }),
28
- ],
29
- optimization: {
30
- minimize: defaults_1.flags.minimize,
31
- minimizer: new Array(),
32
- },
33
- resolve: {
34
- extensions: ['.tsx', '.ts', '.js'],
35
- alias: {
36
- // assert: https://github.com/browserify/commonjs-assert
37
- // buffer: https://www.npmjs.com/package/buffer
38
- console: '@gjsify/console',
39
- constants: 'constants-browserify',
40
- crypto: 'crypto-browserify',
41
- domain: 'domain-browser',
42
- // events: https://github.com/Gozala/events
43
- fs: '@gjsify/fs',
44
- // TODO http
45
- // TODO https
46
- os: '@gjsify/os',
47
- path: '@gjsify/path',
48
- process: '@gjsify/process',
49
- // punycode: https://github.com/bestiejs/punycode.js
50
- querystring: 'querystring-es3',
51
- stream: 'stream-browserify',
52
- // string_decoder: https://github.com/nodejs/string_decoder
53
- // TODO timers: https://andyholmes.github.io/articles/asynchronous-programming-in-gjs.html https://www.npmjs.com/package/timers-browserify
54
- tty: 'tty-browserify',
55
- // url: https://github.com/defunctzombie/node-url
56
- // util: https://github.com/browserify/node-util
57
- // TODO vm: https://github.com/browserify/vm-browserify
58
- zlib: 'browserify-zlib',
59
- },
60
- },
61
- };
62
- exports.minimizerConfigDefault = {
63
- sourceMap: false,
64
- extractComments: true,
65
- terserOptions: {
66
- mangle: true,
67
- output: {
68
- beautify: defaults_1.flags.beautify,
69
- },
70
- },
71
- };
@@ -1 +0,0 @@
1
- {"version":"0.0.1","commands":{"build":{"id":"build","description":"describe the command here","pluginName":"@gjsify/cli","pluginType":"core","aliases":[],"examples":["$ gjsify build ./src/hello.ts"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"outputFilename":{"name":"outputFilename","type":"option","char":"o","description":"File name of the output bundle","required":false,"default":"index.js"},"outputPath":{"name":"outputPath","type":"option","char":"p","description":"Output destination path","required":false,"default":"./dist"},"beautify":{"name":"beautify","type":"boolean","char":"b","description":"Beautify build output","required":false,"allowNo":false},"minimize":{"name":"minimize","type":"boolean","char":"m","description":"Minimize build output","required":false,"allowNo":false}},"args":[{"name":"file"}]}}}