@certd/plugin-cert 1.27.1 → 1.27.2

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.
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.aliyunSecret = void 0;
4
+ exports.aliyunSecret = {
5
+ accessKeyId: "LTAIvaYblBnrs6s8",
6
+ accessKeySecret: "pCIBgpAusvc4y2zeenNEORtnQ5hCVH",
7
+ };
@@ -0,0 +1,4 @@
1
+ export const aliyunSecret = {
2
+ accessKeyId: "LTAIvaYblBnrs6s8",
3
+ accessKeySecret: "pCIBgpAusvc4y2zeenNEORtnQ5hCVH",
4
+ };
package/tsconfig.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "typeRoots": [ "./typings", "./node_modules/@types"],
19
19
  "outDir": "dist",
20
20
  "rootDir": "src",
21
- "composite": true,
21
+ "composite": false,
22
22
  "useDefineForClassFields": true,
23
23
  "strict": false,
24
24
  // "sourceMap": true,
@@ -1,96 +0,0 @@
1
- import * as fs from "fs";
2
- import * as path from "path";
3
-
4
- // https://gist.github.com/lovasoa/8691344
5
- async function* walk(dir) {
6
- for await (const d of await fs.promises.opendir(dir)) {
7
- const entry = path.join(dir, d.name);
8
- if (d.isDirectory()) {
9
- yield* walk(entry);
10
- } else if (d.isFile()) {
11
- yield entry;
12
- }
13
- }
14
- }
15
-
16
- function resolveImportPath(sourceFile, importPath, options) {
17
- const sourceFileAbs = path.resolve(process.cwd(), sourceFile);
18
- const root = path.dirname(sourceFileAbs);
19
- const { moduleFilter = defaultModuleFilter } = options;
20
-
21
- if (moduleFilter(importPath)) {
22
- const importPathAbs = path.resolve(root, importPath);
23
- let possiblePath = [path.resolve(importPathAbs, "./index.ts"), path.resolve(importPathAbs, "./index.js"), importPathAbs + ".ts", importPathAbs + ".js"];
24
-
25
- if (possiblePath.length) {
26
- for (let i = 0; i < possiblePath.length; i++) {
27
- let entry = possiblePath[i];
28
- if (fs.existsSync(entry)) {
29
- const resolved = path.relative(root, entry.replace(/\.ts$/, ".js"));
30
-
31
- if (!resolved.startsWith(".")) {
32
- return "./" + resolved;
33
- }
34
-
35
- return resolved;
36
- }
37
- }
38
- }
39
- }
40
-
41
- return null;
42
- }
43
-
44
- function replace(filePath, outFilePath, options) {
45
- const code = fs.readFileSync(filePath).toString();
46
- const newCode = code.replace(/(import|export) (.+?) from ('[^\n']+'|"[^\n"]+");/gs, function (found, action, imported, from) {
47
- const importPath = from.slice(1, -1);
48
- let resolvedPath = resolveImportPath(filePath, importPath, options);
49
-
50
- if (resolvedPath) {
51
- resolvedPath = resolvedPath.replaceAll("\\", "/");
52
- console.log("\t", importPath, resolvedPath);
53
- return `${action} ${imported} from "${resolvedPath}";`;
54
- }
55
-
56
- return found;
57
- });
58
-
59
- if (code !== newCode) {
60
- fs.writeFileSync(outFilePath, newCode);
61
- }
62
- }
63
-
64
- // Then, use it with a simple async for loop
65
- async function run(srcDir, options = defaultOptions) {
66
- const { sourceFileFilter = defaultSourceFileFilter } = options;
67
-
68
- for await (const entry of walk(srcDir)) {
69
- if (sourceFileFilter(entry)) {
70
- console.log(entry);
71
- replace(entry, entry, options);
72
- }
73
- }
74
- }
75
-
76
- const defaultSourceFileFilter = function (sourceFilePath) {
77
- return /\.(js|ts)$/.test(sourceFilePath) && !/node_modules/.test(sourceFilePath);
78
- };
79
-
80
- const defaultModuleFilter = function (importedModule) {
81
- return !path.isAbsolute(importedModule) && !importedModule.startsWith("@") && !importedModule.endsWith(".js");
82
- };
83
-
84
- const defaultOptions = {
85
- sourceFileFilter: defaultSourceFileFilter,
86
- moduleFilter: defaultModuleFilter,
87
- };
88
-
89
- // Switch this to test on one file or directly run on a directory.
90
- const DEBUG = false;
91
-
92
- if (DEBUG) {
93
- replace("./src/index.ts", "./out.ts", defaultOptions);
94
- } else {
95
- await run("./src/", defaultOptions);
96
- }
package/rollup.config.js DELETED
@@ -1,43 +0,0 @@
1
- const resolve = require("@rollup/plugin-node-resolve");
2
- const commonjs = require("@rollup/plugin-commonjs");
3
- //const Typescript = require("rollup-plugin-typescript2");
4
- const Typescript = require("@rollup/plugin-typescript");
5
- const json = require("@rollup/plugin-json");
6
- const terser = require("@rollup/plugin-terser");
7
- module.exports = {
8
- input: "src/index.ts",
9
- output: {
10
- file: "dist/bundle.js",
11
- format: "cjs",
12
- },
13
- plugins: [
14
- // 解析第三方依赖
15
- resolve(),
16
- // 识别 commonjs 模式第三方依赖
17
- commonjs(),
18
- Typescript({
19
- target: "esnext",
20
- rootDir: "src",
21
- declaration: true,
22
- declarationDir: "dist/d",
23
- exclude: ["./node_modules/**", "./src/**/*.vue"],
24
- allowSyntheticDefaultImports: true,
25
- }),
26
- json(),
27
- terser(),
28
- ],
29
- external: [
30
- "vue",
31
- "lodash-es",
32
- "dayjs",
33
- "@certd/acme-client",
34
- "@certd/pipeline",
35
- "@certd/plugin-cert",
36
- "@certd/plugin-aliyun",
37
- "@certd/plugin-tencent",
38
- "@certd/plugin-huawei",
39
- "@certd/plugin-host",
40
- "@certd/plugin-tencent",
41
- "@certd/plugin-util",
42
- ],
43
- };