@variousjs/create 0.3.0 → 0.3.1

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 CHANGED
@@ -1,5 +1,6 @@
1
1
  const fs = require('fs')
2
2
  const package = require('../package.json')
3
+ const packageLock = require('../package-lock.json')
3
4
 
4
5
  const files = ['.gitignore', 'package-lock.json', 'package.json']
5
6
 
@@ -7,6 +8,9 @@ package.name = 'variousjs'
7
8
  package.version = '0.1.0'
8
9
  package.private = true
9
10
 
11
+ packageLock.name = 'variousjs'
12
+ packageLock.version = '0.1.0'
13
+
10
14
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
11
15
  const { prepublishOnly, ...rest } = package.scripts
12
16
  package.scripts = rest
@@ -19,12 +23,13 @@ delete package.bugs
19
23
  delete package.homepage
20
24
 
21
25
  fs.writeFileSync('package.json.copy', JSON.stringify(package, null, 2))
26
+ fs.writeFileSync('package-lock.json.copy', JSON.stringify(packageLock, null, 2))
22
27
 
23
28
  files.forEach((name) => {
24
29
  const copyName = `${name}.copy`
25
30
 
26
31
  try {
27
- if (name !== 'package.json') {
32
+ if (name !== 'package.json' && name !== 'package-lock.json') {
28
33
  fs.copyFileSync(name, copyName, fs.constants.COPYFILE_FICLONE)
29
34
  }
30
35
  } catch (e) {
package/demo/index.html CHANGED
@@ -4,13 +4,8 @@
4
4
  <meta charset="UTF-8" />
5
5
  <title> VariousJS </title>
6
6
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/antd@4.16.13/dist/antd.compact.min.css" />
7
- </head>
8
- <body>
9
- <div id="root"></div>
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@0.3.0/dist/index.js"></script>
12
7
  <script>
13
- var config = {
8
+ var VARIOUS_CONFIG = {
14
9
  root: '#root',
15
10
  entry: './dist/entry.js',
16
11
  routerMode: 'hash',
@@ -55,16 +50,11 @@ var config = {
55
50
  },
56
51
  ],
57
52
  }
58
-
59
- var various = new window.Various(config)
60
-
61
- various.onError = function(e) {
62
- console.log(e)
63
- document.write(e.message)
64
- }
65
-
66
- various.start()
67
53
  </script>
68
-
54
+ </head>
55
+ <body>
56
+ <div id="root"></div>
57
+ <script src="https://cdn.jsdelivr.net/npm/requirejs@2.3.6/require.js"></script>
58
+ <script src="https://cdn.jsdelivr.net/npm/@variousjs/various@0.4.0/dist/index.js"></script>
69
59
  </body>
70
60
  </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@variousjs/create",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "VariousJS boilerplate",
5
5
  "bin": "bin/create.js",
6
6
  "publishConfig": {
@@ -8,8 +8,8 @@
8
8
  },
9
9
  "scripts": {
10
10
  "lint": "tsc --noemit && eslint . --ext .ts,.tsx,.js",
11
- "start": "webpack --progress --config webpack.component.config.js & webpack serve --config webpack.entry.config.js --progress",
12
- "build": "webpack --progress --config webpack.base.config.js",
11
+ "start": "webpack --progress --config ./webpack/component.js & webpack serve --config ./webpack/entry.js --progress",
12
+ "build": "webpack --progress --config ./webpack/base.js",
13
13
  "prepublishOnly": "node bin/copy.js"
14
14
  },
15
15
  "repository": {
@@ -36,7 +36,7 @@
36
36
  "@types/react-router-dom": "^5.3.1",
37
37
  "@typescript-eslint/eslint-plugin": "^4.31.2",
38
38
  "@typescript-eslint/parser": "^4.31.2",
39
- "@variousjs/various": "^0.3.0",
39
+ "@variousjs/various": "^0.4.0",
40
40
  "babel-loader": "^8.2.2",
41
41
  "css-loader": "^6.3.0",
42
42
  "eslint": "^7.32.0",
@@ -3,14 +3,14 @@ const path = require('path')
3
3
  const config = {
4
4
  stats: 'minimal',
5
5
  entry: {
6
- entry: path.join(__dirname, './src/entry'),
6
+ entry: path.join(__dirname, '../src/entry'),
7
7
 
8
8
  // 组件入口定义
9
- card: path.join(__dirname, './src/components/card.tsx'),
10
- next: path.join(__dirname, './src/components/next.tsx'),
9
+ card: path.join(__dirname, '../src/components/card.tsx'),
10
+ next: path.join(__dirname, '../src/components/next.tsx'),
11
11
  },
12
12
  output: {
13
- path: path.resolve(__dirname, './demo/dist'),
13
+ path: path.resolve(__dirname, '../demo/dist'),
14
14
  publicPath: '/dist/',
15
15
  filename: '[name].js',
16
16
  libraryTarget: 'amd',
@@ -49,7 +49,7 @@ const config = {
49
49
  host: '0.0.0.0',
50
50
  https: true,
51
51
  static: {
52
- directory: path.join(__dirname, './demo'),
52
+ directory: path.join(__dirname, '../demo'),
53
53
  },
54
54
  // 监听文件构建后重新刷新页面,包括 html 文件
55
55
  watchFiles: ['demo'],
@@ -1,4 +1,4 @@
1
- const base = require('./webpack.base.config')
1
+ const base = require('./base')
2
2
 
3
3
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
4
4
  const { entry, ...rest } = base.entry
@@ -1,4 +1,4 @@
1
- const base = require('./webpack.base.config')
1
+ const base = require('./base')
2
2
 
3
3
  const { entry } = base.entry
4
4
  const config = {
package/.gitignore.copy DELETED
@@ -1,3 +0,0 @@
1
- .DS_Store
2
- node_modules/
3
- *.copy