metadatafy 1.0.2 → 1.1.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/README.md +57 -1
- package/dist/chunk-BT3J264A.cjs +2 -0
- package/dist/chunk-WUEHYY36.js +2 -0
- package/dist/cli.cjs +36 -1452
- package/dist/cli.js +36 -1424
- package/dist/index.cjs +1 -118
- package/dist/index.js +1 -1
- package/dist/next.cjs +12 -109
- package/dist/next.d.cts +24 -1
- package/dist/next.d.ts +24 -1
- package/dist/next.js +10 -82
- package/dist/vite.cjs +3 -89
- package/dist/vite.d.cts +9 -0
- package/dist/vite.d.ts +9 -0
- package/dist/vite.js +3 -64
- package/package.json +1 -1
- package/dist/chunk-5CZ4N6Q2.cjs +0 -1382
- package/dist/chunk-QXJYOL3O.js +0 -1327
package/dist/index.cjs
CHANGED
|
@@ -1,118 +1 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunk5CZ4N6Q2_cjs = require('./chunk-5CZ4N6Q2.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "ApiSender", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () { return chunk5CZ4N6Q2_cjs.ApiSender; }
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(exports, "CallGraphBuilder", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function () { return chunk5CZ4N6Q2_cjs.CallGraphBuilder; }
|
|
14
|
-
});
|
|
15
|
-
Object.defineProperty(exports, "DEFAULT_EXCLUDE_PATTERNS", {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
get: function () { return chunk5CZ4N6Q2_cjs.DEFAULT_EXCLUDE_PATTERNS; }
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports, "DEFAULT_FILE_TYPE_MAPPING", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function () { return chunk5CZ4N6Q2_cjs.DEFAULT_FILE_TYPE_MAPPING; }
|
|
22
|
-
});
|
|
23
|
-
Object.defineProperty(exports, "DEFAULT_INCLUDE_PATTERNS", {
|
|
24
|
-
enumerable: true,
|
|
25
|
-
get: function () { return chunk5CZ4N6Q2_cjs.DEFAULT_INCLUDE_PATTERNS; }
|
|
26
|
-
});
|
|
27
|
-
Object.defineProperty(exports, "DependencyResolver", {
|
|
28
|
-
enumerable: true,
|
|
29
|
-
get: function () { return chunk5CZ4N6Q2_cjs.DependencyResolver; }
|
|
30
|
-
});
|
|
31
|
-
Object.defineProperty(exports, "ExportExtractor", {
|
|
32
|
-
enumerable: true,
|
|
33
|
-
get: function () { return chunk5CZ4N6Q2_cjs.ExportExtractor; }
|
|
34
|
-
});
|
|
35
|
-
Object.defineProperty(exports, "FileWriter", {
|
|
36
|
-
enumerable: true,
|
|
37
|
-
get: function () { return chunk5CZ4N6Q2_cjs.FileWriter; }
|
|
38
|
-
});
|
|
39
|
-
Object.defineProperty(exports, "ImportExtractor", {
|
|
40
|
-
enumerable: true,
|
|
41
|
-
get: function () { return chunk5CZ4N6Q2_cjs.ImportExtractor; }
|
|
42
|
-
});
|
|
43
|
-
Object.defineProperty(exports, "KOREAN_KEYWORD_MAP", {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () { return chunk5CZ4N6Q2_cjs.KOREAN_KEYWORD_MAP; }
|
|
46
|
-
});
|
|
47
|
-
Object.defineProperty(exports, "KeywordExtractor", {
|
|
48
|
-
enumerable: true,
|
|
49
|
-
get: function () { return chunk5CZ4N6Q2_cjs.KeywordExtractor; }
|
|
50
|
-
});
|
|
51
|
-
Object.defineProperty(exports, "ProjectAnalyzer", {
|
|
52
|
-
enumerable: true,
|
|
53
|
-
get: function () { return chunk5CZ4N6Q2_cjs.ProjectAnalyzer; }
|
|
54
|
-
});
|
|
55
|
-
Object.defineProperty(exports, "PropsExtractor", {
|
|
56
|
-
enumerable: true,
|
|
57
|
-
get: function () { return chunk5CZ4N6Q2_cjs.PropsExtractor; }
|
|
58
|
-
});
|
|
59
|
-
Object.defineProperty(exports, "SQLParser", {
|
|
60
|
-
enumerable: true,
|
|
61
|
-
get: function () { return chunk5CZ4N6Q2_cjs.SQLParser; }
|
|
62
|
-
});
|
|
63
|
-
Object.defineProperty(exports, "SupabaseApiSender", {
|
|
64
|
-
enumerable: true,
|
|
65
|
-
get: function () { return chunk5CZ4N6Q2_cjs.SupabaseApiSender; }
|
|
66
|
-
});
|
|
67
|
-
Object.defineProperty(exports, "TypeScriptParser", {
|
|
68
|
-
enumerable: true,
|
|
69
|
-
get: function () { return chunk5CZ4N6Q2_cjs.TypeScriptParser; }
|
|
70
|
-
});
|
|
71
|
-
Object.defineProperty(exports, "createDefaultConfig", {
|
|
72
|
-
enumerable: true,
|
|
73
|
-
get: function () { return chunk5CZ4N6Q2_cjs.createDefaultConfig; }
|
|
74
|
-
});
|
|
75
|
-
Object.defineProperty(exports, "extendKoreanMap", {
|
|
76
|
-
enumerable: true,
|
|
77
|
-
get: function () { return chunk5CZ4N6Q2_cjs.extendKoreanMap; }
|
|
78
|
-
});
|
|
79
|
-
Object.defineProperty(exports, "extractAcronyms", {
|
|
80
|
-
enumerable: true,
|
|
81
|
-
get: function () { return chunk5CZ4N6Q2_cjs.extractAcronyms; }
|
|
82
|
-
});
|
|
83
|
-
Object.defineProperty(exports, "findKoreanKeywords", {
|
|
84
|
-
enumerable: true,
|
|
85
|
-
get: function () { return chunk5CZ4N6Q2_cjs.findKoreanKeywords; }
|
|
86
|
-
});
|
|
87
|
-
Object.defineProperty(exports, "generateId", {
|
|
88
|
-
enumerable: true,
|
|
89
|
-
get: function () { return chunk5CZ4N6Q2_cjs.generateId; }
|
|
90
|
-
});
|
|
91
|
-
Object.defineProperty(exports, "splitCamelCase", {
|
|
92
|
-
enumerable: true,
|
|
93
|
-
get: function () { return chunk5CZ4N6Q2_cjs.splitCamelCase; }
|
|
94
|
-
});
|
|
95
|
-
Object.defineProperty(exports, "splitIntoWords", {
|
|
96
|
-
enumerable: true,
|
|
97
|
-
get: function () { return chunk5CZ4N6Q2_cjs.splitIntoWords; }
|
|
98
|
-
});
|
|
99
|
-
Object.defineProperty(exports, "splitKebabCase", {
|
|
100
|
-
enumerable: true,
|
|
101
|
-
get: function () { return chunk5CZ4N6Q2_cjs.splitKebabCase; }
|
|
102
|
-
});
|
|
103
|
-
Object.defineProperty(exports, "splitPascalCase", {
|
|
104
|
-
enumerable: true,
|
|
105
|
-
get: function () { return chunk5CZ4N6Q2_cjs.splitPascalCase; }
|
|
106
|
-
});
|
|
107
|
-
Object.defineProperty(exports, "splitSnakeCase", {
|
|
108
|
-
enumerable: true,
|
|
109
|
-
get: function () { return chunk5CZ4N6Q2_cjs.splitSnakeCase; }
|
|
110
|
-
});
|
|
111
|
-
Object.defineProperty(exports, "toAllCases", {
|
|
112
|
-
enumerable: true,
|
|
113
|
-
get: function () { return chunk5CZ4N6Q2_cjs.toAllCases; }
|
|
114
|
-
});
|
|
115
|
-
Object.defineProperty(exports, "validateConfig", {
|
|
116
|
-
enumerable: true,
|
|
117
|
-
get: function () { return chunk5CZ4N6Q2_cjs.validateConfig; }
|
|
118
|
-
});
|
|
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 +1 @@
|
|
|
1
|
-
export
|
|
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,109 +1,12 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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 = chunk5CZ4N6Q2_cjs.createDefaultConfig(options);
|
|
30
|
-
const runOn = options.runOn || "build";
|
|
31
|
-
const errors = chunk5CZ4N6Q2_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 chunk5CZ4N6Q2_cjs.ProjectAnalyzer(this.config);
|
|
86
|
-
const fileWriter = new chunk5CZ4N6Q2_cjs.FileWriter(this.config);
|
|
87
|
-
const apiSender = this.config.output.api?.enabled ? new chunk5CZ4N6Q2_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;
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunkBT3J264A_cjs=require('./chunk-BT3J264A.cjs'),s=require('path'),g=require('fs/promises');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 s__namespace=/*#__PURE__*/_interopNamespace(s);var g__namespace=/*#__PURE__*/_interopNamespace(g);async function h(e,t){let a=new chunkBT3J264A_cjs.y(e),o=new chunkBT3J264A_cjs.z(e),n=e.output.api?.enabled?new chunkBT3J264A_cjs.A(e):null;e.verbose&&console.log("[metadata-plugin] Starting analysis...");let r=await a.analyze(t);if(e.output.file?.enabled){let i=s__namespace.resolve(t,e.output.file.path);await o.write(r,i),e.verbose&&console.log(`[metadata-plugin] Wrote metadata to ${i}`);}n&&(await n.send(r),e.verbose&&console.log("[metadata-plugin] Sent metadata to API"));}function x(e={}){let t=chunkBT3J264A_cjs.d(e),a=chunkBT3J264A_cjs.e(t);if(a.length>0)throw new Error(`[metadata-plugin] Invalid config:
|
|
2
|
+
${a.join(`
|
|
3
|
+
`)}`);return {name:"metadata-adapter",async onBuildComplete({projectDir:o}){t.verbose&&console.log("[metadata-plugin] Build completed, running analysis..."),await h(t,o),t.verbose&&console.log("[metadata-plugin] Analysis completed");}}}async function b(e,t={}){let a=s__namespace.join(e,".metadata-adapter.js"),o=`
|
|
4
|
+
// Auto-generated by metadatafy
|
|
5
|
+
// This adapter enables metadata extraction with Turbopack (Next.js 16+)
|
|
6
|
+
|
|
7
|
+
const { createMetadataAdapter } = require('metadatafy/next');
|
|
8
|
+
|
|
9
|
+
module.exports = createMetadataAdapter(${JSON.stringify(t,null,2)});
|
|
10
|
+
`;return await g__namespace.writeFile(a,o.trim()),a}function w(e={}){let t=chunkBT3J264A_cjs.d(e),a=e.runOn||"build",o=chunkBT3J264A_cjs.e(t);if(o.length>0)throw new Error(`[metadata-plugin] Invalid config:
|
|
11
|
+
${o.join(`
|
|
12
|
+
`)}`);return n=>({...n,webpack(r,i){let{dev:d,isServer:y}=i;return y&&(a==="both"||a==="build"&&!d||a==="dev"&&d)&&(r.plugins=r.plugins||[],r.plugins.push(new l(t))),typeof n.webpack=="function"?n.webpack(r,i):r}})}var l=class{constructor(t){this.hasRun=false;this.config=t;}apply(t){let a="MetadataWebpackPlugin";t.hooks.beforeCompile.tapAsync(a,async(o,n)=>{if(this.hasRun)return n();this.hasRun=true;try{await h(this.config,t.context),n();}catch(r){n(r);}}),t.hooks.watchRun.tap(a,()=>{});}};exports.createMetadataAdapter=x;exports.default=w;exports.generateAdapterFile=b;exports.withMetadata=w;
|
package/dist/next.d.cts
CHANGED
|
@@ -11,9 +11,32 @@ interface NextPluginOptions extends Partial<PluginConfig> {
|
|
|
11
11
|
*/
|
|
12
12
|
runOn?: 'build' | 'dev' | 'both';
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Next.js 16+ Build Adapter 생성
|
|
16
|
+
* Turbopack 환경에서도 동작하는 빌드 어댑터
|
|
17
|
+
*/
|
|
18
|
+
declare function createMetadataAdapter(options?: NextPluginOptions): {
|
|
19
|
+
name: string;
|
|
20
|
+
onBuildComplete({ projectDir, }: {
|
|
21
|
+
routes: unknown;
|
|
22
|
+
outputs: unknown;
|
|
23
|
+
projectDir: string;
|
|
24
|
+
repoRoot: string;
|
|
25
|
+
distDir: string;
|
|
26
|
+
config: NextConfig;
|
|
27
|
+
nextVersion: string;
|
|
28
|
+
}): Promise<void>;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Next.js 16+ 어댑터 파일 생성 헬퍼
|
|
32
|
+
* Turbopack 지원을 위해 어댑터 파일을 자동 생성
|
|
33
|
+
*/
|
|
34
|
+
declare function generateAdapterFile(projectDir: string, options?: NextPluginOptions): Promise<string>;
|
|
14
35
|
/**
|
|
15
36
|
* Next.js 설정을 확장하는 함수
|
|
37
|
+
* Next.js 16+ Turbopack: experimental.adapterPath 사용
|
|
38
|
+
* Next.js 15- Webpack: webpack 플러그인 사용
|
|
16
39
|
*/
|
|
17
40
|
declare function withMetadata(options?: NextPluginOptions): (nextConfig: NextConfig) => NextConfig;
|
|
18
41
|
|
|
19
|
-
export { type NextPluginOptions, PluginConfig, withMetadata as default, withMetadata };
|
|
42
|
+
export { type NextPluginOptions, PluginConfig, createMetadataAdapter, withMetadata as default, generateAdapterFile, withMetadata };
|
package/dist/next.d.ts
CHANGED
|
@@ -11,9 +11,32 @@ interface NextPluginOptions extends Partial<PluginConfig> {
|
|
|
11
11
|
*/
|
|
12
12
|
runOn?: 'build' | 'dev' | 'both';
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Next.js 16+ Build Adapter 생성
|
|
16
|
+
* Turbopack 환경에서도 동작하는 빌드 어댑터
|
|
17
|
+
*/
|
|
18
|
+
declare function createMetadataAdapter(options?: NextPluginOptions): {
|
|
19
|
+
name: string;
|
|
20
|
+
onBuildComplete({ projectDir, }: {
|
|
21
|
+
routes: unknown;
|
|
22
|
+
outputs: unknown;
|
|
23
|
+
projectDir: string;
|
|
24
|
+
repoRoot: string;
|
|
25
|
+
distDir: string;
|
|
26
|
+
config: NextConfig;
|
|
27
|
+
nextVersion: string;
|
|
28
|
+
}): Promise<void>;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Next.js 16+ 어댑터 파일 생성 헬퍼
|
|
32
|
+
* Turbopack 지원을 위해 어댑터 파일을 자동 생성
|
|
33
|
+
*/
|
|
34
|
+
declare function generateAdapterFile(projectDir: string, options?: NextPluginOptions): Promise<string>;
|
|
14
35
|
/**
|
|
15
36
|
* Next.js 설정을 확장하는 함수
|
|
37
|
+
* Next.js 16+ Turbopack: experimental.adapterPath 사용
|
|
38
|
+
* Next.js 15- Webpack: webpack 플러그인 사용
|
|
16
39
|
*/
|
|
17
40
|
declare function withMetadata(options?: NextPluginOptions): (nextConfig: NextConfig) => NextConfig;
|
|
18
41
|
|
|
19
|
-
export { type NextPluginOptions, PluginConfig, withMetadata as default, withMetadata };
|
|
42
|
+
export { type NextPluginOptions, PluginConfig, createMetadataAdapter, withMetadata as default, generateAdapterFile, withMetadata };
|
package/dist/next.js
CHANGED
|
@@ -1,84 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {d,e,y,z,A}from'./chunk-WUEHYY36.js';import*as s from'path';import*as g from'fs/promises';async function h(e,t){let a=new y(e),o=new z(e),n=e.output.api?.enabled?new A(e):null;e.verbose&&console.log("[metadata-plugin] Starting analysis...");let r=await a.analyze(t);if(e.output.file?.enabled){let i=s.resolve(t,e.output.file.path);await o.write(r,i),e.verbose&&console.log(`[metadata-plugin] Wrote metadata to ${i}`);}n&&(await n.send(r),e.verbose&&console.log("[metadata-plugin] Sent metadata to API"));}function x(e$1={}){let t=d(e$1),a=e(t);if(a.length>0)throw new Error(`[metadata-plugin] Invalid config:
|
|
2
|
+
${a.join(`
|
|
3
|
+
`)}`);return {name:"metadata-adapter",async onBuildComplete({projectDir:o}){t.verbose&&console.log("[metadata-plugin] Build completed, running analysis..."),await h(t,o),t.verbose&&console.log("[metadata-plugin] Analysis completed");}}}async function b(e,t={}){let a=s.join(e,".metadata-adapter.js"),o=`
|
|
4
|
+
// Auto-generated by metadatafy
|
|
5
|
+
// This adapter enables metadata extraction with Turbopack (Next.js 16+)
|
|
3
6
|
|
|
4
|
-
|
|
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
|
-
};
|
|
7
|
+
const { createMetadataAdapter } = require('metadatafy/next');
|
|
83
8
|
|
|
84
|
-
|
|
9
|
+
module.exports = createMetadataAdapter(${JSON.stringify(t,null,2)});
|
|
10
|
+
`;return await g.writeFile(a,o.trim()),a}function w(e$1={}){let t=d(e$1),a=e$1.runOn||"build",o=e(t);if(o.length>0)throw new Error(`[metadata-plugin] Invalid config:
|
|
11
|
+
${o.join(`
|
|
12
|
+
`)}`);return n=>({...n,webpack(r,i){let{dev:d,isServer:y}=i;return y&&(a==="both"||a==="build"&&!d||a==="dev"&&d)&&(r.plugins=r.plugins||[],r.plugins.push(new l(t))),typeof n.webpack=="function"?n.webpack(r,i):r}})}var l=class{constructor(t){this.hasRun=false;this.config=t;}apply(t){let a="MetadataWebpackPlugin";t.hooks.beforeCompile.tapAsync(a,async(o,n)=>{if(this.hasRun)return n();this.hasRun=true;try{await h(this.config,t.context),n();}catch(r){n(r);}}),t.hooks.watchRun.tap(a,()=>{});}};export{x as createMetadataAdapter,w as default,b as generateAdapterFile,w as withMetadata};
|
package/dist/vite.cjs
CHANGED
|
@@ -1,89 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var chunk5CZ4N6Q2_cjs = require('./chunk-5CZ4N6Q2.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 = chunk5CZ4N6Q2_cjs.createDefaultConfig(options);
|
|
30
|
-
const runOn = options.runOn || "build";
|
|
31
|
-
let viteConfig;
|
|
32
|
-
let analysisResult = null;
|
|
33
|
-
const analyzer = new chunk5CZ4N6Q2_cjs.ProjectAnalyzer(config);
|
|
34
|
-
const fileWriter = new chunk5CZ4N6Q2_cjs.FileWriter(config);
|
|
35
|
-
const apiSender = config.output.api?.enabled ? new chunk5CZ4N6Q2_cjs.ApiSender(config) : null;
|
|
36
|
-
return {
|
|
37
|
-
name: "vite-metadata-plugin",
|
|
38
|
-
configResolved(resolvedConfig) {
|
|
39
|
-
viteConfig = resolvedConfig;
|
|
40
|
-
const errors = chunk5CZ4N6Q2_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;
|
|
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);async function v(t,n){let i=new chunkBT3J264A_cjs.y(t),r=new chunkBT3J264A_cjs.z(t),a=t.output.api?.enabled?new chunkBT3J264A_cjs.A(t):null;t.verbose&&console.log("[metadata-plugin] Starting analysis...");let e=await i.analyze(n);if(t.output.file?.enabled){let o=g__namespace.resolve(n,t.output.file.path);await r.write(e,o),t.verbose&&console.log(`[metadata-plugin] Wrote metadata to ${o}`);}return a&&(await a.send(e),t.verbose&&console.log("[metadata-plugin] Sent metadata to API")),e}function y(t={}){let n=chunkBT3J264A_cjs.d(t),i=t.runOn||"build",r=t.emitStatsFile!==false,a,e=null,o=false;return {name:"vite-metadata-plugin",enforce:"post",configResolved(s){a=s;let l=chunkBT3J264A_cjs.e(n);if(l.length>0)throw new Error(`[metadata-plugin] Invalid config:
|
|
2
|
+
${l.join(`
|
|
3
|
+
`)}`)},async buildStart(){if(o||!(i==="both"||i==="build"&&a.command==="build"||i==="serve"&&a.command==="serve"))return;o=true;let l=a.root;try{e=await v(n,l);}catch(u){if(console.error("[metadata-plugin] Analysis failed:",u),a.command==="build")throw u}},generateBundle(){!e||!r||this.emitFile({type:"asset",fileName:"metadata-stats.json",source:JSON.stringify(e.stats,null,2)});},closeBundle(){n.verbose&&e&&console.log(`[metadata-plugin] Build complete. Analyzed ${e.stats.totalFiles} files.`),o=false,e=null;}}}exports.default=y;exports.metadataPlugin=y;
|
package/dist/vite.d.cts
CHANGED
|
@@ -10,9 +10,18 @@ interface VitePluginOptions extends Partial<PluginConfig> {
|
|
|
10
10
|
* - 'both': 둘 다
|
|
11
11
|
*/
|
|
12
12
|
runOn?: 'build' | 'serve' | 'both';
|
|
13
|
+
/**
|
|
14
|
+
* 빌드 결과에 통계 파일 포함 여부
|
|
15
|
+
* 기본값: true
|
|
16
|
+
*/
|
|
17
|
+
emitStatsFile?: boolean;
|
|
13
18
|
}
|
|
14
19
|
/**
|
|
15
20
|
* Vite 메타데이터 플러그인
|
|
21
|
+
*
|
|
22
|
+
* Vite 4/5/6/7 호환
|
|
23
|
+
* - 표준 Rollup 훅 사용 (configResolved, buildStart, closeBundle)
|
|
24
|
+
* - Vite 7+ Environment API 대비 (client 환경에서만 실행)
|
|
16
25
|
*/
|
|
17
26
|
declare function metadataPlugin(options?: VitePluginOptions): Plugin;
|
|
18
27
|
|
package/dist/vite.d.ts
CHANGED
|
@@ -10,9 +10,18 @@ interface VitePluginOptions extends Partial<PluginConfig> {
|
|
|
10
10
|
* - 'both': 둘 다
|
|
11
11
|
*/
|
|
12
12
|
runOn?: 'build' | 'serve' | 'both';
|
|
13
|
+
/**
|
|
14
|
+
* 빌드 결과에 통계 파일 포함 여부
|
|
15
|
+
* 기본값: true
|
|
16
|
+
*/
|
|
17
|
+
emitStatsFile?: boolean;
|
|
13
18
|
}
|
|
14
19
|
/**
|
|
15
20
|
* Vite 메타데이터 플러그인
|
|
21
|
+
*
|
|
22
|
+
* Vite 4/5/6/7 호환
|
|
23
|
+
* - 표준 Rollup 훅 사용 (configResolved, buildStart, closeBundle)
|
|
24
|
+
* - Vite 7+ Environment API 대비 (client 환경에서만 실행)
|
|
16
25
|
*/
|
|
17
26
|
declare function metadataPlugin(options?: VitePluginOptions): Plugin;
|
|
18
27
|
|
package/dist/vite.js
CHANGED
|
@@ -1,64 +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 };
|
|
1
|
+
import {d,e,y as y$1,z,A}from'./chunk-WUEHYY36.js';import*as g from'path';async function v(t,n){let i=new y$1(t),r=new z(t),a=t.output.api?.enabled?new A(t):null;t.verbose&&console.log("[metadata-plugin] Starting analysis...");let e=await i.analyze(n);if(t.output.file?.enabled){let o=g.resolve(n,t.output.file.path);await r.write(e,o),t.verbose&&console.log(`[metadata-plugin] Wrote metadata to ${o}`);}return a&&(await a.send(e),t.verbose&&console.log("[metadata-plugin] Sent metadata to API")),e}function y(t={}){let n=d(t),i=t.runOn||"build",r=t.emitStatsFile!==false,a,e$1=null,o=false;return {name:"vite-metadata-plugin",enforce:"post",configResolved(s){a=s;let l=e(n);if(l.length>0)throw new Error(`[metadata-plugin] Invalid config:
|
|
2
|
+
${l.join(`
|
|
3
|
+
`)}`)},async buildStart(){if(o||!(i==="both"||i==="build"&&a.command==="build"||i==="serve"&&a.command==="serve"))return;o=true;let l=a.root;try{e$1=await v(n,l);}catch(u){if(console.error("[metadata-plugin] Analysis failed:",u),a.command==="build")throw u}},generateBundle(){!e$1||!r||this.emitFile({type:"asset",fileName:"metadata-stats.json",source:JSON.stringify(e$1.stats,null,2)});},closeBundle(){n.verbose&&e$1&&console.log(`[metadata-plugin] Build complete. Analyzed ${e$1.stats.totalFiles} files.`),o=false,e$1=null;}}}export{y as default,y as metadataPlugin};
|