svelte-reflector 1.0.0 → 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/dist/cli.js +10 -9
- package/dist/generate-doc.d.ts +1 -1
- package/dist/generate-doc.js +4 -3
- package/dist/main.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { reflector } from "./generate-doc.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
3
|
+
// (async () => {
|
|
4
|
+
// try {
|
|
5
|
+
// console.log("[reflector] Finalizado com sucesso.");
|
|
6
|
+
// process.exit(0);
|
|
7
|
+
// } catch (err) {
|
|
8
|
+
// console.error("[reflector] Falha:", err instanceof Error ? err.message : err);
|
|
9
|
+
// process.exit(1);
|
|
10
|
+
// }
|
|
11
|
+
// })();
|
|
12
|
+
await reflector(true);
|
package/dist/generate-doc.d.ts
CHANGED
package/dist/generate-doc.js
CHANGED
|
@@ -33,9 +33,10 @@ function getParams() {
|
|
|
33
33
|
console.warn("[reflector] Ambiente não-DEV: os schemas serão atualizados automaticamente.");
|
|
34
34
|
return { BACKEND_URL, ENVIRONMENT };
|
|
35
35
|
}
|
|
36
|
-
export async function reflector() {
|
|
36
|
+
export async function reflector(manual = false) {
|
|
37
37
|
const { BACKEND_URL, ENVIRONMENT } = getParams();
|
|
38
|
-
|
|
38
|
+
console.warn("opa");
|
|
39
|
+
if (ENVIRONMENT === "DEV" && !manual) {
|
|
39
40
|
console.warn("[reflector] Ambiente DEV: para regerar os schemas manualmente, use: npx reflect");
|
|
40
41
|
return breakReflector();
|
|
41
42
|
}
|
|
@@ -47,7 +48,7 @@ export async function reflector() {
|
|
|
47
48
|
}
|
|
48
49
|
catch (e) {
|
|
49
50
|
console.warn(`[reflector] Não foi possível obter a documentação em ${DOC_URL}. Carregando cópia local...`);
|
|
50
|
-
const backupPath = path.resolve(process.cwd(), "src/
|
|
51
|
+
const backupPath = path.resolve(process.cwd(), "src/reflector/backup.json");
|
|
51
52
|
data = JSON.parse(fs.readFileSync(backupPath, "utf8"));
|
|
52
53
|
}
|
|
53
54
|
const { components, paths } = data;
|
package/dist/main.js
CHANGED
|
@@ -7,7 +7,7 @@ import { Module } from "./module.js";
|
|
|
7
7
|
export class Reflector {
|
|
8
8
|
components;
|
|
9
9
|
paths;
|
|
10
|
-
dir = "src
|
|
10
|
+
dir = "src";
|
|
11
11
|
generatedDir = `${this.dir}/reflector`;
|
|
12
12
|
localDoc = new Source({ path: path.resolve(process.cwd(), `${this.dir}/backup.json`) });
|
|
13
13
|
src = new Source({ path: path.resolve(process.cwd(), this.generatedDir) });
|