open-flun 1.0.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/CHANGELOG.md +4 -0
- package/LICENSE +5 -0
- package/README.md +16 -0
- package/copy-files.js +26 -0
- package/index.d.ts +42 -0
- package/index.js +14 -0
- package/package.json +20 -0
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
package/README.md
ADDED
package/copy-files.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const fs = require('fs'), path = require('path'),
|
|
2
|
+
|
|
3
|
+
// 要复制的文件位置和文件目标位置
|
|
4
|
+
packageDir = __dirname, targetDir = path.resolve(packageDir, '../..'), fileName = 'abc.js',
|
|
5
|
+
|
|
6
|
+
// 要拷贝的文件和目标文件路径
|
|
7
|
+
sourceFile = path.join(packageDir, fileName), targetFile = path.join(targetDir, fileName);
|
|
8
|
+
|
|
9
|
+
function copyFile() {
|
|
10
|
+
console.log(`🔍 检查 ${fileName} 文件...`), console.log(`📁 项目根目录:${targetDir}`);
|
|
11
|
+
try {
|
|
12
|
+
if (fs.existsSync(targetFile)) return true; // 如果目标文件存在,则返回true并结束函数
|
|
13
|
+
console.log(`⚠️ 在项目根目录未找到 ${fileName} 文件,正在创建...`);
|
|
14
|
+
|
|
15
|
+
fs.copyFileSync(sourceFile, targetFile); // 复制源文件到项目根目录
|
|
16
|
+
console.log(`✓ 已创建 ${fileName} 示例文件:${targetFile}`);
|
|
17
|
+
return true;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
console.error(`✗ 创建 ${fileName} 文件失败:`, error.message);
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// 执行脚本并导出函数
|
|
25
|
+
if (require.main === module) copyFile();
|
|
26
|
+
module.exports = { copyFile };
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// index.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Windows功能模块 主要功能:
|
|
4
|
+
* ```js
|
|
5
|
+
* class{}; // 类
|
|
6
|
+
* fun(); // 函数
|
|
7
|
+
* ```
|
|
8
|
+
* ---
|
|
9
|
+
* -
|
|
10
|
+
* ```js
|
|
11
|
+
* // 基础示例
|
|
12
|
+
* const { flun } = require('open-flun');
|
|
13
|
+
*
|
|
14
|
+
* ```
|
|
15
|
+
* -
|
|
16
|
+
*/
|
|
17
|
+
declare module 'open-flun' {
|
|
18
|
+
// import { xyz } from 'xyz';
|
|
19
|
+
|
|
20
|
+
// ============ 类 ============
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 占位类
|
|
24
|
+
* ```js
|
|
25
|
+
* // 配置示例
|
|
26
|
+
* const { abc } = require('open-flun');
|
|
27
|
+
*
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export class abc { }
|
|
31
|
+
|
|
32
|
+
// ============ 函数 ============
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 占位函数
|
|
36
|
+
* ```js
|
|
37
|
+
* const {fun} = require('open-flun');
|
|
38
|
+
*
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export function fun(): void;
|
|
42
|
+
}
|
package/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// 这是一个占位模块,用于保留 npm 包名 'open-flun'。
|
|
2
|
+
// 目前不提供任何实际功能。
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Flun 占位符模块
|
|
6
|
+
* @version 1.0.1
|
|
7
|
+
* @example
|
|
8
|
+
* const flun = require('open-flun');
|
|
9
|
+
* console.log(flun.message); // 输出: 'This is a placeholder package for open-flun.'
|
|
10
|
+
*/
|
|
11
|
+
module.exports = {
|
|
12
|
+
message: 'This is a placeholder package for open-flun.',
|
|
13
|
+
version: require('./package.json').version
|
|
14
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "open-flun",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [
|
|
10
|
+
"placeholder",
|
|
11
|
+
"reserved"
|
|
12
|
+
],
|
|
13
|
+
"author": "flun <cn@flun.top>",
|
|
14
|
+
"license": "ISC",
|
|
15
|
+
"type": "commonjs",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/flunGit/flun.git"
|
|
19
|
+
}
|
|
20
|
+
}
|