@zohodesk/react-cli 0.0.1-beta.166 → 0.0.1-beta.167
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/README.md +41 -0
- package/bin/cli.js +6 -1
- package/cert/Tsicsezwild-22-23.crt +37 -0
- package/cert/Tsicsezwild-22-23.key +27 -0
- package/docs/DevStart.md +18 -0
- package/eslint/NOTES.md +3 -0
- package/eslint/React_CDN.zip +0 -0
- package/eslint/a23.c +16 -0
- package/eslint/a28.c +25 -0
- package/eslint/a29.c +25 -0
- package/eslint/a30.c +29 -0
- package/eslint/a31.c +23 -0
- package/eslint/a35.c +23 -0
- package/eslint/a36.c +18 -0
- package/eslint/a37.c +25 -0
- package/eslint/a38.c +28 -0
- package/eslint/a39.c +17 -0
- package/eslint/a40.c +32 -0
- package/eslint/mockapi.html +18 -0
- package/eslint/mockapi.md +5 -0
- package/eslint/temp/a +0 -0
- package/eslint/temp/a.der +0 -0
- package/eslint/temp/a.jks +0 -0
- package/eslint/temp/a.p12 +0 -0
- package/eslint/temp/a.pfx +0 -0
- package/eslint/temp/c.jks +0 -0
- package/eslint/temp/package.json +15 -0
- package/eslint/temp/pkcs12.keystore +0 -0
- package/eslint/temp/pkk.pfx +0 -0
- package/eslint/temp/sas.keystore +0 -0
- package/eslint/temp/sas.keystore.old +0 -0
- package/eslint/testa/build1/index.html +12 -0
- package/eslint/testa/build1/js/2_.js +15 -0
- package/eslint/testa/build1/js/2_.js.map +1 -0
- package/eslint/testa/build1/js/main_.js +40 -0
- package/eslint/testa/build1/js/main_.js.map +1 -0
- package/eslint/testa/build1/js/runtime~main_.js +251 -0
- package/eslint/testa/build1/js/runtime~main_.js.map +1 -0
- package/eslint/testa/build2/index.html +12 -0
- package/eslint/testa/build2/js/2_.js +15 -0
- package/eslint/testa/build2/js/2_.js.map +1 -0
- package/eslint/testa/build2/js/3_.js +15 -0
- package/eslint/testa/build2/js/3_.js.map +1 -0
- package/eslint/testa/build2/js/main_.js +46 -0
- package/eslint/testa/build2/js/main_.js.map +1 -0
- package/eslint/testa/build2/js/runtime~main_.js +251 -0
- package/eslint/testa/build2/js/runtime~main_.js.map +1 -0
- package/eslint/testa/package.json +22 -0
- package/eslint/testa/scr/chunk1.js +3 -0
- package/eslint/testa/scr/chunk2.js +3 -0
- package/eslint/testa/scr/index.html +12 -0
- package/eslint/testa/scr/index.js +4 -0
- package/eslint/testa/scr/utlis.js +12 -0
- package/eslint/testa/src/chunk1.js +3 -0
- package/eslint/testa/src/index.html +12 -0
- package/eslint/testa/src/index.js +3 -0
- package/eslint/testa/src/utlis.js +7 -0
- package/lib/configs/jest.config.js +6 -1
- package/lib/configs/webpack.dev.config.js +3 -2
- package/lib/configs/webpack.docs.config.js +31 -26
- package/lib/configs/webpack.prod.config.js +4 -3
- package/lib/schemas/index.js +10 -0
- package/lib/servers/{devBulid.js → devBuild.js} +7 -3
- package/lib/servers/httpsOptions.js +2 -3
- package/lib/servers/nowatchserver.js +2 -2
- package/lib/servers/server.js +11 -3
- package/lib/utils/repoClone.js +5 -2
- package/lib/utils/rtl.js +19 -2
- package/lib/utils/useExitCleanup.js +55 -0
- package/package.json +2 -1
- package/postpublish.js +6 -0
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"js/./runtime~main_.js","sources":["webpack:///webpack/bootstrap"],"sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t0: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// script path function\n \tfunction jsonpScriptSrc(chunkId) {\n \t\treturn __webpack_require__.p + \"js/\" + ({}[chunkId]||chunkId) + \"_.js\"\n \t}\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tvar promises = [];\n\n\n \t\t// JSONP chunk loading for javascript\n\n \t\tvar installedChunkData = installedChunks[chunkId];\n \t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n \t\t\t// a Promise means \"currently loading\".\n \t\t\tif(installedChunkData) {\n \t\t\t\tpromises.push(installedChunkData[2]);\n \t\t\t} else {\n \t\t\t\t// setup Promise in chunk cache\n \t\t\t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n \t\t\t\t});\n \t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n \t\t\t\t// start chunk loading\n \t\t\t\tvar script = document.createElement('script');\n \t\t\t\tvar onScriptComplete;\n\n \t\t\t\tscript.charset = 'utf-8';\n \t\t\t\tscript.timeout = 120;\n \t\t\t\tif (__webpack_require__.nc) {\n \t\t\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t\t\t}\n \t\t\t\tscript.src = jsonpScriptSrc(chunkId);\n\n \t\t\t\t// create error before stack unwound to get useful stacktrace later\n \t\t\t\tvar error = new Error();\n \t\t\t\tonScriptComplete = function (event) {\n \t\t\t\t\t// avoid mem leaks in IE.\n \t\t\t\t\tscript.onerror = script.onload = null;\n \t\t\t\t\tclearTimeout(timeout);\n \t\t\t\t\tvar chunk = installedChunks[chunkId];\n \t\t\t\t\tif(chunk !== 0) {\n \t\t\t\t\t\tif(chunk) {\n \t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n \t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n \t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n \t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n \t\t\t\t\t\t\terror.type = errorType;\n \t\t\t\t\t\t\terror.request = realSrc;\n \t\t\t\t\t\t\tchunk[1](error);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t\t\t}\n \t\t\t\t};\n \t\t\t\tvar timeout = setTimeout(function(){\n \t\t\t\t\tonScriptComplete({ type: 'timeout', target: script });\n \t\t\t\t}, 120000);\n \t\t\t\tscript.onerror = script.onload = onScriptComplete;\n \t\t\t\tdocument.head.appendChild(script);\n \t\t\t}\n \t\t}\n \t\treturn Promise.all(promises);\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"https://kumar-zt375.tsi.zohocorpin.com:9090/app/\";\n\n \t__webpack_require__.getChunkId = function getChunkId(chunkId) {\n \t\treturn chunkId;\n \t}\n \t// Prefetch a chunk (prefetch-preload-chunk-plugin)\n \t__webpack_require__.pfc = function prefetchChunk(chunkId) {\n \t\tchunkId = __webpack_require__.getChunkId(chunkId)\n \t\t__webpack_require__.e(chunkId);\n \t};\n \t// Preload a chunk (prefetch-preload-chunk-plugin)\n \t__webpack_require__.plc = function preloadChunk(chunkId) {\n \t\tchunkId = __webpack_require__.getChunkId(chunkId)\n \t\tif(installedChunks[chunkId] === undefined) {\n \t\t\tinstalledChunks[chunkId] = null;\n \t\t\tvar link = document.createElement('link');\n\n \t\t\tlink.charset = 'utf-8';\n \t\t\tif (__webpack_require__.nc) {\n \t\t\t\tlink.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t\t}\n \t\t\tlink.rel = \"preload\";\n \t\t\tlink.as = \"script\";\n \t\t\tlink.href = jsonpScriptSrc(chunkId);\n \t\t\tdocument.head.appendChild(link);\n \t\t\t__webpack_require__.e(chunkId);\n \t\t}\n \t};\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n \tvar jsonpArray = window[\"appJsonp\"] = window[\"appJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// run deferred modules from other chunks\n \tcheckDeferredModules();\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A","sourceRoot":""}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
{
|
2
|
+
"name": "testa",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"build": "react-cli build",
|
8
|
+
"clean": "rm -r build1 build2",
|
9
|
+
"b1": "npm run build --output_folder=build3 --app_folder=src",
|
10
|
+
"b2": "npm run build --output_folder=build4 --app_folder=scr",
|
11
|
+
"b": "npm run b1 && npm run b2",
|
12
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
13
|
+
},
|
14
|
+
"keywords": [],
|
15
|
+
"author": "ponkumar.s <nksponkumar@gmail.com>",
|
16
|
+
"license": "ISC",
|
17
|
+
"react-cli": {
|
18
|
+
"app": {
|
19
|
+
"sourcemap": "cheap-source-map"
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8">
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7
|
+
<title>Document</title>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
</body>
|
12
|
+
</html>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
export function b(text) {
|
2
|
+
console.log("welcome everyone");
|
3
|
+
console.log(text);
|
4
|
+
}
|
5
|
+
|
6
|
+
export function justVeryVeryVeryVeryBigNamesayHello() {
|
7
|
+
console.log("hello");
|
8
|
+
}
|
9
|
+
export function justVeryBigVeryVeryVeryBigNamesay(text) {
|
10
|
+
console.log("hello");
|
11
|
+
console.log("text", text);
|
12
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8">
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7
|
+
<title>Document</title>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<div>Hello world</div>
|
11
|
+
</body>
|
12
|
+
</html>
|
@@ -1,5 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
+
var _fs = require("fs");
|
4
|
+
|
3
5
|
var _path = _interopRequireDefault(require("path"));
|
4
6
|
|
5
7
|
var _libAlias = require("./libAlias");
|
@@ -13,6 +15,9 @@ let moduleNameMapper = Object.keys(_libAlias.libAlias).reduce((previousValue, ke
|
|
13
15
|
previousValue[`^${key}(.*)$`] = `${_libAlias.libAlias[key]}$1`;
|
14
16
|
return previousValue;
|
15
17
|
}, {});
|
18
|
+
|
19
|
+
const appGlobals = _path.default.resolve(appPath, '__testUtils__', 'globals.js');
|
20
|
+
|
16
21
|
let commonConfig = {
|
17
22
|
coverageReporters: ['json', 'html', 'json-summary', 'text'],
|
18
23
|
collectCoverage: true,
|
@@ -28,7 +33,7 @@ let commonConfig = {
|
|
28
33
|
transformIgnorePatterns: ['/node_modules/(?!(@zohodesk)/)'],
|
29
34
|
// transformIgnorePatterns: ['/node_modules.*?.js$'],
|
30
35
|
moduleFileExtensions: ['js'],
|
31
|
-
setupFiles: [
|
36
|
+
setupFiles: [(0, _fs.existsSync)(appGlobals) && appGlobals, _path.default.resolve(__dirname, '..', 'jest', 'setup.js')].filter(Boolean),
|
32
37
|
globals: {
|
33
38
|
__DEVELOPMENT__: true,
|
34
39
|
__DOCS__: false,
|
@@ -16,6 +16,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
16
16
|
|
17
17
|
let options = (0, _utils.getOptions)();
|
18
18
|
let {
|
19
|
+
unstableDepsInverse,
|
19
20
|
app: {
|
20
21
|
folder,
|
21
22
|
context,
|
@@ -131,10 +132,10 @@ module.exports = {
|
|
131
132
|
ZC: '$ZC'
|
132
133
|
},
|
133
134
|
resolve: {
|
134
|
-
modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules'],
|
135
|
+
modules: unstableDepsInverse ? ['node_modules', _path.default.resolve(__dirname, '..', '..', 'node_modules')] : [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules'],
|
135
136
|
alias: disableES5Transpile ? _libAlias.libAlias : {}
|
136
137
|
},
|
137
138
|
resolveLoader: {
|
138
|
-
modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
|
139
|
+
modules: unstableDepsInverse ? ['node_modules', _path.default.resolve(__dirname, '..', '..', 'node_modules')] : [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
|
139
140
|
}
|
140
141
|
};
|
@@ -8,12 +8,16 @@ var _pluginUtils = require("../pluginUtils");
|
|
8
8
|
|
9
9
|
var _loaderUtils = require("../loaderUtils");
|
10
10
|
|
11
|
+
var _libAlias = require("./libAlias");
|
12
|
+
|
11
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
12
14
|
|
13
15
|
let options = (0, _utils.getOptions)();
|
14
16
|
let {
|
17
|
+
unstableDepsInverse,
|
15
18
|
docs: {
|
16
19
|
componentFolder,
|
20
|
+
disableES5Transpile,
|
17
21
|
cssUniqueness,
|
18
22
|
hasRTL,
|
19
23
|
rtlExclude,
|
@@ -28,39 +32,39 @@ let appPath = process.cwd();
|
|
28
32
|
|
29
33
|
module.exports = isSSTest => ({
|
30
34
|
entry: {
|
31
|
-
main: [_path.default.resolve(__dirname,
|
32
|
-
vendor: [
|
35
|
+
main: [_path.default.resolve(__dirname, '..', 'hooks', 'docsProptypeHook.js'), _path.default.join(appPath, componentFolder, 'index.js')],
|
36
|
+
vendor: ['react', 'react-dom', 'redux', 'react-redux']
|
33
37
|
},
|
34
|
-
devtool:
|
35
|
-
mode:
|
38
|
+
devtool: 'none',
|
39
|
+
mode: 'development',
|
36
40
|
output: {
|
37
|
-
path: _path.default.join(appPath,
|
38
|
-
filename:
|
39
|
-
publicPath:
|
40
|
-
library:
|
41
|
-
libraryTarget:
|
41
|
+
path: _path.default.join(appPath, 'build'),
|
42
|
+
filename: 'js/[name].js',
|
43
|
+
publicPath: '/docs/',
|
44
|
+
library: 'Component',
|
45
|
+
libraryTarget: 'umd'
|
42
46
|
},
|
43
47
|
plugins: (0, _pluginUtils.getDocsPlugins)(isSSTest, options),
|
44
48
|
module: {
|
45
49
|
rules: [{
|
46
50
|
test: /\.js$/,
|
47
51
|
use: [{
|
48
|
-
loader:
|
52
|
+
loader: 'babel-loader',
|
49
53
|
options: {
|
50
|
-
presets: [[require.resolve(
|
54
|
+
presets: [[require.resolve('@babel/preset-env'), {
|
51
55
|
modules: false
|
52
|
-
}], require.resolve(
|
53
|
-
plugins: [[require.resolve(
|
56
|
+
}], require.resolve('@babel/preset-react')],
|
57
|
+
plugins: [[require.resolve('@babel/plugin-transform-runtime'), {
|
54
58
|
helpers: true,
|
55
59
|
regenerator: false
|
56
|
-
}], require.resolve(
|
60
|
+
}], require.resolve('@babel/plugin-syntax-dynamic-import'), require.resolve('@babel/plugin-syntax-object-rest-spread')],
|
57
61
|
cacheDirectory: true
|
58
62
|
}
|
59
63
|
}],
|
60
64
|
include: _path.default.join(appPath, folder)
|
61
65
|
}, {
|
62
66
|
test: /\.docs\.js$/,
|
63
|
-
use: require.resolve(
|
67
|
+
use: require.resolve('../loaders/docsLoader.js'),
|
64
68
|
include: _path.default.join(appPath, folder),
|
65
69
|
exclude: /node_modules/
|
66
70
|
}, {
|
@@ -68,29 +72,29 @@ module.exports = isSSTest => ({
|
|
68
72
|
use: (0, _loaderUtils.getCSSLoaders)(hasRTL, rtlExclude, false, cssUniqueness, null, cssHashSelectors, classNamePrefix)
|
69
73
|
}, {
|
70
74
|
test: /\.jpe?g$|\.gif$|\.png$/,
|
71
|
-
use: [
|
75
|
+
use: ['url-loader?limit=1000&name=./images/[name].[ext]']
|
72
76
|
}, {
|
73
77
|
test: /\.woff2|\.woff$|\.ttf$|\.eot$/,
|
74
|
-
use: [
|
78
|
+
use: ['url-loader?limit=1000&name=./fonts/[name].[ext]']
|
75
79
|
}, {
|
76
80
|
test: /\.svg$/,
|
77
|
-
use: [
|
81
|
+
use: ['url-loader?limit=1&name=./fonts/[name].[ext]']
|
78
82
|
}, {
|
79
83
|
test: /\.html$/,
|
80
84
|
use: {
|
81
|
-
loader:
|
85
|
+
loader: 'html-loader',
|
82
86
|
options: {
|
83
|
-
attrs: [
|
84
|
-
interpolate:
|
87
|
+
attrs: [':data-src'],
|
88
|
+
interpolate: 'require'
|
85
89
|
}
|
86
90
|
}
|
87
91
|
}, {
|
88
92
|
test: /\.ogg$/,
|
89
|
-
use: [
|
93
|
+
use: ['file-loader?name=./fonts/[name].[ext]']
|
90
94
|
}, {
|
91
95
|
test: /\.tmpl$/,
|
92
96
|
use: [{
|
93
|
-
loader:
|
97
|
+
loader: 'html-loader',
|
94
98
|
options: {
|
95
99
|
minimize: {
|
96
100
|
removeComments: true,
|
@@ -104,12 +108,13 @@ module.exports = isSSTest => ({
|
|
104
108
|
}]
|
105
109
|
},
|
106
110
|
externals: {
|
107
|
-
ZC:
|
111
|
+
ZC: '$ZC'
|
108
112
|
},
|
109
113
|
resolve: {
|
110
|
-
modules: [_path.default.resolve(__dirname,
|
114
|
+
modules: unstableDepsInverse ? ['node_modules', _path.default.resolve(__dirname, '..', '..', 'node_modules')] : [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules'],
|
115
|
+
alias: disableES5Transpile ? _libAlias.libAlias : {}
|
111
116
|
},
|
112
117
|
resolveLoader: {
|
113
|
-
modules: [_path.default.resolve(__dirname,
|
118
|
+
modules: unstableDepsInverse ? ['node_modules', _path.default.resolve(__dirname, '..', '..', 'node_modules')] : [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
|
114
119
|
}
|
115
120
|
});
|
@@ -17,6 +17,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
17
17
|
// import TerserPlugin from 'terser-webpack-plugin';
|
18
18
|
let options = (0, _utils.getOptions)();
|
19
19
|
let {
|
20
|
+
unstableDepsInverse,
|
20
21
|
app: {
|
21
22
|
folder,
|
22
23
|
context,
|
@@ -80,7 +81,7 @@ module.exports = {
|
|
80
81
|
concatenateModules: true,
|
81
82
|
minimize: true,
|
82
83
|
// by default if minimize: true in webpack minimize then webpack automaticaly add TerserPlugin,
|
83
|
-
// So we are overrideing it.
|
84
|
+
// So we are overrideing it.
|
84
85
|
// minimizer: [
|
85
86
|
// new TerserPlugin({
|
86
87
|
// cache: true,
|
@@ -208,10 +209,10 @@ module.exports = {
|
|
208
209
|
ZC: '$ZC'
|
209
210
|
},
|
210
211
|
resolve: {
|
211
|
-
modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules'],
|
212
|
+
modules: unstableDepsInverse ? ['node_modules', _path.default.resolve(__dirname, '..', '..', 'node_modules')] : [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules'],
|
212
213
|
alias: disableES5Transpile ? _libAlias.libAlias : {}
|
213
214
|
},
|
214
215
|
resolveLoader: {
|
215
|
-
modules: [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
|
216
|
+
modules: unstableDepsInverse ? ['node_modules', _path.default.resolve(__dirname, '..', '..', 'node_modules')] : [_path.default.resolve(__dirname, '..', '..', 'node_modules'), 'node_modules']
|
216
217
|
}
|
217
218
|
};
|
package/lib/schemas/index.js
CHANGED
@@ -14,6 +14,11 @@ var _getCurrentBranch = _interopRequireDefault(require("../utils/getCurrentBranc
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
15
|
|
16
16
|
var _default = {
|
17
|
+
cliRootPath: null,
|
18
|
+
unstableDepsInverse: {
|
19
|
+
value: false,
|
20
|
+
cli: 'unstable_deps_inverse'
|
21
|
+
},
|
17
22
|
sslCertURL: {
|
18
23
|
value: null,
|
19
24
|
cli: 'ssl_cert_url'
|
@@ -257,6 +262,7 @@ var _default = {
|
|
257
262
|
cli: 'css_unique'
|
258
263
|
},
|
259
264
|
folder: 'src',
|
265
|
+
disableES5Transpile: false,
|
260
266
|
hasRTL: false,
|
261
267
|
rtlExclude: [],
|
262
268
|
cssHashSelectors: {
|
@@ -553,6 +559,10 @@ var _default = {
|
|
553
559
|
value: null,
|
554
560
|
cli: 'clone_revision'
|
555
561
|
},
|
562
|
+
shallowClone: {
|
563
|
+
value: false,
|
564
|
+
cli: 'shallow_clone'
|
565
|
+
},
|
556
566
|
projectName: {
|
557
567
|
value: null,
|
558
568
|
cli: 'clone_proj_name'
|
@@ -18,6 +18,9 @@ var _getCliPath = require("./getCliPath");
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
19
|
|
20
20
|
const options = (0, _utils.getOptions)(); // const args = process.argv.slice(3);
|
21
|
+
// NOTE: need to discuss about in below codes,
|
22
|
+
// when we run webpack the usable options that comes for npm run not working as automatical
|
23
|
+
// we are use this option always --disable_watch=true reason for now no need for
|
21
24
|
|
22
25
|
const {
|
23
26
|
app: {
|
@@ -61,8 +64,9 @@ const startTime = Date.now(); // const result = spawnSync(
|
|
61
64
|
// ),
|
62
65
|
// { stdio: 'inherit' }
|
63
66
|
// );
|
67
|
+
// --disable_watch=true
|
64
68
|
|
65
|
-
const result = execSyncDefalut(`${webpack} --config ${require.resolve('../configs/webpack.dev.config.js')}`);
|
69
|
+
const result = execSyncDefalut(`${webpack} --config ${require.resolve('../configs/webpack.dev.config.js')} ${process.argv.slice(2).map(o => o.replace(/(.*?)=(.*)/, '$1="$2"')).join(' ')} `);
|
66
70
|
result && console.log(result);
|
67
71
|
|
68
72
|
if (result && result.stderr) {
|
@@ -83,8 +87,8 @@ if (zipname) {
|
|
83
87
|
} else {
|
84
88
|
console.log('zip file created', cssSelectorZipPath);
|
85
89
|
}
|
86
|
-
} // npm run start --app:domain=tsi --impact:cssbountry="{$@&&@$}" --disable-watch --dev-cache --cssselector_zip=css-source-map.zip
|
87
|
-
// npm run start --app_domain=tsi --impact_cssbountry="{$@&&@$}" --disable-watch --dev-cache --cssselector_zip=css-source-map.zip
|
90
|
+
} // npm run start --app:domain=tsi --impact:cssbountry="{$@&&@$}" --disable-watch --dev-cache --cssselector_zip=css-source-map.zip
|
91
|
+
// npm run start --app_domain=tsi --impact_cssbountry="{$@&&@$}" --disable-watch --dev-cache --cssselector_zip=css-source-map.zip
|
88
92
|
|
89
93
|
|
90
94
|
console.log(`compailation done in ${Date.now() - startTime}ms`);
|
@@ -12,8 +12,7 @@ var _path = _interopRequireDefault(require("path"));
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
13
|
|
14
14
|
const httpsOptions = {
|
15
|
-
key: _fs.default.readFileSync(_path.default.join(__dirname, '../../cert/key
|
16
|
-
cert: _fs.default.readFileSync(_path.default.join(__dirname, '../../cert/
|
17
|
-
passphrase: _fs.default.readFileSync(_path.default.join(__dirname, '../../cert/passphrase.pem')).toString()
|
15
|
+
key: _fs.default.readFileSync(_path.default.join(__dirname, '../../cert/Tsicsezwild-22-23.key')),
|
16
|
+
cert: _fs.default.readFileSync(_path.default.join(__dirname, '../../cert/Tsicsezwild-22-23.crt'))
|
18
17
|
};
|
19
18
|
exports.httpsOptions = httpsOptions;
|
@@ -14,7 +14,7 @@ var _utils = require("../utils");
|
|
14
14
|
|
15
15
|
var _httpsOptions = require("./httpsOptions");
|
16
16
|
|
17
|
-
var
|
17
|
+
var _devBuild = require("./devBuild");
|
18
18
|
|
19
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
20
20
|
|
@@ -42,7 +42,7 @@ const {
|
|
42
42
|
zipname,
|
43
43
|
cssSelectorZipPath,
|
44
44
|
outputFolderLocation
|
45
|
-
} = (0,
|
45
|
+
} = (0, _devBuild.getPaths)();
|
46
46
|
const app = (0, _express.default)();
|
47
47
|
|
48
48
|
if (hasMock) {
|
package/lib/servers/server.js
CHANGED
@@ -69,7 +69,8 @@ if (mode === 'prod') {
|
|
69
69
|
config = require('../configs/webpack.dev.config');
|
70
70
|
} else {
|
71
71
|
throw new Error('You must configure valid option in mode');
|
72
|
-
}
|
72
|
+
} // console.log({ contextURL });
|
73
|
+
|
73
74
|
|
74
75
|
let compiler = (0, _webpack.default)(config);
|
75
76
|
let webpackServerOptions = {
|
@@ -144,15 +145,22 @@ app.post('/wmsmockapi', (req, res) => {
|
|
144
145
|
res.send('success');
|
145
146
|
});
|
146
147
|
let webpackCompilation;
|
148
|
+
let initalHTML;
|
147
149
|
compiler.hooks.afterCompile.tap('ReactCLI', compilation => {
|
148
150
|
webpackCompilation = compilation;
|
149
151
|
});
|
152
|
+
compiler.hooks.done.tap('ReactCLI', () => {
|
153
|
+
const indexHtml = webpackCompilation.assets['index.html'];
|
154
|
+
|
155
|
+
if (indexHtml) {
|
156
|
+
initalHTML = indexHtml.source();
|
157
|
+
}
|
158
|
+
});
|
150
159
|
|
151
160
|
if (contextURL) {
|
152
161
|
app.use(contextURL, _express.default.static(context));
|
153
162
|
app.use(`${contextURL}/*`, (req, res) => {
|
154
|
-
|
155
|
-
res.send(indexHtml && indexHtml.source());
|
163
|
+
res.send(initalHTML);
|
156
164
|
});
|
157
165
|
} else {
|
158
166
|
app.use(_express.default.static(context));
|
package/lib/utils/repoClone.js
CHANGED
@@ -28,6 +28,7 @@ let {
|
|
28
28
|
branch,
|
29
29
|
revision,
|
30
30
|
projectName,
|
31
|
+
shallowClone,
|
31
32
|
cacheDir,
|
32
33
|
remoteName,
|
33
34
|
shouldDelete
|
@@ -73,9 +74,11 @@ let cloneRepo = () => {
|
|
73
74
|
}
|
74
75
|
}
|
75
76
|
|
76
|
-
(0, _index.log)(`Going to clone ${url} repo to ${cacheDir} path`); // this is for some time error will because of hg or git so we addid error log for this
|
77
|
+
(0, _index.log)(`Going to clone ${url} repo to ${cacheDir} path`); // this is for some time error will because of hg or git so we addid error log for this
|
77
78
|
|
78
|
-
|
79
|
+
let oargs = ['clone', url, revisionOrBranch, projectName];
|
80
|
+
type === 'git' && shallowClone && oargs.push('--depth=1');
|
81
|
+
spawnSyncWithErrorLog(type, oargs, {
|
79
82
|
cwd: cacheDir,
|
80
83
|
stdio: 'inherit'
|
81
84
|
});
|
package/lib/utils/rtl.js
CHANGED
@@ -18,7 +18,10 @@ let src = _path.default.join(cwd, process.argv[2]);
|
|
18
18
|
|
19
19
|
let dist = _path.default.join(cwd, process.argv[3]);
|
20
20
|
|
21
|
-
|
21
|
+
let canWacth = '-w' === process.argv[4];
|
22
|
+
|
23
|
+
// import { useExitCleanup } from './useExitCleanup';
|
24
|
+
function watchHandler(fromPath, toPath) {
|
22
25
|
let css = _fs.default.readFileSync(fromPath);
|
23
26
|
|
24
27
|
(0, _postcss.default)([(0, _postcssRtl.default)({
|
@@ -39,4 +42,18 @@ let dist = _path.default.join(cwd, process.argv[3]);
|
|
39
42
|
_fs.default.writeFile(`${toPath}.map`, result.map, () => true);
|
40
43
|
}
|
41
44
|
});
|
42
|
-
}
|
45
|
+
}
|
46
|
+
|
47
|
+
(0, _folderIterator.default)(src, dist, ['.css'], false, (fromPath, toPath) => {
|
48
|
+
if (canWacth && fromPath) {
|
49
|
+
_fs.default.watchFile(fromPath, () => {
|
50
|
+
watchHandler(fromPath, toPath);
|
51
|
+
});
|
52
|
+
}
|
53
|
+
|
54
|
+
watchHandler(fromPath, toPath);
|
55
|
+
}); // if (canWacth) {
|
56
|
+
// useExitCleanup(() => {
|
57
|
+
// fs.unwatchFile(src, watchHandler);
|
58
|
+
// });
|
59
|
+
// }
|
@@ -0,0 +1,55 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.useExitCleanup = useExitCleanup;
|
7
|
+
//so the program will not close instantly
|
8
|
+
let listeners = [];
|
9
|
+
let hasCalled = false;
|
10
|
+
|
11
|
+
function useExitCleanup(listener) {
|
12
|
+
if (!hasCalled) {
|
13
|
+
process.stdin.resume();
|
14
|
+
hasCalled = true;
|
15
|
+
}
|
16
|
+
|
17
|
+
listeners.push(listeners);
|
18
|
+
return () => {
|
19
|
+
listeners = listeners.filter(l => l !== listener);
|
20
|
+
};
|
21
|
+
}
|
22
|
+
|
23
|
+
function exitHandler(options, exitCode) {
|
24
|
+
if (options.cleanup) {
|
25
|
+
console.log('clean');
|
26
|
+
}
|
27
|
+
|
28
|
+
if (exitCode || exitCode === 0) {
|
29
|
+
console.log(exitCode);
|
30
|
+
}
|
31
|
+
|
32
|
+
if (options.exit) {
|
33
|
+
process.exit();
|
34
|
+
}
|
35
|
+
} //do something when app is closing
|
36
|
+
|
37
|
+
|
38
|
+
process.on('exit', exitHandler.bind(null, {
|
39
|
+
cleanup: true
|
40
|
+
})); //catches ctrl+c event
|
41
|
+
|
42
|
+
process.on('SIGINT', exitHandler.bind(null, {
|
43
|
+
exit: true
|
44
|
+
})); // catches "kill pid" (for example: nodemon restart)
|
45
|
+
|
46
|
+
process.on('SIGUSR1', exitHandler.bind(null, {
|
47
|
+
exit: true
|
48
|
+
}));
|
49
|
+
process.on('SIGUSR2', exitHandler.bind(null, {
|
50
|
+
exit: true
|
51
|
+
})); //catches uncaught exceptions
|
52
|
+
|
53
|
+
process.on('uncaughtException', exitHandler.bind(null, {
|
54
|
+
exit: true
|
55
|
+
}));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@zohodesk/react-cli",
|
3
|
-
"version": "0.0.1-beta.
|
3
|
+
"version": "0.0.1-beta.167",
|
4
4
|
"description": "A CLI tool for build modern web application and libraries",
|
5
5
|
"scripts": {
|
6
6
|
"init": "node ./lib/utils/init.js",
|
@@ -10,6 +10,7 @@
|
|
10
10
|
"build": "babel src -d lib --copy-files",
|
11
11
|
"prepare": "npm run clean && npm run build",
|
12
12
|
"lint": "eslint src ./bin/cli.js",
|
13
|
+
"postpublish": "node postpublish.js",
|
13
14
|
"expublish": "npm publish --tag experimental-version"
|
14
15
|
},
|
15
16
|
"engines": {
|
package/postpublish.js
ADDED
@@ -0,0 +1,6 @@
|
|
1
|
+
const { execSync } = require('child_process');
|
2
|
+
const { version } = require('./package.json');
|
3
|
+
console.log(`going to add git tag... v${version}`);
|
4
|
+
|
5
|
+
execSync(`git tag -a v${version}`, { stdio: 'inherit' });
|
6
|
+
execSync(`git push origin v${version}`, { stdio: 'inherit' });
|