deeke-script-app 1.0.7 → 1.0.9

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 CHANGED
@@ -8,28 +8,24 @@
8
8
 
9
9
  ## 使用步骤
10
10
 
11
- ### 1. 安装node.js
12
- > https://nodejs.org/zh-cn/download/
13
11
 
14
- ### 2.安装git
15
- > https://git-scm.com/downloads
12
+ ### 安装前准备
13
+ > 请移步到<a target="_blank" href="https://doc.deeke.cn">https://doc.deeke.cn</a> 或者 <a target="_blank" href="https://deekescript.github.io/">https://deekescript.github.io/</a>
14
+ >
15
+ > 阅读上述文档内容,并且安装相关软件和依赖
16
16
 
17
- ### 3. 安装vscode
18
- > https://code.visualstudio.com/download
17
+ ### 安装方式一:npm安装方式【推荐】
18
+ > 步骤一:创建文件夹
19
+ > 步骤二:执行下面的脚本
20
+ ```npm i deeke-script-app```
19
21
 
20
- ### 4.使用git拉取本仓库代码到本地
22
+ ### 安装方式二:git&npm安装方式
21
23
  > git clone https://github.com/DeekeScript/deekeScript.git ./
22
-
23
- ### 5.安装依赖
24
24
  > npm install
25
25
 
26
- ### 6.编写代码
26
+ ### 编写代码
27
27
  > 请在src下创建代码文件
28
28
 
29
- ### 7.安装DeekeScript插件,并代码调试
30
- > 请移步到<a target="_blank" href="https://doc.deeke.cn">https://doc.deeke.cn</a> 或者 <a target="_blank" href="https://deekescript.github.io/">https://deekescript.github.io/</a>
31
29
 
32
30
  ## Tips 📢
33
31
  > 文件夹@deekeScript请不要删除,此代码会提供代码提示能力~
34
-
35
- > 项目的node_modules文件夹不见了?请打开.vscode/setting.json注释掉隐藏代码即可~
package/init CHANGED
@@ -3,11 +3,9 @@ const fs = require('fs');
3
3
  const path = require('path');
4
4
 
5
5
  function generateFiles(answers) {
6
- console.log(answers);
7
- const projectPath = process.cwd(); // 输出:/Users/username/project
6
+ const projectPath = path.dirname(path.dirname(__dirname)); // 输出:/Users/username/project
7
+ const files = fs.readdirSync(projectPath);
8
8
 
9
- const files = fs.readdirSync(projectPath)
10
- console.log(projectPath, __dirname, files);
11
9
  if (files.length > 3 || !files.includes('package.json') || !files.includes('package-lock.json') || !files.includes('node_modules')) {
12
10
  throw new Error('请清空当前文件夹,并重新运行命令');
13
11
  }
@@ -21,7 +19,7 @@ function generateFiles(answers) {
21
19
 
22
20
  filteredEntries.forEach(entry => {
23
21
  const srcPath = path.join(__dirname, entry.name);
24
- const destPath = path.join(process.cwd(), entry.name);
22
+ const destPath = path.join(projectPath, entry.name);
25
23
 
26
24
  if (entry.isFile()) {
27
25
  fs.copyFileSync(srcPath, destPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deeke-script-app",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "DeekeScript应用",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
package/src/task/code.js CHANGED
@@ -1,4 +1,4 @@
1
1
 
2
2
 
3
3
  let b = new UiSelector();
4
- b.myCustomMethod($1);
4
+ b.myCustomMethod($1);