@nlabs/lex 1.30.0 → 1.31.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/dist/lex.js CHANGED
@@ -1,26 +1,8 @@
1
1
  #!/usr/bin/env node
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
9
- var __reExport = (target, module2, desc) => {
10
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
11
- for (let key of __getOwnPropNames(module2))
12
- if (!__hasOwnProp.call(target, key) && key !== "default")
13
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
14
- }
15
- return target;
16
- };
17
- var __toModule = (module2) => {
18
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
19
- };
20
- var import_commander = __toModule(require("commander"));
21
- var import_commands = __toModule(require("./commands"));
2
+ var import_commander = require("commander");
3
+ var import_commands = require("./commands");
22
4
  const packageConfig = require("../package.json");
23
- import_commander.program.command("build").option("-c, --config <path>", "Custom Webpack configuration file path (ie. webpack.config.js).").option("-l, --lexConfig <path>", "Lex configuration file path (lex.config.js).").option("-m, --mode <type>", 'Webpack mode ("production" or "development"). Default: "development".', /^(development|production)$/i, "development").option("-q, --quiet", "No Lex notifications printed in the console.").option("-r, --remove", "Removes all files from the output directory before compiling.").option("-s, --static", "Creates static HTML files when building app.").option("-t, --typescript", "Transpile as Typescript.").option("-v, --variables <name>", `Environment variables to set in "process.env". (ie. "{NODE_ENV: 'production'}").`).option("-w, --watch", "Watch for changes.").option("--sourcePath <path>", "Source path").option("--outputPath <path>", "Output path").option("--outputChunkFilename <filename>", "The output filename for additional chunks.").option("--outputFilename <filename>", 'The output filename of the bundle. Default: "[name].js".').option("--outputJsonpFunction <func>", 'The name of the JSONP function used for chunk loading. Default: "webpackJsonp".').option("--outputLibrary <library>", "Expose the exports of the entry point as library.").option("--outputLibraryTarget <target>", 'The type for exposing the exports of the entry point as library. Default: "var".').option("--outputPathinfo <hasInfo>", "The output filename for additional chunks. Default: false").option("--outputPublicPath <path>", 'The public path for the assets. Default: "/"').option("--outputSourceMapFilename <filename>", 'The output filename for the SourceMap. Default: "[name].map"').option("--buildDelimiter <delimiter>", 'Display custom text after build output. Default: "=== Build done ==="').action((cmd) => (0, import_commands.build)(cmd, process.exit).then(() => {
5
+ import_commander.program.command("build").option("-c, --config <path>", "Custom Webpack configuration file path (ie. webpack.config.js).").option("-l, --lexConfig <path>", "Lex configuration file path (lex.config.js).").option("-m, --mode <type>", 'Webpack mode ("production" or "development"). Default: "development".', /^(development|production)$/i, "development").option("-q, --quiet", "No Lex notifications printed in the console.").option("-r, --remove", "Removes all files from the output directory before compiling.").option("-s, --static", "Creates static HTML files when building app.").option("-t, --typescript", "Transpile as Typescript.").option("-v, --variables <name>", `Environment variables to set in "process.env". (ie. "{NODE_ENV: 'production'}").`).option("-w, --watch", "Watch for changes.").option("--bundler <name>", 'Bundler to use ("webpack" or "esbuild"). Default: "webpack".', /^(webpack|esbuild)$/i, "webpack").option("--sourcePath <path>", "Source path").option("--outputPath <path>", "Output path").option("--outputChunkFilename <filename>", "The output filename for additional chunks.").option("--outputFilename <filename>", 'The output filename of the bundle. Default: "[name].js".').option("--outputJsonpFunction <func>", 'The name of the JSONP function used for chunk loading. Default: "webpackJsonp".').option("--outputLibrary <library>", "Expose the exports of the entry point as library.").option("--outputLibraryTarget <target>", 'The type for exposing the exports of the entry point as library. Default: "var".').option("--outputPathinfo <hasInfo>", "The output filename for additional chunks. Default: false").option("--outputPublicPath <path>", 'The public path for the assets. Default: "/"').option("--outputSourceMapFilename <filename>", 'The output filename for the SourceMap. Default: "[name].map"').option("--buildDelimiter <delimiter>", 'Display custom text after build output. Default: "=== Build done ==="').action((cmd) => (0, import_commands.build)(cmd, process.exit).then(() => {
24
6
  }));
25
7
  import_commander.program.command("clean").option("-q, --quiet", "No Lex notifications printed in the console.").option("-s, --snapshots", 'Remove all "__snapshots__" directories.').action((cmd) => (0, import_commands.clean)(cmd, process.exit).then(() => {
26
8
  }));
package/dist/utils.js CHANGED
@@ -20,22 +20,27 @@ var __spreadValues = (a, b) => {
20
20
  };
21
21
  var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
22
22
  var __export = (target, all) => {
23
- __markAsModule(target);
24
23
  for (var name in all)
25
24
  __defProp(target, name, { get: all[name], enumerable: true });
26
25
  };
27
- var __reExport = (target, module2, desc) => {
26
+ var __reExport = (target, module2, copyDefault, desc) => {
28
27
  if (module2 && typeof module2 === "object" || typeof module2 === "function") {
29
28
  for (let key of __getOwnPropNames(module2))
30
- if (!__hasOwnProp.call(target, key) && key !== "default")
29
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
31
30
  __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
32
31
  }
33
32
  return target;
34
33
  };
35
- var __toModule = (module2) => {
36
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
34
+ var __toESM = (module2, isNodeMode) => {
35
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
37
36
  };
38
- __export(exports, {
37
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
38
+ return (module2, temp) => {
39
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
40
+ };
41
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
42
+ var utils_exports = {};
43
+ __export(utils_exports, {
39
44
  checkLinkedModules: () => checkLinkedModules,
40
45
  copyFileSync: () => copyFileSync,
41
46
  copyFiles: () => copyFiles,
@@ -55,16 +60,16 @@ __export(exports, {
55
60
  setPackageJson: () => setPackageJson,
56
61
  updateTemplateName: () => updateTemplateName
57
62
  });
58
- var import_boxen = __toModule(require("boxen"));
59
- var import_chalk = __toModule(require("chalk"));
60
- var import_find_file_up = __toModule(require("find-file-up"));
61
- var import_fs_extra = __toModule(require("fs-extra"));
62
- var import_glob = __toModule(require("glob"));
63
- var import_isEmpty = __toModule(require("lodash/isEmpty"));
64
- var import_ora = __toModule(require("ora"));
65
- var import_path = __toModule(require("path"));
66
- var import_rimraf = __toModule(require("rimraf"));
67
- var import_LexConfig = __toModule(require("./LexConfig"));
63
+ var import_boxen = __toESM(require("boxen"));
64
+ var import_chalk = __toESM(require("chalk"));
65
+ var import_find_file_up = __toESM(require("find-file-up"));
66
+ var import_fs_extra = __toESM(require("fs-extra"));
67
+ var import_glob = __toESM(require("glob"));
68
+ var import_isEmpty = __toESM(require("lodash/isEmpty"));
69
+ var import_ora = __toESM(require("ora"));
70
+ var import_path = __toESM(require("path"));
71
+ var import_rimraf = __toESM(require("rimraf"));
72
+ var import_LexConfig = require("./LexConfig");
68
73
  const cwd = process.cwd();
69
74
  const log = (message, type = "info", quiet = false) => {
70
75
  if (!quiet) {
@@ -283,6 +288,7 @@ const updateTemplateName = (filePath, replace, replaceCaps) => {
283
288
  data = data.replace(/Sample/g, replaceCaps);
284
289
  import_fs_extra.default.writeFileSync(filePath, data, "utf8");
285
290
  };
291
+ module.exports = __toCommonJS(utils_exports);
286
292
  // Annotate the CommonJS export names for ESM import in node:
287
293
  0 && (module.exports = {
288
294
  checkLinkedModules,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nlabs/lex",
3
- "version": "1.30.0",
3
+ "version": "1.31.0",
4
4
  "description": "Lex",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -45,104 +45,104 @@
45
45
  "watch": "NODE_ENV=development rm -rf dist && yarn compile -w"
46
46
  },
47
47
  "dependencies": {
48
- "@hot-loader/react-dom": "17.0.1",
48
+ "@hot-loader/react-dom": "17.0.2",
49
49
  "@nlabs/gothamjs": "^0.8.2",
50
50
  "@nlabs/webpack-plugin-static-site": "^0.1.1",
51
- "acorn": "^8.5.0",
51
+ "acorn": "^8.7.0",
52
52
  "acorn-dynamic-import": "^4.0.0",
53
53
  "assert": "^2.0.0",
54
- "boxen": "^5.1.2",
55
- "caniuse-lite": "1.0.30001258",
54
+ "boxen": "5.1.2",
55
+ "caniuse-lite": "1.0.30001305",
56
56
  "chalk": "^4.1.2",
57
57
  "commander": "^8.2.0",
58
- "compare-versions": "^3.6.0",
59
- "compression-webpack-plugin": "^9.0.0",
58
+ "compare-versions": "^4.1.3",
59
+ "compression-webpack-plugin": "^9.2.0",
60
60
  "config-webpack-plugin": "^1.1.0",
61
- "copy-webpack-plugin": "^9.0.1",
62
- "core-js": "^3.18.0",
61
+ "copy-webpack-plugin": "^10.2.4",
62
+ "core-js": "^3.21.0",
63
63
  "crypto-browserify": "^3.12.0",
64
- "css-loader": "^6.3.0",
65
- "cssnano": "^5.0.8",
66
- "dotenv-webpack": "^7.0.3",
64
+ "css-loader": "^6.6.0",
65
+ "cssnano": "^5.0.16",
66
+ "dotenv-webpack": "^7.1.0",
67
67
  "download-npm-package": "^3.1.12",
68
68
  "esbuild-jest": "^0.5.0",
69
- "esbuild-loader": "^2.15.1",
69
+ "esbuild-loader": "^2.18.0",
70
70
  "execa": "5",
71
- "exports-loader": "^3.0.0",
71
+ "exports-loader": "^3.1.0",
72
72
  "favicons-webpack-plugin": "^5.0.2",
73
73
  "file-loader": "^6.2.0",
74
74
  "find-file-up": "^2.0.1",
75
75
  "fs-extra": "^10.0.0",
76
- "glob": "^7.1.6",
77
- "graphql-tag": "^2.12.5",
78
- "html-loader": "^2.1.2",
79
- "html-webpack-plugin": "^5.3.2",
76
+ "glob": "^7.2.0",
77
+ "graphql-tag": "^2.12.6",
78
+ "html-loader": "^3.1.0",
79
+ "html-webpack-plugin": "^5.5.0",
80
80
  "https-browserify": "^1.0.0",
81
- "imports-loader": "^3.0.0",
82
- "jest": "^27.2.1",
83
- "jest-cli": "^27.2.1",
81
+ "imports-loader": "^3.1.1",
82
+ "jest": "^27.4.7",
83
+ "jest-cli": "^27.4.7",
84
84
  "jest-transform-graphql": "^2.1.0",
85
85
  "json-d-ts": "^1.0.1",
86
86
  "latest-version": "5.1.0",
87
87
  "lodash": "^4.17.21",
88
- "luxon": "^2.0.2",
88
+ "luxon": "^2.3.0",
89
89
  "net": "^1.0.2",
90
- "npm-check-updates": "^11.8.5",
90
+ "npm-check-updates": "^12.2.1",
91
91
  "ora": "5.4.1",
92
92
  "os-browserify": "^0.3.0",
93
93
  "path-browserify": "^1.0.1",
94
94
  "postcss-browser-reporter": "^0.6.0",
95
- "postcss-cli": "^8.3.1",
96
- "postcss-custom-properties": "^12.0.0",
95
+ "postcss-cli": "^9.1.0",
96
+ "postcss-custom-properties": "^12.1.4",
97
97
  "postcss-flexbugs-fixes": "^5.0.2",
98
98
  "postcss-for": "^2.1.1",
99
99
  "postcss-hash": "^3.0.0",
100
100
  "postcss-import": "14.0.2",
101
- "postcss-loader": "^6.1.1",
102
- "postcss-nesting": "^8.0.1",
101
+ "postcss-loader": "^6.2.1",
102
+ "postcss-nesting": "^10.1.2",
103
103
  "postcss-percentage": "^0.0.0",
104
- "postcss-preset-env": "^6.7.0",
104
+ "postcss-preset-env": "^7.3.0",
105
105
  "postcss-simple-vars": "^6.0.3",
106
- "postcss-svgo": "5.0.2",
106
+ "postcss-svgo": "5.0.3",
107
107
  "postcss-url": "10.1.3",
108
108
  "process": "^0.11.10",
109
109
  "react": "^17.0.2",
110
110
  "react-dom": "^17.0.2",
111
111
  "regenerator-runtime": "^0.13.9",
112
- "resolve": "^1.20.0",
112
+ "resolve": "^1.22.0",
113
113
  "rimraf": "^3.0.2",
114
114
  "semver": "^7.3.5",
115
- "source-map-loader": "^3.0.0",
116
- "source-map-support": "^0.5.20",
115
+ "source-map-loader": "^3.0.1",
116
+ "source-map-support": "^0.5.21",
117
117
  "speed-measure-webpack-plugin": "^1.5.0",
118
118
  "static-site-generator-webpack-plugin": "^3.4.2",
119
119
  "stream-browserify": "^3.0.0",
120
120
  "stream-http": "^3.2.0",
121
- "style-loader": "^3.2.1",
122
- "svg-spritemap-webpack-plugin": "^4.3.2",
123
- "svgo": "2.6.1",
121
+ "style-loader": "^3.3.1",
122
+ "svg-spritemap-webpack-plugin": "^4.4.0",
123
+ "svgo": "2.8.0",
124
124
  "tls": "^0.0.1",
125
- "typescript": "^4.4.3",
125
+ "typescript": "^4.5.5",
126
126
  "url-loader": "^4.1.1",
127
127
  "util": "^0.12.4",
128
- "webpack": "5.53.0",
129
- "webpack-bundle-analyzer": "^4.4.1",
130
- "webpack-cli": "^4.8.0",
128
+ "webpack": "5.68.0",
129
+ "webpack-bundle-analyzer": "^4.5.0",
130
+ "webpack-cli": "^4.9.2",
131
131
  "webpack-merge": "^5.8.0",
132
132
  "webpack-nano": "^1.1.1",
133
- "webpack-plugin-serve": "^1.5.0"
133
+ "webpack-plugin-serve": "^1.6.0"
134
134
  },
135
135
  "devDependencies": {
136
- "@nlabs/execa-mock": "^1.29.0",
137
- "@types/jest": "^27.0.1",
138
- "@types/luxon": "^2.0.4",
139
- "@types/node": "^16.9.4",
136
+ "@nlabs/execa-mock": "^1.31.0",
137
+ "@types/jest": "^27.4.0",
138
+ "@types/luxon": "^2.0.9",
139
+ "@types/node": "^17.0.14",
140
140
  "@types/ora": "^3.2.0",
141
- "@types/react": "^17.0.22",
141
+ "@types/react": "^17.0.38",
142
142
  "@types/webpack": "^5.28.0",
143
- "eslint": "^7.32.0",
144
- "eslint-config-styleguidejs": "^1.5.3",
143
+ "eslint": "^8.8.0",
144
+ "eslint-config-styleguidejs": "^1.5.4",
145
145
  "lerna": "^4.0.0"
146
146
  },
147
- "gitHead": "e023bf2c59248b153aff3ac14d6411ba1ad176f5"
147
+ "gitHead": "4f93d9421e7f03819a61e71c6e51af5597dbf4ce"
148
148
  }
package/webpack.config.js CHANGED
@@ -34,7 +34,7 @@ const {
34
34
  libraryName,
35
35
  libraryTarget,
36
36
  preset,
37
- targetEnvironment,
37
+ targetEnvironment = 'es2015',
38
38
  webpack: webpackCustom
39
39
  } = lexConfig;
40
40
 
@@ -50,8 +50,7 @@ const plugins = [
50
50
  new DotenvPlugin({path: path.resolve(process.cwd(), '.env'), systemvars: false})
51
51
  ];
52
52
 
53
- const target = preset || targetEnvironment;
54
- const isWeb = target === 'web';
53
+ const isWeb = (preset || targetEnvironment) === 'web';
55
54
 
56
55
  if(isWeb) {
57
56
  plugins.push(
@@ -144,6 +143,7 @@ const aliasPaths = {
144
143
  '@nlabs/arkhamjs': relativeFilePath('node_modules/@nlabs/arkhamjs', process.cwd()),
145
144
  '@nlabs/arkhamjs-utils-react': relativeFilePath('node_modules/@nlabs/arkhamjs-utils-react', process.cwd()),
146
145
  'core-js': getNodePath('core-js'),
146
+ process: relativeFilePath('node_modules/process', process.cwd()),
147
147
  react: relativeFilePath('node_modules/react', process.cwd()),
148
148
  'react-dom': relativeFilePath('node_modules/react-dom', process.cwd()),
149
149
  'regenerator-runtime': getNodePath('regenerator-runtime')
@@ -194,7 +194,7 @@ module.exports = (webpackEnv, webpackOptions) => {
194
194
  loader: esbuildLoaderPath,
195
195
  options: {
196
196
  loader: 'tsx',
197
- target: 'es2015'
197
+ target: targetEnvironment
198
198
  },
199
199
  test: /\.(ts|tsx|js)$/
200
200
  },
@@ -282,7 +282,7 @@ module.exports = (webpackEnv, webpackOptions) => {
282
282
  minimizer: [
283
283
  new ESBuildMinifyPlugin({
284
284
  css: true,
285
- target: 'es2015'
285
+ target: targetEnvironment
286
286
  })
287
287
  ],
288
288
  runtimeChunk: 'single',
@@ -331,7 +331,7 @@ module.exports = (webpackEnv, webpackOptions) => {
331
331
  // stats: {
332
332
  // warningsFilter: [/Failed to parse source map/]
333
333
  // },
334
- target
334
+ target: isWeb ? 'web' : 'node'
335
335
  };
336
336
 
337
337
  // Add development plugins