@variousjs/create 0.0.5 → 0.3.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/bin/copy.js +14 -29
- package/bin/create.js +17 -0
- package/demo/dist/card.js +1 -695
- package/demo/dist/card.js.map +1 -1
- package/demo/dist/entry.js +1 -1
- package/demo/dist/entry.js.map +1 -1
- package/demo/dist/next.js +1 -222
- package/demo/dist/next.js.map +1 -1
- package/demo/index.html +5 -1
- package/package-lock.json.copy +116 -5
- package/package.json +5 -7
- package/package.json.copy +3 -4
- package/src/components/next.tsx +4 -5
- package/src/entry/container.tsx +2 -3
- package/webpack.base.config.js +5 -10
package/demo/dist/next.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.js","mappings":"
|
|
1
|
+
{"version":3,"file":"next.js","mappings":"oHAAAA,EAAOC,QAAUC,G,gBCAjBF,EAAOC,QAAUE,G,gBCAjBH,EAAOC,QAAUG,ICCbC,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaP,QAGrB,IAAID,EAASK,EAAyBE,GAAY,CAGjDN,QAAS,IAOV,OAHAS,EAAoBH,GAAUP,EAAQA,EAAOC,QAASK,GAG/CN,EAAOC,QCpBfK,EAAoBK,EAAI,SAASX,GAChC,IAAIY,EAASZ,GAAUA,EAAOa,WAC7B,WAAa,OAAOb,EAAgB,SACpC,WAAa,OAAOA,GAErB,OADAM,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRN,EAAoBQ,EAAI,SAASb,EAASe,GACzC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAEjB,EAASgB,IAC5EE,OAAOC,eAAenB,EAASgB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3EX,EAAoBY,EAAI,SAASK,EAAKC,GAAQ,OAAOL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,ICC/FlB,EAAoBsB,EAAI,SAAS3B,GACX,oBAAX4B,QAA0BA,OAAOC,aAC1CX,OAAOC,eAAenB,EAAS4B,OAAOC,YAAa,CAAEC,MAAO,WAE7DZ,OAAOC,eAAenB,EAAS,aAAc,CAAE8B,OAAO,K,qrCCGvD,MAKI,IAAIC,EAAAA,MAJNC,EADF,EACEA,YACAC,EAFF,EAEEA,QACAC,EAHF,EAGEA,SACAC,EAJF,EAIEA,SAGFH,EAAY,CAAEF,MAAO,I,UAEfM,EAAAA,SAAAA,I,muBAMJ,WACE,IAAQC,EAASC,KAAKC,MAAMC,OAApBH,KACAP,EAAUQ,KAAKC,MAAfT,MAER,OACE,kBAAC,EAAAW,aAAD,CACEC,MAAO,CAAEC,UAAW,IACpBC,UAAQ,EACRC,MAAM,iBACNC,KAAK,SAEL,kBAAC,EAAAL,aAAA,KAAD,CAAmBM,MAAM,SAASV,EAAKW,MACvC,kBAAC,EAAAP,aAAA,KAAD,CAAmBM,MAAM,SAASjB,S,mBAlBpCM,CAAUa,EAAAA,W,EAAVb,E,EAAAA,W,EAAAA,W,oCACc,WAAON,GAAP,sFACVoB,EAAQf,IACdD,EAAS,CAAEJ,MAAOA,EAAQoB,EAAMpB,QAAS,GAFzB,0C,kOADdM,G,6FAwBN,UAAeH,EAAQ,QAAvB,CAAgCG,G","sources":["webpack://@variousjs/create/external amd {\"root\":\"React\",\"amd\":\"react\"}","webpack://@variousjs/create/external amd {\"root\":\"antd\",\"amd\":\"antd\"}","webpack://@variousjs/create/external amd {\"root\":\"various\",\"amd\":\"@variousjs/various\"}","webpack://@variousjs/create/webpack/bootstrap","webpack://@variousjs/create/webpack/runtime/compat get default export","webpack://@variousjs/create/webpack/runtime/define property getters","webpack://@variousjs/create/webpack/runtime/hasOwnProperty shorthand","webpack://@variousjs/create/webpack/runtime/make namespace object","webpack://@variousjs/create/./src/components/next.tsx"],"sourcesContent":["module.exports = __WEBPACK_EXTERNAL_MODULE__161__;","module.exports = __WEBPACK_EXTERNAL_MODULE__937__;","module.exports = __WEBPACK_EXTERNAL_MODULE__437__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import React, { Component } from 'react'\nimport { ComponentProps, Store, Connect as CT } from '@variousjs/various'\nimport { Descriptions } from 'antd'\nimport { Store as GlobalStore } from '../types'\n\ntype S = { value: number }\ntype Connect = CT<S>\n\nconst {\n createStore,\n connect,\n dispatch,\n getStore,\n} = new Store<S>()\n\ncreateStore({ value: 0 })\n\nclass X extends Component<Connect & ComponentProps<GlobalStore>> {\n static setValue = async (value: number) => {\n const store = getStore()\n dispatch({ value: value + store.value }, true)\n }\n\n render() {\n const { user } = this.props.$store\n const { value } = this.props\n\n return (\n <Descriptions\n style={{ marginTop: 30 }}\n bordered\n title=\"Next Component\"\n size=\"small\"\n >\n <Descriptions.Item label=\"Store\">{user.name}</Descriptions.Item>\n <Descriptions.Item label=\"Value\">{value}</Descriptions.Item>\n </Descriptions>\n )\n }\n}\n\nexport default connect('value')(X)\n"],"names":["module","exports","__WEBPACK_EXTERNAL_MODULE__161__","__WEBPACK_EXTERNAL_MODULE__937__","__WEBPACK_EXTERNAL_MODULE__437__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","Store","createStore","connect","dispatch","getStore","X","user","this","props","$store","Descriptions","style","marginTop","bordered","title","size","label","name","Component","store"],"sourceRoot":""}
|
package/demo/index.html
CHANGED
|
@@ -8,13 +8,17 @@
|
|
|
8
8
|
<body>
|
|
9
9
|
<div id="root"></div>
|
|
10
10
|
<script src="https://cdn.jsdelivr.net/npm/requirejs@2.3.6/require.js"></script>
|
|
11
|
-
<script src="https://cdn.jsdelivr.net/npm/@variousjs/various/dist/index.js"></script>
|
|
11
|
+
<script src="https://cdn.jsdelivr.net/npm/@variousjs/various@0.3.0/dist/index.js"></script>
|
|
12
12
|
<script>
|
|
13
13
|
var config = {
|
|
14
14
|
root: '#root',
|
|
15
15
|
entry: './dist/entry.js',
|
|
16
16
|
routerMode: 'hash',
|
|
17
17
|
dependencies: {
|
|
18
|
+
// 内置依赖,如果不定义会默认使用 unpkg cdn 链接
|
|
19
|
+
react: 'https://cdn.jsdelivr.net/npm/react@17.0.2/umd/react.production.min.js',
|
|
20
|
+
'react-dom': 'https://cdn.jsdelivr.net/npm/react-dom@17.0.2/umd/react-dom.production.min.js',
|
|
21
|
+
|
|
18
22
|
// 依赖定义
|
|
19
23
|
moment: 'https://cdn.jsdelivr.net/npm/moment@2.29.1/min/moment.min.js',
|
|
20
24
|
antd: 'https://cdn.jsdelivr.net/npm/antd@4.16.13/dist/antd-with-locales.min.js',
|
package/package-lock.json.copy
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@variousjs/create",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"lockfileVersion": 1,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"dependencies": {
|
|
@@ -1472,10 +1472,14 @@
|
|
|
1472
1472
|
}
|
|
1473
1473
|
},
|
|
1474
1474
|
"@variousjs/various": {
|
|
1475
|
-
"version": "0.0
|
|
1476
|
-
"resolved": "https://registry.npmjs.org/@variousjs/various/-/various-0.0.
|
|
1477
|
-
"integrity": "sha512-
|
|
1478
|
-
"dev": true
|
|
1475
|
+
"version": "0.3.0",
|
|
1476
|
+
"resolved": "https://registry.npmjs.org/@variousjs/various/-/various-0.3.0.tgz",
|
|
1477
|
+
"integrity": "sha512-clpDjT8C6ZHkEd/wqcddLY5okiXxpCYTRekrRihetJPUdVuuATFaNmDTy14210lOCsA21RjX0O398U1qYB6CjQ==",
|
|
1478
|
+
"dev": true,
|
|
1479
|
+
"requires": {
|
|
1480
|
+
"nycticorax": "^2.0.6",
|
|
1481
|
+
"react-router-dom": "^5.3.0"
|
|
1482
|
+
}
|
|
1479
1483
|
},
|
|
1480
1484
|
"@webassemblyjs/ast": {
|
|
1481
1485
|
"version": "1.11.1",
|
|
@@ -3568,6 +3572,29 @@
|
|
|
3568
3572
|
"has-symbols": "^1.0.2"
|
|
3569
3573
|
}
|
|
3570
3574
|
},
|
|
3575
|
+
"history": {
|
|
3576
|
+
"version": "4.10.1",
|
|
3577
|
+
"resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz",
|
|
3578
|
+
"integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==",
|
|
3579
|
+
"dev": true,
|
|
3580
|
+
"requires": {
|
|
3581
|
+
"@babel/runtime": "^7.1.2",
|
|
3582
|
+
"loose-envify": "^1.2.0",
|
|
3583
|
+
"resolve-pathname": "^3.0.0",
|
|
3584
|
+
"tiny-invariant": "^1.0.2",
|
|
3585
|
+
"tiny-warning": "^1.0.0",
|
|
3586
|
+
"value-equal": "^1.0.1"
|
|
3587
|
+
}
|
|
3588
|
+
},
|
|
3589
|
+
"hoist-non-react-statics": {
|
|
3590
|
+
"version": "3.3.2",
|
|
3591
|
+
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
|
|
3592
|
+
"integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==",
|
|
3593
|
+
"dev": true,
|
|
3594
|
+
"requires": {
|
|
3595
|
+
"react-is": "^16.7.0"
|
|
3596
|
+
}
|
|
3597
|
+
},
|
|
3571
3598
|
"hosted-git-info": {
|
|
3572
3599
|
"version": "2.8.9",
|
|
3573
3600
|
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
|
|
@@ -4404,6 +4431,16 @@
|
|
|
4404
4431
|
"integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
|
|
4405
4432
|
"dev": true
|
|
4406
4433
|
},
|
|
4434
|
+
"mini-create-react-context": {
|
|
4435
|
+
"version": "0.4.1",
|
|
4436
|
+
"resolved": "https://registry.npmjs.org/mini-create-react-context/-/mini-create-react-context-0.4.1.tgz",
|
|
4437
|
+
"integrity": "sha512-YWCYEmd5CQeHGSAKrYvXgmzzkrvssZcuuQDDeqkT+PziKGMgE+0MCCtcKbROzocGBG1meBLl2FotlRwf4gAzbQ==",
|
|
4438
|
+
"dev": true,
|
|
4439
|
+
"requires": {
|
|
4440
|
+
"@babel/runtime": "^7.12.1",
|
|
4441
|
+
"tiny-warning": "^1.0.3"
|
|
4442
|
+
}
|
|
4443
|
+
},
|
|
4407
4444
|
"minimalistic-assert": {
|
|
4408
4445
|
"version": "1.0.1",
|
|
4409
4446
|
"resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz",
|
|
@@ -5142,6 +5179,56 @@
|
|
|
5142
5179
|
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==",
|
|
5143
5180
|
"dev": true
|
|
5144
5181
|
},
|
|
5182
|
+
"react-router": {
|
|
5183
|
+
"version": "5.2.1",
|
|
5184
|
+
"resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.1.tgz",
|
|
5185
|
+
"integrity": "sha512-lIboRiOtDLFdg1VTemMwud9vRVuOCZmUIT/7lUoZiSpPODiiH1UQlfXy+vPLC/7IWdFYnhRwAyNqA/+I7wnvKQ==",
|
|
5186
|
+
"dev": true,
|
|
5187
|
+
"requires": {
|
|
5188
|
+
"@babel/runtime": "^7.12.13",
|
|
5189
|
+
"history": "^4.9.0",
|
|
5190
|
+
"hoist-non-react-statics": "^3.1.0",
|
|
5191
|
+
"loose-envify": "^1.3.1",
|
|
5192
|
+
"mini-create-react-context": "^0.4.0",
|
|
5193
|
+
"path-to-regexp": "^1.7.0",
|
|
5194
|
+
"prop-types": "^15.6.2",
|
|
5195
|
+
"react-is": "^16.6.0",
|
|
5196
|
+
"tiny-invariant": "^1.0.2",
|
|
5197
|
+
"tiny-warning": "^1.0.0"
|
|
5198
|
+
},
|
|
5199
|
+
"dependencies": {
|
|
5200
|
+
"isarray": {
|
|
5201
|
+
"version": "0.0.1",
|
|
5202
|
+
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
|
|
5203
|
+
"integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=",
|
|
5204
|
+
"dev": true
|
|
5205
|
+
},
|
|
5206
|
+
"path-to-regexp": {
|
|
5207
|
+
"version": "1.8.0",
|
|
5208
|
+
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz",
|
|
5209
|
+
"integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==",
|
|
5210
|
+
"dev": true,
|
|
5211
|
+
"requires": {
|
|
5212
|
+
"isarray": "0.0.1"
|
|
5213
|
+
}
|
|
5214
|
+
}
|
|
5215
|
+
}
|
|
5216
|
+
},
|
|
5217
|
+
"react-router-dom": {
|
|
5218
|
+
"version": "5.3.0",
|
|
5219
|
+
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.0.tgz",
|
|
5220
|
+
"integrity": "sha512-ObVBLjUZsphUUMVycibxgMdh5jJ1e3o+KpAZBVeHcNQZ4W+uUGGWsokurzlF4YOldQYRQL4y6yFRWM4m3svmuQ==",
|
|
5221
|
+
"dev": true,
|
|
5222
|
+
"requires": {
|
|
5223
|
+
"@babel/runtime": "^7.12.13",
|
|
5224
|
+
"history": "^4.9.0",
|
|
5225
|
+
"loose-envify": "^1.3.1",
|
|
5226
|
+
"prop-types": "^15.6.2",
|
|
5227
|
+
"react-router": "5.2.1",
|
|
5228
|
+
"tiny-invariant": "^1.0.2",
|
|
5229
|
+
"tiny-warning": "^1.0.0"
|
|
5230
|
+
}
|
|
5231
|
+
},
|
|
5145
5232
|
"read-pkg": {
|
|
5146
5233
|
"version": "3.0.0",
|
|
5147
5234
|
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
|
|
@@ -5380,6 +5467,12 @@
|
|
|
5380
5467
|
"integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==",
|
|
5381
5468
|
"dev": true
|
|
5382
5469
|
},
|
|
5470
|
+
"resolve-pathname": {
|
|
5471
|
+
"version": "3.0.0",
|
|
5472
|
+
"resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz",
|
|
5473
|
+
"integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==",
|
|
5474
|
+
"dev": true
|
|
5475
|
+
},
|
|
5383
5476
|
"retry": {
|
|
5384
5477
|
"version": "0.13.1",
|
|
5385
5478
|
"resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz",
|
|
@@ -6029,6 +6122,18 @@
|
|
|
6029
6122
|
"integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==",
|
|
6030
6123
|
"dev": true
|
|
6031
6124
|
},
|
|
6125
|
+
"tiny-invariant": {
|
|
6126
|
+
"version": "1.2.0",
|
|
6127
|
+
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.2.0.tgz",
|
|
6128
|
+
"integrity": "sha512-1Uhn/aqw5C6RI4KejVeTg6mIS7IqxnLJ8Mv2tV5rTc0qWobay7pDUz6Wi392Cnc8ak1H0F2cjoRzb2/AW4+Fvg==",
|
|
6129
|
+
"dev": true
|
|
6130
|
+
},
|
|
6131
|
+
"tiny-warning": {
|
|
6132
|
+
"version": "1.0.3",
|
|
6133
|
+
"resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz",
|
|
6134
|
+
"integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==",
|
|
6135
|
+
"dev": true
|
|
6136
|
+
},
|
|
6032
6137
|
"to-fast-properties": {
|
|
6033
6138
|
"version": "2.0.0",
|
|
6034
6139
|
"resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
|
|
@@ -6234,6 +6339,12 @@
|
|
|
6234
6339
|
"spdx-expression-parse": "^3.0.0"
|
|
6235
6340
|
}
|
|
6236
6341
|
},
|
|
6342
|
+
"value-equal": {
|
|
6343
|
+
"version": "1.0.1",
|
|
6344
|
+
"resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz",
|
|
6345
|
+
"integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==",
|
|
6346
|
+
"dev": true
|
|
6347
|
+
},
|
|
6237
6348
|
"vary": {
|
|
6238
6349
|
"version": "1.1.2",
|
|
6239
6350
|
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
package/package.json
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@variousjs/create",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "VariousJS boilerplate",
|
|
5
5
|
"bin": "bin/create.js",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
|
-
"lint": "eslint . --ext .ts,.tsx,.js",
|
|
10
|
+
"lint": "tsc --noemit && eslint . --ext .ts,.tsx,.js",
|
|
11
11
|
"start": "webpack --progress --config webpack.component.config.js & webpack serve --config webpack.entry.config.js --progress",
|
|
12
|
-
"build": "
|
|
13
|
-
"prepublishOnly": "
|
|
14
|
-
"postinstall": "COPY_ENV=init node bin/copy.js"
|
|
12
|
+
"build": "webpack --progress --config webpack.base.config.js",
|
|
13
|
+
"prepublishOnly": "node bin/copy.js"
|
|
15
14
|
},
|
|
16
15
|
"repository": {
|
|
17
16
|
"type": "git",
|
|
@@ -37,7 +36,7 @@
|
|
|
37
36
|
"@types/react-router-dom": "^5.3.1",
|
|
38
37
|
"@typescript-eslint/eslint-plugin": "^4.31.2",
|
|
39
38
|
"@typescript-eslint/parser": "^4.31.2",
|
|
40
|
-
"@variousjs/various": "0.0
|
|
39
|
+
"@variousjs/various": "^0.3.0",
|
|
41
40
|
"babel-loader": "^8.2.2",
|
|
42
41
|
"css-loader": "^6.3.0",
|
|
43
42
|
"eslint": "^7.32.0",
|
|
@@ -48,7 +47,6 @@
|
|
|
48
47
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
49
48
|
"less": "^4.1.1",
|
|
50
49
|
"less-loader": "^10.0.1",
|
|
51
|
-
"nycticorax": "^2.0.6",
|
|
52
50
|
"style-loader": "^3.3.0",
|
|
53
51
|
"typescript": "^4.4.3",
|
|
54
52
|
"webpack": "^5.54.0",
|
package/package.json.copy
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
"version": "0.1.0",
|
|
4
4
|
"description": "VariousJS boilerplate",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"lint": "eslint . --ext .ts,.tsx,.js",
|
|
6
|
+
"lint": "tsc --noemit && eslint . --ext .ts,.tsx,.js",
|
|
7
7
|
"start": "webpack --progress --config webpack.component.config.js & webpack serve --config webpack.entry.config.js --progress",
|
|
8
|
-
"build": "
|
|
8
|
+
"build": "webpack --progress --config webpack.base.config.js"
|
|
9
9
|
},
|
|
10
10
|
"author": "LoeiFy <LoeiFy@gmail.com>",
|
|
11
11
|
"license": "MIT",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@types/react-router-dom": "^5.3.1",
|
|
20
20
|
"@typescript-eslint/eslint-plugin": "^4.31.2",
|
|
21
21
|
"@typescript-eslint/parser": "^4.31.2",
|
|
22
|
-
"@variousjs/various": "0.0
|
|
22
|
+
"@variousjs/various": "^0.3.0",
|
|
23
23
|
"babel-loader": "^8.2.2",
|
|
24
24
|
"css-loader": "^6.3.0",
|
|
25
25
|
"eslint": "^7.32.0",
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
31
31
|
"less": "^4.1.1",
|
|
32
32
|
"less-loader": "^10.0.1",
|
|
33
|
-
"nycticorax": "^2.0.6",
|
|
34
33
|
"style-loader": "^3.3.0",
|
|
35
34
|
"typescript": "^4.4.3",
|
|
36
35
|
"webpack": "^5.54.0",
|
package/src/components/next.tsx
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import React, { Component } from 'react'
|
|
2
|
-
import
|
|
3
|
-
import { ComponentProps } from '@variousjs/various'
|
|
2
|
+
import { ComponentProps, Store, Connect as CT } from '@variousjs/various'
|
|
4
3
|
import { Descriptions } from 'antd'
|
|
5
4
|
import { Store as GlobalStore } from '../types'
|
|
6
5
|
|
|
7
|
-
type
|
|
8
|
-
type Connect = CT<
|
|
6
|
+
type S = { value: number }
|
|
7
|
+
type Connect = CT<S>
|
|
9
8
|
|
|
10
9
|
const {
|
|
11
10
|
createStore,
|
|
12
11
|
connect,
|
|
13
12
|
dispatch,
|
|
14
13
|
getStore,
|
|
15
|
-
} = new
|
|
14
|
+
} = new Store<S>()
|
|
16
15
|
|
|
17
16
|
createStore({ value: 0 })
|
|
18
17
|
|
package/src/entry/container.tsx
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { Component, ComponentType } from 'react'
|
|
2
|
-
import { Route } from '
|
|
3
|
-
import { ContainerProps } from '@variousjs/various'
|
|
2
|
+
import { ContainerProps, Router, Route } from '@variousjs/various'
|
|
4
3
|
import { Radio, Badge, Button } from 'antd'
|
|
5
4
|
import { Store, Config } from '../types'
|
|
6
5
|
import csses from './entry.less'
|
|
@@ -20,7 +19,7 @@ class Container extends Component<ContainerProps<Store, Config>> {
|
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
render() {
|
|
23
|
-
const {
|
|
22
|
+
const { $component, $config, $store } = this.props
|
|
24
23
|
|
|
25
24
|
return (
|
|
26
25
|
<div className={csses.container}>
|
package/webpack.base.config.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
const path = require('path')
|
|
2
2
|
|
|
3
|
-
const { NODE_ENV = 'development' } = process.env
|
|
4
|
-
|
|
5
3
|
const config = {
|
|
4
|
+
stats: 'minimal',
|
|
6
5
|
entry: {
|
|
7
6
|
entry: path.join(__dirname, './src/entry'),
|
|
8
7
|
|
|
@@ -27,13 +26,9 @@ const config = {
|
|
|
27
26
|
root: 'ReactDOM',
|
|
28
27
|
amd: 'react-dom',
|
|
29
28
|
},
|
|
30
|
-
'
|
|
31
|
-
root: '
|
|
32
|
-
amd: '
|
|
33
|
-
},
|
|
34
|
-
nycticorax: {
|
|
35
|
-
root: 'Nycticorax',
|
|
36
|
-
amd: 'nycticorax',
|
|
29
|
+
'@variousjs/various': {
|
|
30
|
+
root: 'various',
|
|
31
|
+
amd: '@variousjs/various',
|
|
37
32
|
},
|
|
38
33
|
|
|
39
34
|
// 自定义
|
|
@@ -42,7 +37,7 @@ const config = {
|
|
|
42
37
|
amd: 'antd',
|
|
43
38
|
},
|
|
44
39
|
},
|
|
45
|
-
mode:
|
|
40
|
+
mode: 'production',
|
|
46
41
|
devtool: 'source-map',
|
|
47
42
|
resolve: {
|
|
48
43
|
// 必须加上 .js,不然 webpack dev server 会报错找不到模块
|