create-pnpm-cli 0.0.11 → 0.0.12
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/lib/cli.cjs +62 -8
- package/package.json +7 -7
- package/template/pnpm-monorepo-typescript/README.md +0 -1
- package/template/pnpm-monorepo-typescript/apps/examples/package.json +0 -10
- package/template/pnpm-monorepo-typescript/apps/examples/tsconfig.json +0 -12
- package/template/pnpm-monorepo-typescript/package.json +0 -15
- package/template/pnpm-monorepo-typescript/packages/name/bin/index.js +0 -3
- package/template/pnpm-monorepo-typescript/packages/name/package.json +0 -15
- package/template/pnpm-monorepo-typescript/packages/name/tsconfig.json +0 -12
- package/template/pnpm-monorepo-typescript/pnpm-workspace.yaml +0 -3
- package/template/pnpm-monorepo-typescript/prettier.config.cjs +0 -10
- package/template/webpack-typescript-react/.env.development +0 -1
- package/template/webpack-typescript-react/.env.production +0 -1
- package/template/webpack-typescript-react/.eslintrc.js +0 -36
- package/template/webpack-typescript-react/README.md +0 -1
- package/template/webpack-typescript-react/babel.config.js +0 -38
- package/template/webpack-typescript-react/package.json +0 -63
- package/template/webpack-typescript-react/postcss.config.js +0 -13
- package/template/webpack-typescript-react/prettier.config.js +0 -8
- package/template/webpack-typescript-react/public/img/img1.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img10.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img11.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img12.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img13.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img14.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img15.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img16.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img17.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img18.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img19.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img2.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img20.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img21.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img22.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img23.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img24.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img25.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img26.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img27.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img28.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img29.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img3.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img30.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img31.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img32.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img33.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img34.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img35.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img36.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img37.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img38.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img4.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img5.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img6.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img7.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img8.jpg +0 -0
- package/template/webpack-typescript-react/public/img/img9.jpg +0 -0
- package/template/webpack-typescript-react/scripts/data.js +0 -60
- package/template/webpack-typescript-react/src/config/data.ts +0 -197
- package/template/webpack-typescript-react/src/config/index.ts +0 -1
- package/template/webpack-typescript-react/src/hooks/useImagesViewer.ts +0 -80
- package/template/webpack-typescript-react/src/hooks/useWindowWidth.ts +0 -24
- package/template/webpack-typescript-react/src/index.tsx +0 -19
- package/template/webpack-typescript-react/src/layouts/MainLayout.tsx +0 -9
- package/template/webpack-typescript-react/src/layouts/index.ts +0 -1
- package/template/webpack-typescript-react/src/pages/home.tsx +0 -17
- package/template/webpack-typescript-react/src/pages/image.tsx +0 -24
- package/template/webpack-typescript-react/src/pages/masonry.tsx +0 -92
- package/template/webpack-typescript-react/src/pages/scroll-view.tsx +0 -36
- package/template/webpack-typescript-react/src/pages/virtual-list.tsx +0 -27
- package/template/webpack-typescript-react/src/routes/config.tsx +0 -39
- package/template/webpack-typescript-react/src/styles/global.css +0 -6
- package/template/webpack-typescript-react/src/templates/index.html +0 -12
- package/template/webpack-typescript-react/src/types/index.d.ts +0 -4
- package/template/webpack-typescript-react/src/utils/index.ts +0 -17
- package/template/webpack-typescript-react/tailwind.config.js +0 -8
- package/template/webpack-typescript-react/tsconfig.json +0 -21
- package/template/webpack-typescript-react/webpack.config.ts +0 -94
- package/template/zeropress-typescript/README.md +0 -11
- package/template/zeropress-typescript/docs/1./347/254/224/350/256/260/1./347/254/254/344/270/200/345/244/251/1./346/226/207/347/253/240.md +0 -5
- package/template/zeropress-typescript/docs/1./347/254/224/350/256/260/2./347/254/254/344/272/214/345/244/251/1./346/226/207/347/253/240.md +0 -3
- package/template/zeropress-typescript/docs/index.mdx +0 -3
- package/template/zeropress-typescript/package.json +0 -21
- package/template/zeropress-typescript/public/img/article.jpg +0 -0
- package/template/zeropress-typescript/public/logo.jpg +0 -0
- package/template/zeropress-typescript/tsconfig.json +0 -5
- package/template/zeropress-typescript/zeropress.config.ts +0 -22
package/lib/cli.cjs
CHANGED
|
@@ -35,12 +35,13 @@ __export(cli_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(cli_exports);
|
|
36
36
|
|
|
37
37
|
// package.json
|
|
38
|
-
var version = "0.0.
|
|
38
|
+
var version = "0.0.11";
|
|
39
39
|
|
|
40
40
|
// src/constants.ts
|
|
41
41
|
var import_path = __toESM(require("path"), 1);
|
|
42
|
-
var ROOT_PATH = import_path.default.join(__dirname, "..");
|
|
43
|
-
var TEMPLATE_PATH = import_path.default.join(ROOT_PATH, "
|
|
42
|
+
var ROOT_PATH = import_path.default.join(__dirname, "..", "..", "..");
|
|
43
|
+
var TEMPLATE_PATH = import_path.default.join(ROOT_PATH, "templates");
|
|
44
|
+
var TEMPLATE_REPO_URL = "https://github.com/houhongxu/create-pnpm-cli";
|
|
44
45
|
var PACKAGE_CHOICES = [
|
|
45
46
|
"prettier" /* prettier */
|
|
46
47
|
].map((item) => ({ name: item, value: item }));
|
|
@@ -52,19 +53,60 @@ var PACKAGE_MAP = {
|
|
|
52
53
|
};
|
|
53
54
|
|
|
54
55
|
// src/utils.ts
|
|
56
|
+
var import_child_process = require("child_process");
|
|
57
|
+
var import_fs_extra = __toESM(require("fs-extra"), 1);
|
|
58
|
+
var import_os = __toESM(require("os"), 1);
|
|
59
|
+
var import_path2 = __toESM(require("path"), 1);
|
|
55
60
|
var import_process = require("process");
|
|
56
61
|
function handleError(err, message) {
|
|
57
62
|
console.log(message + "\uFF1A", err);
|
|
58
63
|
(0, import_process.exit)(1);
|
|
59
64
|
}
|
|
65
|
+
function getTempDir() {
|
|
66
|
+
return import_path2.default.join(import_os.default.tmpdir(), "repositories");
|
|
67
|
+
}
|
|
68
|
+
function cloneRepository(repoUrl, targetPath) {
|
|
69
|
+
const gitRepoUrl = repoUrl.endsWith(".git") ? repoUrl : `${repoUrl}.git`;
|
|
70
|
+
(0, import_child_process.execSync)(
|
|
71
|
+
`git clone --depth 1 --branch main "${gitRepoUrl}" "${targetPath}"`,
|
|
72
|
+
{
|
|
73
|
+
stdio: "inherit"
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
async function fetchTemplateFromRepo(repoUrl, templateName) {
|
|
78
|
+
const tempDir = getTempDir();
|
|
79
|
+
const [gitRepoUrl] = repoUrl.split("#");
|
|
80
|
+
const repoTempPath = import_path2.default.join(
|
|
81
|
+
tempDir,
|
|
82
|
+
gitRepoUrl.split("/").pop()?.replace(".git", "") || "unknown"
|
|
83
|
+
);
|
|
84
|
+
const templateTempPath = import_path2.default.join(repoTempPath, "templates", templateName);
|
|
85
|
+
await import_fs_extra.default.ensureDir(tempDir);
|
|
86
|
+
if (await import_fs_extra.default.pathExists(repoTempPath)) {
|
|
87
|
+
await import_fs_extra.default.remove(repoTempPath);
|
|
88
|
+
}
|
|
89
|
+
try {
|
|
90
|
+
cloneRepository(gitRepoUrl, repoTempPath);
|
|
91
|
+
if (!await import_fs_extra.default.pathExists(templateTempPath)) {
|
|
92
|
+
throw new Error(
|
|
93
|
+
`\u6A21\u677F\u76EE\u5F55\u4E0D\u5B58\u5728: templates/${templateName}\uFF0C\u8BF7\u68C0\u67E5\u4ED3\u5E93\u4E2D\u662F\u5426\u5B58\u5728\u8BE5\u6A21\u677F`
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
return templateTempPath;
|
|
97
|
+
} catch (err) {
|
|
98
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
99
|
+
throw new Error(`\u4ECE\u4ED3\u5E93\u62C9\u53D6\u6A21\u677F\u5931\u8D25: ${repoUrl}\u3002\u9519\u8BEF\u4FE1\u606F: ${errorMessage}`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
60
102
|
|
|
61
103
|
// src/cli.ts
|
|
62
104
|
var import_prompts = require("@inquirer/prompts");
|
|
63
105
|
var import_commander = require("commander");
|
|
64
106
|
var import_fast_glob = __toESM(require("fast-glob"), 1);
|
|
65
|
-
var
|
|
107
|
+
var import_fs_extra2 = __toESM(require("fs-extra"), 1);
|
|
66
108
|
var import_package_manager_install = __toESM(require("package-manager-install"), 1);
|
|
67
|
-
var
|
|
109
|
+
var import_path3 = __toESM(require("path"), 1);
|
|
68
110
|
var cli = import_commander.program;
|
|
69
111
|
cli.name("create-pnpm-cli").version(version);
|
|
70
112
|
cli.command("create", { isDefault: true }).description("create pnpm cli").argument("[path]", "path to mkdir", "./").action(async (targetPath) => {
|
|
@@ -81,9 +123,21 @@ cli.command("create", { isDefault: true }).description("create pnpm cli").argume
|
|
|
81
123
|
message: "\u8BF7\u8F93\u5165\u5305\u540D",
|
|
82
124
|
default: template
|
|
83
125
|
});
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
126
|
+
console.log("\u6B63\u5728\u4ECE\u4ED3\u5E93\u62C9\u53D6\u6A21\u677F...");
|
|
127
|
+
let templateTempPath;
|
|
128
|
+
try {
|
|
129
|
+
templateTempPath = await fetchTemplateFromRepo(
|
|
130
|
+
TEMPLATE_REPO_URL,
|
|
131
|
+
template
|
|
132
|
+
);
|
|
133
|
+
} catch (err) {
|
|
134
|
+
handleError(err, "\u62C9\u53D6\u6A21\u677F\u5931\u8D25");
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const target = import_path3.default.join(targetPath, name);
|
|
138
|
+
await import_fs_extra2.default.ensureDir(target).catch((err) => handleError(err, "\u521B\u5EFA\u6587\u4EF6\u5939\u5931\u8D25"));
|
|
139
|
+
console.log("\u6B63\u5728\u62F7\u8D1D\u6587\u4EF6...");
|
|
140
|
+
await import_fs_extra2.default.copy(templateTempPath, target).catch((err) => handleError(err, "\u62F7\u8D1D\u6587\u4EF6\u9519\u8BEF"));
|
|
87
141
|
await (0, import_package_manager_install.default)({ cwd: target });
|
|
88
142
|
});
|
|
89
143
|
cli.parse();
|
package/package.json
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pnpm-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "create pnpm cli",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "tsup ./src/cli.ts --dts --clean --shims --format=cjs --platform=node --outDir=./lib --watch",
|
|
7
|
+
"build": "tsup ./src/cli.ts --dts --clean --shims --format=cjs --platform=node --outDir=./lib"
|
|
8
|
+
},
|
|
5
9
|
"type": "module",
|
|
6
10
|
"main": "./lib/cli.cjs",
|
|
7
11
|
"types": "./lib/cli.d.cts",
|
|
8
12
|
"bin": "./bin/index.js",
|
|
9
13
|
"files": [
|
|
10
14
|
"./lib",
|
|
11
|
-
"./bin"
|
|
12
|
-
"template"
|
|
15
|
+
"./bin"
|
|
13
16
|
],
|
|
14
17
|
"dependencies": {
|
|
15
18
|
"@inquirer/prompts": "^5.3.6",
|
|
@@ -24,8 +27,5 @@
|
|
|
24
27
|
},
|
|
25
28
|
"engines": {
|
|
26
29
|
"node": ">=18"
|
|
27
|
-
},
|
|
28
|
-
"scripts": {
|
|
29
|
-
"dev": "tsup ./src/cli.ts --dts --clean --shims --format=cjs --platform=node --outDir=./lib --watch"
|
|
30
30
|
}
|
|
31
|
-
}
|
|
31
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# README
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"scripts": {
|
|
3
|
-
"dev": "pnpm --recursive --parallel --filter=./packages/** dev",
|
|
4
|
-
"build": "pnpm --recursive --filter=./packages/** build"
|
|
5
|
-
},
|
|
6
|
-
"devDependencies": {
|
|
7
|
-
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
|
8
|
-
"@types/node": "^20.10.5",
|
|
9
|
-
"prettier": "^3.2.4",
|
|
10
|
-
"typescript": "^5.2.2"
|
|
11
|
-
},
|
|
12
|
-
"keywords": [],
|
|
13
|
-
"author": "",
|
|
14
|
-
"license": "ISC"
|
|
15
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "name",
|
|
3
|
-
"version": "0.0.1",
|
|
4
|
-
"description": "package",
|
|
5
|
-
"scripts": {},
|
|
6
|
-
"main": "./lib/index.js",
|
|
7
|
-
"types": "./lib/index.d.ts",
|
|
8
|
-
"bin": "./bin/index.js",
|
|
9
|
-
"files": [
|
|
10
|
-
"./lib",
|
|
11
|
-
"./bin"
|
|
12
|
-
],
|
|
13
|
-
"dependencies": {},
|
|
14
|
-
"devDependencies": {}
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
TEST='dev'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
TEST='prod'
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/** @type {import("eslint").Linter.Config} */
|
|
2
|
-
module.exports = {
|
|
3
|
-
env: {
|
|
4
|
-
browser: true,
|
|
5
|
-
es2021: true,
|
|
6
|
-
node: true,
|
|
7
|
-
},
|
|
8
|
-
extends: [
|
|
9
|
-
'eslint:recommended',
|
|
10
|
-
'plugin:@typescript-eslint/recommended',
|
|
11
|
-
'plugin:react/recommended',
|
|
12
|
-
'plugin:react/jsx-runtime',
|
|
13
|
-
'plugin:prettier/recommended',
|
|
14
|
-
],
|
|
15
|
-
parser: '@typescript-eslint/parser',
|
|
16
|
-
parserOptions: {
|
|
17
|
-
ecmaVersion: 'latest',
|
|
18
|
-
sourceType: 'module',
|
|
19
|
-
ecmaFeatures: {
|
|
20
|
-
jsx: true,
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
settings: {
|
|
24
|
-
react: {
|
|
25
|
-
version: 'detect',
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
plugins: ['@typescript-eslint', 'react'],
|
|
29
|
-
rules: {
|
|
30
|
-
'@typescript-eslint/no-var-requires': 'off',
|
|
31
|
-
'@typescript-eslint/no-unused-vars': 'warn',
|
|
32
|
-
'@typescript-eslint/no-explicit-any': 'warn',
|
|
33
|
-
'react/display-name': 'off',
|
|
34
|
-
'react/prop-types': 'off',
|
|
35
|
-
},
|
|
36
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# README
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
const isDevelopment = process.env.NODE_ENV !== 'production'
|
|
2
|
-
|
|
3
|
-
/** @type {import('@types/babel__core').TransformOptions} */
|
|
4
|
-
module.exports = {
|
|
5
|
-
// 执行顺序由右往左
|
|
6
|
-
presets: [
|
|
7
|
-
[
|
|
8
|
-
'@babel/preset-react',
|
|
9
|
-
{
|
|
10
|
-
// react18可以自动导入react
|
|
11
|
-
runtime: 'automatic',
|
|
12
|
-
// 区分开发与生产
|
|
13
|
-
development: isDevelopment,
|
|
14
|
-
},
|
|
15
|
-
],
|
|
16
|
-
[
|
|
17
|
-
'@babel/preset-env',
|
|
18
|
-
{
|
|
19
|
-
// TODO 启用将某些浏览器的bug转译为ES5,babel8之后会默认开启,记得改
|
|
20
|
-
bugfixes: true,
|
|
21
|
-
useBuiltIns: 'entry',
|
|
22
|
-
corejs: 3,
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
[
|
|
26
|
-
'@babel/preset-typescript',
|
|
27
|
-
{
|
|
28
|
-
// 允许命名空间
|
|
29
|
-
allowNamespaces: true,
|
|
30
|
-
// 允许声明字段
|
|
31
|
-
allowDeclareFields: true,
|
|
32
|
-
// 优化枚举为对象
|
|
33
|
-
optimizeConstEnums: true,
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
],
|
|
37
|
-
plugins: [isDevelopment && 'react-refresh/babel'].filter(Boolean),
|
|
38
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "micro-react",
|
|
3
|
-
"description": "",
|
|
4
|
-
"scripts": {
|
|
5
|
-
"lint": "eslint ./src/**/*.{ts,tsx}",
|
|
6
|
-
"dev": "cross-env NODE_ENV=development webpack serve",
|
|
7
|
-
"build": "cross-env NODE_ENV=production webpack",
|
|
8
|
-
"serve": "cross-env NODE_ENV=production webpack && npx serve ./dist"
|
|
9
|
-
},
|
|
10
|
-
"keywords": [],
|
|
11
|
-
"author": "",
|
|
12
|
-
"license": "ISC",
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"ahooks": "^3.7.10",
|
|
15
|
-
"high-order-ui": "^0.0.3",
|
|
16
|
-
"query-string": "^8.1.0",
|
|
17
|
-
"react": "^18.2.0",
|
|
18
|
-
"react-dom": "^18.2.0",
|
|
19
|
-
"react-router-dom": "^6.21.1",
|
|
20
|
-
"viewerjs": "^1.11.6"
|
|
21
|
-
},
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"prettier": "^3.2.4",
|
|
24
|
-
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
|
25
|
-
"cross-env": "^7.0.3",
|
|
26
|
-
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
|
|
27
|
-
"@types/react": "^18.2.48",
|
|
28
|
-
"@types/react-dom": "^18.2.18",
|
|
29
|
-
"@types/eslint": "^8.56.2",
|
|
30
|
-
"@types/node": "^20.10.5",
|
|
31
|
-
"blurhash-webpack-plugin": "^0.0.5",
|
|
32
|
-
"html-webpack-plugin": "^5.6.0",
|
|
33
|
-
"react-refresh": "^0.14.0",
|
|
34
|
-
"style-loader": "^3.3.4",
|
|
35
|
-
"webpack-dev-server": "^4.15.1",
|
|
36
|
-
"webpack": "^5.89.0",
|
|
37
|
-
"webpack-cli": "^5.1.4",
|
|
38
|
-
"thread-loader": "^4.0.2",
|
|
39
|
-
"ts-node": "^10.9.2",
|
|
40
|
-
"tsconfig-paths-webpack-plugin": "^4.1.0",
|
|
41
|
-
"mini-css-extract-plugin": "^2.7.7",
|
|
42
|
-
"postcss": "^8.4.33",
|
|
43
|
-
"postcss-load-config": "^5.0.2",
|
|
44
|
-
"postcss-loader": "^8.0.0",
|
|
45
|
-
"postcss-preset-env": "^9.3.0",
|
|
46
|
-
"css-loader": "^6.9.1",
|
|
47
|
-
"cssnano": "^6.0.3",
|
|
48
|
-
"babel-loader": "^9.1.3",
|
|
49
|
-
"@types/babel__core": "^7.20.5",
|
|
50
|
-
"@babel/core": "^7.23.7",
|
|
51
|
-
"@babel/preset-env": "^7.23.8",
|
|
52
|
-
"@babel/preset-react": "^7.23.3",
|
|
53
|
-
"@babel/preset-typescript": "^7.23.3",
|
|
54
|
-
"@typescript-eslint/eslint-plugin": "^6.19.0",
|
|
55
|
-
"@typescript-eslint/parser": "^6.19.0",
|
|
56
|
-
"eslint": "^8.56.0",
|
|
57
|
-
"eslint-config-prettier": "^9.1.0",
|
|
58
|
-
"eslint-plugin-prettier": "^5.1.3",
|
|
59
|
-
"eslint-plugin-react": "^7.33.2",
|
|
60
|
-
"tailwindcss": "^3.4.1",
|
|
61
|
-
"dotenv": "^16.3.2"
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const isDevelopment = process.env.NODE_ENV !== 'production'
|
|
2
|
-
|
|
3
|
-
/** @type {import('postcss-load-config').Config} */
|
|
4
|
-
module.exports = {
|
|
5
|
-
plugins: [
|
|
6
|
-
// tailwindcss
|
|
7
|
-
require('tailwindcss'),
|
|
8
|
-
// 会自动添加polyfill和前缀,功能比autoprefix更全
|
|
9
|
-
require('postcss-preset-env'),
|
|
10
|
-
// 生产环境压缩css
|
|
11
|
-
!isDevelopment && require('cssnano'),
|
|
12
|
-
].filter(Boolean),
|
|
13
|
-
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
function main() {
|
|
2
|
-
const data = []
|
|
3
|
-
let imports = ''
|
|
4
|
-
|
|
5
|
-
const arr = [
|
|
6
|
-
'今天在公园看到了儿童嬉戏,笑声洒满阳光。',
|
|
7
|
-
'漫步在街头,感受了都市的繁华与忙碌。',
|
|
8
|
-
'走进书店,被一本历史书籍深深吸引。',
|
|
9
|
-
'在咖啡馆看到了一对恋人的甜蜜。',
|
|
10
|
-
'去了海边,感受到了大海的浩渺与深邃。',
|
|
11
|
-
'在山顶看到了日出,被其壮观所震撼。',
|
|
12
|
-
'在夜市品尝了各种美食,感受到了人间烟火。',
|
|
13
|
-
'在画廊欣赏了一幅油画,被其色彩所吸引。',
|
|
14
|
-
'在博物馆看到了古代的文物,感受到了历史的厚重。',
|
|
15
|
-
'在花店看到了各种鲜花,被其美丽所吸引。',
|
|
16
|
-
'在街头看到了一只流浪猫,感到了生活的不易。',
|
|
17
|
-
'在电影院看了一部电影,被其剧情所吸引。',
|
|
18
|
-
'在湖边看到了天鹅的优雅,感受到了大自然的美丽。',
|
|
19
|
-
'在公园看到了一位老人的孤独,感到了生活的苍凉。',
|
|
20
|
-
'在动物园看到了各种动物,被其独特性格所吸引。',
|
|
21
|
-
'在超市看到了各种商品,感受到了生活的丰富。',
|
|
22
|
-
'在街头看到了一位街头艺人的表演,被其才华所吸引。',
|
|
23
|
-
'在图书馆看到了各种书籍,感受到了知识的深邃。',
|
|
24
|
-
'在体育场看到了一场篮球比赛,被其激烈所吸引。',
|
|
25
|
-
'在公园看到了春天的繁花,感受到了生命的活力。',
|
|
26
|
-
'在音乐会听到了美妙的旋律,被其魅力所吸引。',
|
|
27
|
-
'在街头看到了忙碌的人们,感受到了生活的节奏。',
|
|
28
|
-
'在公园看到了秋天的落叶,感受到了季节的变迁。',
|
|
29
|
-
'在游乐园看到了孩子们的快乐,感受到了童真的美好。',
|
|
30
|
-
'在山顶看到了星空,被其浩瀚所震撼。',
|
|
31
|
-
'在海边看到了日落,被其美丽所吸引。',
|
|
32
|
-
'在森林中看到了鸟儿的飞翔,感受到了自由的意义。',
|
|
33
|
-
'在湖边看到了鸭子的嬉戏,感受到了生活的乐趣。',
|
|
34
|
-
'在街头看到了夜晚的霓虹,感受到了城市的繁华。',
|
|
35
|
-
'在公园看到了雪景,被其纯净所吸引。',
|
|
36
|
-
'在图书馆看到了学生的努力,感受到了知识的力量。',
|
|
37
|
-
'在咖啡馆看到了一位写作者的专注,被其才华所吸引。',
|
|
38
|
-
'在公园看到了一位画家的创作,感受到了艺术的魅力。',
|
|
39
|
-
'在街头看到了一位老人的微笑,感受到了生活的温暖。',
|
|
40
|
-
'在电影院看到了一部经典电影,被其深度所吸引。',
|
|
41
|
-
'在超市看到了一位母亲的辛劳,感受到了母爱的伟大。',
|
|
42
|
-
'在公园看到了一位跑步的人,感受到了健康的重要。',
|
|
43
|
-
'在街头看到了一位警察的坚守,感受到了责任的重量。',
|
|
44
|
-
]
|
|
45
|
-
|
|
46
|
-
arr.forEach((v, i) => {
|
|
47
|
-
data.push({
|
|
48
|
-
_id: `${i + 1}`,
|
|
49
|
-
name: v,
|
|
50
|
-
imgs: [`img${i + 1}`],
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
imports += `import img${i + 1} from '../../public/img/img${i + 1}.jpg';`
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
console.log(data)
|
|
57
|
-
console.log(imports)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
main()
|