@gjsify/cli 0.0.1-b → 0.0.2

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 (55) hide show
  1. package/lib/actions/build.d.ts +110 -6
  2. package/lib/actions/build.js +94 -23
  3. package/lib/commands/build.d.ts +2 -17
  4. package/lib/commands/build.js +74 -61
  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 +35 -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 -82
  28. package/src/actions/build.ts +117 -0
  29. package/src/actions/index.ts +1 -0
  30. package/src/commands/build.ts +80 -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/types/cli-build-options.ts +36 -0
  36. package/src/types/command.ts +10 -0
  37. package/src/types/config-data-library.ts +5 -0
  38. package/src/types/config-data-typescript.ts +6 -0
  39. package/src/types/config-data.ts +12 -0
  40. package/src/types/cosmiconfig-result.ts +5 -0
  41. package/src/types/index.ts +6 -0
  42. package/tsconfig.json +12 -0
  43. package/LICENSE +0 -21
  44. package/README.md +0 -79
  45. package/bin/run +0 -5
  46. package/bin/run.cmd +0 -3
  47. package/lib/actions/init.d.ts +0 -0
  48. package/lib/actions/init.js +0 -7
  49. package/lib/defaults.d.ts +0 -7
  50. package/lib/defaults.js +0 -9
  51. package/lib/types/build-options.d.ts +0 -10
  52. package/lib/types/build-options.js +0 -2
  53. package/lib/webpack.config.default.d.ts +0 -59
  54. package/lib/webpack.config.default.js +0 -94
  55. package/oclif.manifest.json +0 -1
package/lib/defaults.js DELETED
@@ -1,9 +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: false,
8
- mangle: false,
9
- };
@@ -1,10 +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
- mangle?: boolean;
10
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,59 +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
- test: RegExp;
15
- loader: string;
16
- exclude?: undefined;
17
- })[];
18
- };
19
- plugins: (webpack.DefinePlugin | webpack.ProvidePlugin)[];
20
- externals: {};
21
- optimization: {
22
- minimize: boolean;
23
- minimizer: any[];
24
- };
25
- resolve: {
26
- extensions: string[];
27
- alias: {
28
- assert: string;
29
- buffer: string;
30
- console: string;
31
- constants: string;
32
- crypto: string;
33
- domain: string;
34
- events: string;
35
- fs: string;
36
- os: string;
37
- path: string;
38
- process: string;
39
- punycode: string;
40
- querystring: string;
41
- stream: string;
42
- string_decoder: string;
43
- tty: string;
44
- url: string;
45
- util: string;
46
- zlib: string;
47
- };
48
- };
49
- };
50
- export declare const minimizerConfigDefault: {
51
- sourceMap: boolean;
52
- extractComments: boolean;
53
- terserOptions: {
54
- mangle: boolean;
55
- output: {
56
- beautify: boolean;
57
- };
58
- };
59
- };
@@ -1,94 +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(process.cwd(), defaults_1.flags.outputPath),
11
- filename: defaults_1.flags.outputFilename,
12
- },
13
- // node: {
14
- // // global: false, // TODO
15
- // // __filename: 'mock',
16
- // // __dirname: 'mock',
17
- // },
18
- module: {
19
- rules: [
20
- {
21
- test: /\.tsx?$/,
22
- loader: 'ts-loader',
23
- exclude: /node_modules/,
24
- },
25
- {
26
- test: /\.json$/,
27
- loader: 'json-loader',
28
- },
29
- ],
30
- },
31
- plugins: [
32
- new webpack_1.default.ProvidePlugin({
33
- console: '@gjsify/console',
34
- }),
35
- new webpack_1.default.DefinePlugin({
36
- GJSIFY_VERSION: JSON.stringify(require('../package.json').version),
37
- GJSIFY_DEPS: JSON.stringify(require('../package.json').dependencies),
38
- }),
39
- ],
40
- externals: {
41
- // console: {
42
- // commonjs: '@gjsify/console',
43
- // amd: '@gjsify/console',
44
- // root: 'console',
45
- // },
46
- // process: {
47
- // commonjs: '@gjsify/process',
48
- // amd: '@gjsify/process',
49
- // root: 'process',
50
- // },
51
- },
52
- optimization: {
53
- minimize: defaults_1.flags.minimize,
54
- minimizer: new Array(),
55
- },
56
- resolve: {
57
- extensions: ['.tsx', '.ts', '.js'],
58
- alias: {
59
- assert: 'assert',
60
- buffer: 'buffer',
61
- console: '@gjsify/console',
62
- constants: 'constants-browserify',
63
- crypto: 'crypto-browserify',
64
- domain: 'domain-browser',
65
- events: 'events',
66
- fs: '@gjsify/fs',
67
- // TODO http
68
- // TODO https
69
- os: '@gjsify/os',
70
- path: '@gjsify/path',
71
- process: '@gjsify/process',
72
- punycode: 'punycode',
73
- querystring: 'querystring-es3',
74
- stream: 'stream-browserify',
75
- string_decoder: 'string_decoder',
76
- // TODO timers: https://andyholmes.github.io/articles/asynchronous-programming-in-gjs.html https://www.npmjs.com/package/timers-browserify
77
- tty: 'tty-browserify',
78
- url: 'url',
79
- util: 'util',
80
- // TODO vm: https://github.com/browserify/vm-browserify
81
- zlib: 'browserify-zlib',
82
- },
83
- },
84
- };
85
- exports.minimizerConfigDefault = {
86
- sourceMap: false,
87
- extractComments: true,
88
- terserOptions: {
89
- mangle: defaults_1.flags.mangle,
90
- output: {
91
- beautify: defaults_1.flags.beautify,
92
- },
93
- },
94
- };
@@ -1 +0,0 @@
1
- {"version":"0.0.1-b","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},"mangle":{"name":"mangle","type":"boolean","description":"Mangle build output","required":false,"allowNo":false}},"args":[{"name":"file"}]}}}