metadatafy 1.0.1 → 1.0.3
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/chunk-BT3J264A.cjs +2 -0
- package/dist/chunk-WUEHYY36.js +2 -0
- package/dist/cli.cjs +8 -1452
- package/dist/cli.js +8 -1424
- package/dist/index.cjs +1 -120
- package/dist/index.js +1 -3
- package/dist/next.cjs +3 -111
- package/dist/next.js +3 -86
- package/dist/vite.cjs +3 -91
- package/dist/vite.js +3 -66
- package/package.json +1 -1
- package/dist/chunk-ECKCIPM5.js +0 -1329
- package/dist/chunk-ECKCIPM5.js.map +0 -1
- package/dist/chunk-EDHWKZRG.cjs +0 -1384
- package/dist/chunk-EDHWKZRG.cjs.map +0 -1
- package/dist/cli.cjs.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/next.cjs.map +0 -1
- package/dist/next.js.map +0 -1
- package/dist/vite.cjs.map +0 -1
- package/dist/vite.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,120 +1 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkEDHWKZRG_cjs = require('./chunk-EDHWKZRG.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "ApiSender", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () { return chunkEDHWKZRG_cjs.ApiSender; }
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(exports, "CallGraphBuilder", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function () { return chunkEDHWKZRG_cjs.CallGraphBuilder; }
|
|
14
|
-
});
|
|
15
|
-
Object.defineProperty(exports, "DEFAULT_EXCLUDE_PATTERNS", {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
get: function () { return chunkEDHWKZRG_cjs.DEFAULT_EXCLUDE_PATTERNS; }
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports, "DEFAULT_FILE_TYPE_MAPPING", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function () { return chunkEDHWKZRG_cjs.DEFAULT_FILE_TYPE_MAPPING; }
|
|
22
|
-
});
|
|
23
|
-
Object.defineProperty(exports, "DEFAULT_INCLUDE_PATTERNS", {
|
|
24
|
-
enumerable: true,
|
|
25
|
-
get: function () { return chunkEDHWKZRG_cjs.DEFAULT_INCLUDE_PATTERNS; }
|
|
26
|
-
});
|
|
27
|
-
Object.defineProperty(exports, "DependencyResolver", {
|
|
28
|
-
enumerable: true,
|
|
29
|
-
get: function () { return chunkEDHWKZRG_cjs.DependencyResolver; }
|
|
30
|
-
});
|
|
31
|
-
Object.defineProperty(exports, "ExportExtractor", {
|
|
32
|
-
enumerable: true,
|
|
33
|
-
get: function () { return chunkEDHWKZRG_cjs.ExportExtractor; }
|
|
34
|
-
});
|
|
35
|
-
Object.defineProperty(exports, "FileWriter", {
|
|
36
|
-
enumerable: true,
|
|
37
|
-
get: function () { return chunkEDHWKZRG_cjs.FileWriter; }
|
|
38
|
-
});
|
|
39
|
-
Object.defineProperty(exports, "ImportExtractor", {
|
|
40
|
-
enumerable: true,
|
|
41
|
-
get: function () { return chunkEDHWKZRG_cjs.ImportExtractor; }
|
|
42
|
-
});
|
|
43
|
-
Object.defineProperty(exports, "KOREAN_KEYWORD_MAP", {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () { return chunkEDHWKZRG_cjs.KOREAN_KEYWORD_MAP; }
|
|
46
|
-
});
|
|
47
|
-
Object.defineProperty(exports, "KeywordExtractor", {
|
|
48
|
-
enumerable: true,
|
|
49
|
-
get: function () { return chunkEDHWKZRG_cjs.KeywordExtractor; }
|
|
50
|
-
});
|
|
51
|
-
Object.defineProperty(exports, "ProjectAnalyzer", {
|
|
52
|
-
enumerable: true,
|
|
53
|
-
get: function () { return chunkEDHWKZRG_cjs.ProjectAnalyzer; }
|
|
54
|
-
});
|
|
55
|
-
Object.defineProperty(exports, "PropsExtractor", {
|
|
56
|
-
enumerable: true,
|
|
57
|
-
get: function () { return chunkEDHWKZRG_cjs.PropsExtractor; }
|
|
58
|
-
});
|
|
59
|
-
Object.defineProperty(exports, "SQLParser", {
|
|
60
|
-
enumerable: true,
|
|
61
|
-
get: function () { return chunkEDHWKZRG_cjs.SQLParser; }
|
|
62
|
-
});
|
|
63
|
-
Object.defineProperty(exports, "SupabaseApiSender", {
|
|
64
|
-
enumerable: true,
|
|
65
|
-
get: function () { return chunkEDHWKZRG_cjs.SupabaseApiSender; }
|
|
66
|
-
});
|
|
67
|
-
Object.defineProperty(exports, "TypeScriptParser", {
|
|
68
|
-
enumerable: true,
|
|
69
|
-
get: function () { return chunkEDHWKZRG_cjs.TypeScriptParser; }
|
|
70
|
-
});
|
|
71
|
-
Object.defineProperty(exports, "createDefaultConfig", {
|
|
72
|
-
enumerable: true,
|
|
73
|
-
get: function () { return chunkEDHWKZRG_cjs.createDefaultConfig; }
|
|
74
|
-
});
|
|
75
|
-
Object.defineProperty(exports, "extendKoreanMap", {
|
|
76
|
-
enumerable: true,
|
|
77
|
-
get: function () { return chunkEDHWKZRG_cjs.extendKoreanMap; }
|
|
78
|
-
});
|
|
79
|
-
Object.defineProperty(exports, "extractAcronyms", {
|
|
80
|
-
enumerable: true,
|
|
81
|
-
get: function () { return chunkEDHWKZRG_cjs.extractAcronyms; }
|
|
82
|
-
});
|
|
83
|
-
Object.defineProperty(exports, "findKoreanKeywords", {
|
|
84
|
-
enumerable: true,
|
|
85
|
-
get: function () { return chunkEDHWKZRG_cjs.findKoreanKeywords; }
|
|
86
|
-
});
|
|
87
|
-
Object.defineProperty(exports, "generateId", {
|
|
88
|
-
enumerable: true,
|
|
89
|
-
get: function () { return chunkEDHWKZRG_cjs.generateId; }
|
|
90
|
-
});
|
|
91
|
-
Object.defineProperty(exports, "splitCamelCase", {
|
|
92
|
-
enumerable: true,
|
|
93
|
-
get: function () { return chunkEDHWKZRG_cjs.splitCamelCase; }
|
|
94
|
-
});
|
|
95
|
-
Object.defineProperty(exports, "splitIntoWords", {
|
|
96
|
-
enumerable: true,
|
|
97
|
-
get: function () { return chunkEDHWKZRG_cjs.splitIntoWords; }
|
|
98
|
-
});
|
|
99
|
-
Object.defineProperty(exports, "splitKebabCase", {
|
|
100
|
-
enumerable: true,
|
|
101
|
-
get: function () { return chunkEDHWKZRG_cjs.splitKebabCase; }
|
|
102
|
-
});
|
|
103
|
-
Object.defineProperty(exports, "splitPascalCase", {
|
|
104
|
-
enumerable: true,
|
|
105
|
-
get: function () { return chunkEDHWKZRG_cjs.splitPascalCase; }
|
|
106
|
-
});
|
|
107
|
-
Object.defineProperty(exports, "splitSnakeCase", {
|
|
108
|
-
enumerable: true,
|
|
109
|
-
get: function () { return chunkEDHWKZRG_cjs.splitSnakeCase; }
|
|
110
|
-
});
|
|
111
|
-
Object.defineProperty(exports, "toAllCases", {
|
|
112
|
-
enumerable: true,
|
|
113
|
-
get: function () { return chunkEDHWKZRG_cjs.toAllCases; }
|
|
114
|
-
});
|
|
115
|
-
Object.defineProperty(exports, "validateConfig", {
|
|
116
|
-
enumerable: true,
|
|
117
|
-
get: function () { return chunkEDHWKZRG_cjs.validateConfig; }
|
|
118
|
-
});
|
|
119
|
-
//# sourceMappingURL=index.cjs.map
|
|
120
|
-
//# sourceMappingURL=index.cjs.map
|
|
1
|
+
'use strict';var chunkBT3J264A_cjs=require('./chunk-BT3J264A.cjs');Object.defineProperty(exports,"ApiSender",{enumerable:true,get:function(){return chunkBT3J264A_cjs.A}});Object.defineProperty(exports,"CallGraphBuilder",{enumerable:true,get:function(){return chunkBT3J264A_cjs.w}});Object.defineProperty(exports,"DEFAULT_EXCLUDE_PATTERNS",{enumerable:true,get:function(){return chunkBT3J264A_cjs.c}});Object.defineProperty(exports,"DEFAULT_FILE_TYPE_MAPPING",{enumerable:true,get:function(){return chunkBT3J264A_cjs.a}});Object.defineProperty(exports,"DEFAULT_INCLUDE_PATTERNS",{enumerable:true,get:function(){return chunkBT3J264A_cjs.b}});Object.defineProperty(exports,"DependencyResolver",{enumerable:true,get:function(){return chunkBT3J264A_cjs.v}});Object.defineProperty(exports,"ExportExtractor",{enumerable:true,get:function(){return chunkBT3J264A_cjs.i}});Object.defineProperty(exports,"FileWriter",{enumerable:true,get:function(){return chunkBT3J264A_cjs.z}});Object.defineProperty(exports,"ImportExtractor",{enumerable:true,get:function(){return chunkBT3J264A_cjs.h}});Object.defineProperty(exports,"KOREAN_KEYWORD_MAP",{enumerable:true,get:function(){return chunkBT3J264A_cjs.r}});Object.defineProperty(exports,"KeywordExtractor",{enumerable:true,get:function(){return chunkBT3J264A_cjs.u}});Object.defineProperty(exports,"ProjectAnalyzer",{enumerable:true,get:function(){return chunkBT3J264A_cjs.y}});Object.defineProperty(exports,"PropsExtractor",{enumerable:true,get:function(){return chunkBT3J264A_cjs.j}});Object.defineProperty(exports,"SQLParser",{enumerable:true,get:function(){return chunkBT3J264A_cjs.g}});Object.defineProperty(exports,"SupabaseApiSender",{enumerable:true,get:function(){return chunkBT3J264A_cjs.B}});Object.defineProperty(exports,"TypeScriptParser",{enumerable:true,get:function(){return chunkBT3J264A_cjs.f}});Object.defineProperty(exports,"createDefaultConfig",{enumerable:true,get:function(){return chunkBT3J264A_cjs.d}});Object.defineProperty(exports,"extendKoreanMap",{enumerable:true,get:function(){return chunkBT3J264A_cjs.t}});Object.defineProperty(exports,"extractAcronyms",{enumerable:true,get:function(){return chunkBT3J264A_cjs.p}});Object.defineProperty(exports,"findKoreanKeywords",{enumerable:true,get:function(){return chunkBT3J264A_cjs.s}});Object.defineProperty(exports,"generateId",{enumerable:true,get:function(){return chunkBT3J264A_cjs.x}});Object.defineProperty(exports,"splitCamelCase",{enumerable:true,get:function(){return chunkBT3J264A_cjs.k}});Object.defineProperty(exports,"splitIntoWords",{enumerable:true,get:function(){return chunkBT3J264A_cjs.o}});Object.defineProperty(exports,"splitKebabCase",{enumerable:true,get:function(){return chunkBT3J264A_cjs.n}});Object.defineProperty(exports,"splitPascalCase",{enumerable:true,get:function(){return chunkBT3J264A_cjs.l}});Object.defineProperty(exports,"splitSnakeCase",{enumerable:true,get:function(){return chunkBT3J264A_cjs.m}});Object.defineProperty(exports,"toAllCases",{enumerable:true,get:function(){return chunkBT3J264A_cjs.q}});Object.defineProperty(exports,"validateConfig",{enumerable:true,get:function(){return chunkBT3J264A_cjs.e}});
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
3
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export{A as ApiSender,w as CallGraphBuilder,c as DEFAULT_EXCLUDE_PATTERNS,a as DEFAULT_FILE_TYPE_MAPPING,b as DEFAULT_INCLUDE_PATTERNS,v as DependencyResolver,i as ExportExtractor,z as FileWriter,h as ImportExtractor,r as KOREAN_KEYWORD_MAP,u as KeywordExtractor,y as ProjectAnalyzer,j as PropsExtractor,g as SQLParser,B as SupabaseApiSender,f as TypeScriptParser,d as createDefaultConfig,t as extendKoreanMap,p as extractAcronyms,s as findKoreanKeywords,x as generateId,k as splitCamelCase,o as splitIntoWords,n as splitKebabCase,l as splitPascalCase,m as splitSnakeCase,q as toAllCases,e as validateConfig}from'./chunk-WUEHYY36.js';
|
package/dist/next.cjs
CHANGED
|
@@ -1,111 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var chunkEDHWKZRG_cjs = require('./chunk-EDHWKZRG.cjs');
|
|
6
|
-
var path = require('path');
|
|
7
|
-
|
|
8
|
-
function _interopNamespace(e) {
|
|
9
|
-
if (e && e.__esModule) return e;
|
|
10
|
-
var n = Object.create(null);
|
|
11
|
-
if (e) {
|
|
12
|
-
Object.keys(e).forEach(function (k) {
|
|
13
|
-
if (k !== 'default') {
|
|
14
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
get: function () { return e[k]; }
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
n.default = e;
|
|
23
|
-
return Object.freeze(n);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
var path__namespace = /*#__PURE__*/_interopNamespace(path);
|
|
27
|
-
|
|
28
|
-
function withMetadata(options = {}) {
|
|
29
|
-
const pluginConfig = chunkEDHWKZRG_cjs.createDefaultConfig(options);
|
|
30
|
-
const runOn = options.runOn || "build";
|
|
31
|
-
const errors = chunkEDHWKZRG_cjs.validateConfig(pluginConfig);
|
|
32
|
-
if (errors.length > 0) {
|
|
33
|
-
throw new Error(
|
|
34
|
-
`[metadata-plugin] Invalid config:
|
|
35
|
-
${errors.join("\n")}`
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
return (nextConfig) => {
|
|
39
|
-
return {
|
|
40
|
-
...nextConfig,
|
|
41
|
-
webpack(config, context) {
|
|
42
|
-
const { dev, isServer } = context;
|
|
43
|
-
if (!isServer) {
|
|
44
|
-
return typeof nextConfig.webpack === "function" ? nextConfig.webpack(config, context) : config;
|
|
45
|
-
}
|
|
46
|
-
const shouldRun = runOn === "both" || runOn === "build" && !dev || runOn === "dev" && dev;
|
|
47
|
-
if (shouldRun) {
|
|
48
|
-
config.plugins = config.plugins || [];
|
|
49
|
-
config.plugins.push(new MetadataWebpackPlugin(pluginConfig));
|
|
50
|
-
}
|
|
51
|
-
if (typeof nextConfig.webpack === "function") {
|
|
52
|
-
return nextConfig.webpack(config, context);
|
|
53
|
-
}
|
|
54
|
-
return config;
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
var MetadataWebpackPlugin = class {
|
|
60
|
-
constructor(config) {
|
|
61
|
-
this.hasRun = false;
|
|
62
|
-
this.config = config;
|
|
63
|
-
}
|
|
64
|
-
apply(compiler) {
|
|
65
|
-
const pluginName = "MetadataWebpackPlugin";
|
|
66
|
-
compiler.hooks.beforeCompile.tapAsync(
|
|
67
|
-
pluginName,
|
|
68
|
-
async (_params, callback) => {
|
|
69
|
-
if (this.hasRun) {
|
|
70
|
-
return callback();
|
|
71
|
-
}
|
|
72
|
-
this.hasRun = true;
|
|
73
|
-
try {
|
|
74
|
-
await this.runAnalysis(compiler.context);
|
|
75
|
-
callback();
|
|
76
|
-
} catch (error) {
|
|
77
|
-
callback(error);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
);
|
|
81
|
-
compiler.hooks.watchRun.tap(pluginName, () => {
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
async runAnalysis(rootDir) {
|
|
85
|
-
const analyzer = new chunkEDHWKZRG_cjs.ProjectAnalyzer(this.config);
|
|
86
|
-
const fileWriter = new chunkEDHWKZRG_cjs.FileWriter(this.config);
|
|
87
|
-
const apiSender = this.config.output.api?.enabled ? new chunkEDHWKZRG_cjs.ApiSender(this.config) : null;
|
|
88
|
-
if (this.config.verbose) {
|
|
89
|
-
console.log("[metadata-plugin] Starting analysis...");
|
|
90
|
-
}
|
|
91
|
-
const result = await analyzer.analyze(rootDir);
|
|
92
|
-
if (this.config.output.file?.enabled) {
|
|
93
|
-
const outputPath = path__namespace.resolve(rootDir, this.config.output.file.path);
|
|
94
|
-
await fileWriter.write(result, outputPath);
|
|
95
|
-
if (this.config.verbose) {
|
|
96
|
-
console.log(`[metadata-plugin] Wrote metadata to ${outputPath}`);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
if (apiSender) {
|
|
100
|
-
await apiSender.send(result);
|
|
101
|
-
if (this.config.verbose) {
|
|
102
|
-
console.log("[metadata-plugin] Sent metadata to API");
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
exports.default = withMetadata;
|
|
109
|
-
exports.withMetadata = withMetadata;
|
|
110
|
-
//# sourceMappingURL=next.cjs.map
|
|
111
|
-
//# sourceMappingURL=next.cjs.map
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunkBT3J264A_cjs=require('./chunk-BT3J264A.cjs'),h=require('path');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var h__namespace=/*#__PURE__*/_interopNamespace(h);function m(r={}){let n=chunkBT3J264A_cjs.d(r),i=r.runOn||"build",a=chunkBT3J264A_cjs.e(n);if(a.length>0)throw new Error(`[metadata-plugin] Invalid config:
|
|
2
|
+
${a.join(`
|
|
3
|
+
`)}`);return t=>({...t,webpack(e,o){let{dev:p,isServer:d}=o;return d&&(i==="both"||i==="build"&&!p||i==="dev"&&p)&&(e.plugins=e.plugins||[],e.plugins.push(new s(n))),typeof t.webpack=="function"?t.webpack(e,o):e}})}var s=class{constructor(n){this.hasRun=false;this.config=n;}apply(n){let i="MetadataWebpackPlugin";n.hooks.beforeCompile.tapAsync(i,async(a,t)=>{if(this.hasRun)return t();this.hasRun=true;try{await this.runAnalysis(n.context),t();}catch(e){t(e);}}),n.hooks.watchRun.tap(i,()=>{});}async runAnalysis(n){let i=new chunkBT3J264A_cjs.y(this.config),a=new chunkBT3J264A_cjs.z(this.config),t=this.config.output.api?.enabled?new chunkBT3J264A_cjs.A(this.config):null;this.config.verbose&&console.log("[metadata-plugin] Starting analysis...");let e=await i.analyze(n);if(this.config.output.file?.enabled){let o=h__namespace.resolve(n,this.config.output.file.path);await a.write(e,o),this.config.verbose&&console.log(`[metadata-plugin] Wrote metadata to ${o}`);}t&&(await t.send(e),this.config.verbose&&console.log("[metadata-plugin] Sent metadata to API"));}};exports.default=m;exports.withMetadata=m;
|
package/dist/next.js
CHANGED
|
@@ -1,86 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function withMetadata(options = {}) {
|
|
5
|
-
const pluginConfig = createDefaultConfig(options);
|
|
6
|
-
const runOn = options.runOn || "build";
|
|
7
|
-
const errors = validateConfig(pluginConfig);
|
|
8
|
-
if (errors.length > 0) {
|
|
9
|
-
throw new Error(
|
|
10
|
-
`[metadata-plugin] Invalid config:
|
|
11
|
-
${errors.join("\n")}`
|
|
12
|
-
);
|
|
13
|
-
}
|
|
14
|
-
return (nextConfig) => {
|
|
15
|
-
return {
|
|
16
|
-
...nextConfig,
|
|
17
|
-
webpack(config, context) {
|
|
18
|
-
const { dev, isServer } = context;
|
|
19
|
-
if (!isServer) {
|
|
20
|
-
return typeof nextConfig.webpack === "function" ? nextConfig.webpack(config, context) : config;
|
|
21
|
-
}
|
|
22
|
-
const shouldRun = runOn === "both" || runOn === "build" && !dev || runOn === "dev" && dev;
|
|
23
|
-
if (shouldRun) {
|
|
24
|
-
config.plugins = config.plugins || [];
|
|
25
|
-
config.plugins.push(new MetadataWebpackPlugin(pluginConfig));
|
|
26
|
-
}
|
|
27
|
-
if (typeof nextConfig.webpack === "function") {
|
|
28
|
-
return nextConfig.webpack(config, context);
|
|
29
|
-
}
|
|
30
|
-
return config;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
var MetadataWebpackPlugin = class {
|
|
36
|
-
constructor(config) {
|
|
37
|
-
this.hasRun = false;
|
|
38
|
-
this.config = config;
|
|
39
|
-
}
|
|
40
|
-
apply(compiler) {
|
|
41
|
-
const pluginName = "MetadataWebpackPlugin";
|
|
42
|
-
compiler.hooks.beforeCompile.tapAsync(
|
|
43
|
-
pluginName,
|
|
44
|
-
async (_params, callback) => {
|
|
45
|
-
if (this.hasRun) {
|
|
46
|
-
return callback();
|
|
47
|
-
}
|
|
48
|
-
this.hasRun = true;
|
|
49
|
-
try {
|
|
50
|
-
await this.runAnalysis(compiler.context);
|
|
51
|
-
callback();
|
|
52
|
-
} catch (error) {
|
|
53
|
-
callback(error);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
);
|
|
57
|
-
compiler.hooks.watchRun.tap(pluginName, () => {
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
async runAnalysis(rootDir) {
|
|
61
|
-
const analyzer = new ProjectAnalyzer(this.config);
|
|
62
|
-
const fileWriter = new FileWriter(this.config);
|
|
63
|
-
const apiSender = this.config.output.api?.enabled ? new ApiSender(this.config) : null;
|
|
64
|
-
if (this.config.verbose) {
|
|
65
|
-
console.log("[metadata-plugin] Starting analysis...");
|
|
66
|
-
}
|
|
67
|
-
const result = await analyzer.analyze(rootDir);
|
|
68
|
-
if (this.config.output.file?.enabled) {
|
|
69
|
-
const outputPath = path.resolve(rootDir, this.config.output.file.path);
|
|
70
|
-
await fileWriter.write(result, outputPath);
|
|
71
|
-
if (this.config.verbose) {
|
|
72
|
-
console.log(`[metadata-plugin] Wrote metadata to ${outputPath}`);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
if (apiSender) {
|
|
76
|
-
await apiSender.send(result);
|
|
77
|
-
if (this.config.verbose) {
|
|
78
|
-
console.log("[metadata-plugin] Sent metadata to API");
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export { withMetadata as default, withMetadata };
|
|
85
|
-
//# sourceMappingURL=next.js.map
|
|
86
|
-
//# sourceMappingURL=next.js.map
|
|
1
|
+
import {d,e,y,z,A}from'./chunk-WUEHYY36.js';import*as h from'path';function m(r={}){let n=d(r),i=r.runOn||"build",a=e(n);if(a.length>0)throw new Error(`[metadata-plugin] Invalid config:
|
|
2
|
+
${a.join(`
|
|
3
|
+
`)}`);return t=>({...t,webpack(e,o){let{dev:p,isServer:d}=o;return d&&(i==="both"||i==="build"&&!p||i==="dev"&&p)&&(e.plugins=e.plugins||[],e.plugins.push(new s(n))),typeof t.webpack=="function"?t.webpack(e,o):e}})}var s=class{constructor(n){this.hasRun=false;this.config=n;}apply(n){let i="MetadataWebpackPlugin";n.hooks.beforeCompile.tapAsync(i,async(a,t)=>{if(this.hasRun)return t();this.hasRun=true;try{await this.runAnalysis(n.context),t();}catch(e){t(e);}}),n.hooks.watchRun.tap(i,()=>{});}async runAnalysis(n){let i=new y(this.config),a=new z(this.config),t=this.config.output.api?.enabled?new A(this.config):null;this.config.verbose&&console.log("[metadata-plugin] Starting analysis...");let e=await i.analyze(n);if(this.config.output.file?.enabled){let o=h.resolve(n,this.config.output.file.path);await a.write(e,o),this.config.verbose&&console.log(`[metadata-plugin] Wrote metadata to ${o}`);}t&&(await t.send(e),this.config.verbose&&console.log("[metadata-plugin] Sent metadata to API"));}};export{m as default,m as withMetadata};
|
package/dist/vite.cjs
CHANGED
|
@@ -1,91 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var chunkEDHWKZRG_cjs = require('./chunk-EDHWKZRG.cjs');
|
|
6
|
-
var path = require('path');
|
|
7
|
-
|
|
8
|
-
function _interopNamespace(e) {
|
|
9
|
-
if (e && e.__esModule) return e;
|
|
10
|
-
var n = Object.create(null);
|
|
11
|
-
if (e) {
|
|
12
|
-
Object.keys(e).forEach(function (k) {
|
|
13
|
-
if (k !== 'default') {
|
|
14
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
get: function () { return e[k]; }
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
n.default = e;
|
|
23
|
-
return Object.freeze(n);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
var path__namespace = /*#__PURE__*/_interopNamespace(path);
|
|
27
|
-
|
|
28
|
-
function metadataPlugin(options = {}) {
|
|
29
|
-
const config = chunkEDHWKZRG_cjs.createDefaultConfig(options);
|
|
30
|
-
const runOn = options.runOn || "build";
|
|
31
|
-
let viteConfig;
|
|
32
|
-
let analysisResult = null;
|
|
33
|
-
const analyzer = new chunkEDHWKZRG_cjs.ProjectAnalyzer(config);
|
|
34
|
-
const fileWriter = new chunkEDHWKZRG_cjs.FileWriter(config);
|
|
35
|
-
const apiSender = config.output.api?.enabled ? new chunkEDHWKZRG_cjs.ApiSender(config) : null;
|
|
36
|
-
return {
|
|
37
|
-
name: "vite-metadata-plugin",
|
|
38
|
-
configResolved(resolvedConfig) {
|
|
39
|
-
viteConfig = resolvedConfig;
|
|
40
|
-
const errors = chunkEDHWKZRG_cjs.validateConfig(config);
|
|
41
|
-
if (errors.length > 0) {
|
|
42
|
-
throw new Error(
|
|
43
|
-
`[metadata-plugin] Invalid config:
|
|
44
|
-
${errors.join("\n")}`
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
async buildStart() {
|
|
49
|
-
const shouldRun = runOn === "both" || runOn === "build" && viteConfig.command === "build" || runOn === "serve" && viteConfig.command === "serve";
|
|
50
|
-
if (!shouldRun) return;
|
|
51
|
-
const rootDir = viteConfig.root;
|
|
52
|
-
if (config.verbose) {
|
|
53
|
-
console.log("[metadata-plugin] Starting analysis...");
|
|
54
|
-
}
|
|
55
|
-
try {
|
|
56
|
-
analysisResult = await analyzer.analyze(rootDir);
|
|
57
|
-
if (config.output.file?.enabled) {
|
|
58
|
-
const outputPath = path__namespace.resolve(rootDir, config.output.file.path);
|
|
59
|
-
await fileWriter.write(analysisResult, outputPath);
|
|
60
|
-
if (config.verbose) {
|
|
61
|
-
console.log(`[metadata-plugin] Wrote metadata to ${outputPath}`);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
if (apiSender) {
|
|
65
|
-
await apiSender.send(analysisResult);
|
|
66
|
-
if (config.verbose) {
|
|
67
|
-
console.log("[metadata-plugin] Sent metadata to API");
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
} catch (error) {
|
|
71
|
-
console.error("[metadata-plugin] Analysis failed:", error);
|
|
72
|
-
if (viteConfig.command === "build") {
|
|
73
|
-
throw error;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
generateBundle() {
|
|
78
|
-
if (!analysisResult) return;
|
|
79
|
-
this.emitFile({
|
|
80
|
-
type: "asset",
|
|
81
|
-
fileName: "metadata-stats.json",
|
|
82
|
-
source: JSON.stringify(analysisResult.stats, null, 2)
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
exports.default = metadataPlugin;
|
|
89
|
-
exports.metadataPlugin = metadataPlugin;
|
|
90
|
-
//# sourceMappingURL=vite.cjs.map
|
|
91
|
-
//# sourceMappingURL=vite.cjs.map
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunkBT3J264A_cjs=require('./chunk-BT3J264A.cjs'),g=require('path');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var g__namespace=/*#__PURE__*/_interopNamespace(g);function c(r={}){let t=chunkBT3J264A_cjs.d(r),a=r.runOn||"build",e,n=null,y=new chunkBT3J264A_cjs.y(t),v=new chunkBT3J264A_cjs.z(t),l=t.output.api?.enabled?new chunkBT3J264A_cjs.A(t):null;return {name:"vite-metadata-plugin",configResolved(s){e=s;let o=chunkBT3J264A_cjs.e(t);if(o.length>0)throw new Error(`[metadata-plugin] Invalid config:
|
|
2
|
+
${o.join(`
|
|
3
|
+
`)}`)},async buildStart(){if(!(a==="both"||a==="build"&&e.command==="build"||a==="serve"&&e.command==="serve"))return;let o=e.root;t.verbose&&console.log("[metadata-plugin] Starting analysis...");try{if(n=await y.analyze(o),t.output.file?.enabled){let i=g__namespace.resolve(o,t.output.file.path);await v.write(n,i),t.verbose&&console.log(`[metadata-plugin] Wrote metadata to ${i}`);}l&&(await l.send(n),t.verbose&&console.log("[metadata-plugin] Sent metadata to API"));}catch(i){if(console.error("[metadata-plugin] Analysis failed:",i),e.command==="build")throw i}},generateBundle(){n&&this.emitFile({type:"asset",fileName:"metadata-stats.json",source:JSON.stringify(n.stats,null,2)});}}}exports.default=c;exports.metadataPlugin=c;
|
package/dist/vite.js
CHANGED
|
@@ -1,66 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function metadataPlugin(options = {}) {
|
|
5
|
-
const config = createDefaultConfig(options);
|
|
6
|
-
const runOn = options.runOn || "build";
|
|
7
|
-
let viteConfig;
|
|
8
|
-
let analysisResult = null;
|
|
9
|
-
const analyzer = new ProjectAnalyzer(config);
|
|
10
|
-
const fileWriter = new FileWriter(config);
|
|
11
|
-
const apiSender = config.output.api?.enabled ? new ApiSender(config) : null;
|
|
12
|
-
return {
|
|
13
|
-
name: "vite-metadata-plugin",
|
|
14
|
-
configResolved(resolvedConfig) {
|
|
15
|
-
viteConfig = resolvedConfig;
|
|
16
|
-
const errors = validateConfig(config);
|
|
17
|
-
if (errors.length > 0) {
|
|
18
|
-
throw new Error(
|
|
19
|
-
`[metadata-plugin] Invalid config:
|
|
20
|
-
${errors.join("\n")}`
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
async buildStart() {
|
|
25
|
-
const shouldRun = runOn === "both" || runOn === "build" && viteConfig.command === "build" || runOn === "serve" && viteConfig.command === "serve";
|
|
26
|
-
if (!shouldRun) return;
|
|
27
|
-
const rootDir = viteConfig.root;
|
|
28
|
-
if (config.verbose) {
|
|
29
|
-
console.log("[metadata-plugin] Starting analysis...");
|
|
30
|
-
}
|
|
31
|
-
try {
|
|
32
|
-
analysisResult = await analyzer.analyze(rootDir);
|
|
33
|
-
if (config.output.file?.enabled) {
|
|
34
|
-
const outputPath = path.resolve(rootDir, config.output.file.path);
|
|
35
|
-
await fileWriter.write(analysisResult, outputPath);
|
|
36
|
-
if (config.verbose) {
|
|
37
|
-
console.log(`[metadata-plugin] Wrote metadata to ${outputPath}`);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
if (apiSender) {
|
|
41
|
-
await apiSender.send(analysisResult);
|
|
42
|
-
if (config.verbose) {
|
|
43
|
-
console.log("[metadata-plugin] Sent metadata to API");
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
} catch (error) {
|
|
47
|
-
console.error("[metadata-plugin] Analysis failed:", error);
|
|
48
|
-
if (viteConfig.command === "build") {
|
|
49
|
-
throw error;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
generateBundle() {
|
|
54
|
-
if (!analysisResult) return;
|
|
55
|
-
this.emitFile({
|
|
56
|
-
type: "asset",
|
|
57
|
-
fileName: "metadata-stats.json",
|
|
58
|
-
source: JSON.stringify(analysisResult.stats, null, 2)
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export { metadataPlugin as default, metadataPlugin };
|
|
65
|
-
//# sourceMappingURL=vite.js.map
|
|
66
|
-
//# sourceMappingURL=vite.js.map
|
|
1
|
+
import {d,y,z,A,e}from'./chunk-WUEHYY36.js';import*as g from'path';function c(r={}){let t=d(r),a=r.runOn||"build",e$1,n=null,y$1=new y(t),v=new z(t),l=t.output.api?.enabled?new A(t):null;return {name:"vite-metadata-plugin",configResolved(s){e$1=s;let o=e(t);if(o.length>0)throw new Error(`[metadata-plugin] Invalid config:
|
|
2
|
+
${o.join(`
|
|
3
|
+
`)}`)},async buildStart(){if(!(a==="both"||a==="build"&&e$1.command==="build"||a==="serve"&&e$1.command==="serve"))return;let o=e$1.root;t.verbose&&console.log("[metadata-plugin] Starting analysis...");try{if(n=await y$1.analyze(o),t.output.file?.enabled){let i=g.resolve(o,t.output.file.path);await v.write(n,i),t.verbose&&console.log(`[metadata-plugin] Wrote metadata to ${i}`);}l&&(await l.send(n),t.verbose&&console.log("[metadata-plugin] Sent metadata to API"));}catch(i){if(console.error("[metadata-plugin] Analysis failed:",i),e$1.command==="build")throw i}},generateBundle(){n&&this.emitFile({type:"asset",fileName:"metadata-stats.json",source:JSON.stringify(n.stats,null,2)});}}}export{c as default,c as metadataPlugin};
|