metadatafy 1.1.1 → 1.1.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/README.md +60 -4
- package/dist/next.cjs +4 -4
- package/dist/next.d.cts +2 -2
- package/dist/next.d.ts +2 -2
- package/dist/next.js +4 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -30,23 +30,79 @@ yarn add metadatafy
|
|
|
30
30
|
pnpm add metadatafy
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
+
## Quick Start / 빠른 시작
|
|
34
|
+
|
|
35
|
+
The easiest way to get started is with the interactive setup wizard:
|
|
36
|
+
|
|
37
|
+
가장 쉽게 시작하는 방법은 인터랙티브 설정 마법사를 사용하는 것입니다:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npx metadatafy init
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
This will:
|
|
44
|
+
- Auto-detect your project type (Next.js, Vite, CRA, etc.)
|
|
45
|
+
- Detect your package manager (npm, yarn, pnpm)
|
|
46
|
+
- Create a `metadata.config.json` with optimized settings
|
|
47
|
+
- Optionally add the plugin to your build config (vite.config.ts or next.config.js)
|
|
48
|
+
|
|
49
|
+
이 명령어는:
|
|
50
|
+
- 프로젝트 타입 자동 감지 (Next.js, Vite, CRA 등)
|
|
51
|
+
- 패키지 매니저 감지 (npm, yarn, pnpm)
|
|
52
|
+
- 최적화된 설정으로 `metadata.config.json` 생성
|
|
53
|
+
- 선택적으로 빌드 설정에 플러그인 추가 (vite.config.ts 또는 next.config.js)
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
$ npx metadatafy init
|
|
57
|
+
|
|
58
|
+
🚀 metadatafy 설정 마법사
|
|
59
|
+
|
|
60
|
+
프로젝트: my-app
|
|
61
|
+
경로: /Users/you/projects/my-app
|
|
62
|
+
|
|
63
|
+
🔍 프로젝트 분석 중...
|
|
64
|
+
|
|
65
|
+
✅ 감지된 정보:
|
|
66
|
+
프로젝트 타입: Next.js (App Router)
|
|
67
|
+
패키지 매니저: pnpm
|
|
68
|
+
TypeScript: 예
|
|
69
|
+
주요 폴더: app, components, hooks, lib
|
|
70
|
+
|
|
71
|
+
📦 프로젝트 타입을 선택하세요:
|
|
72
|
+
1) Next.js (App Router) (감지됨)
|
|
73
|
+
2) Next.js (Pages Router)
|
|
74
|
+
3) Vite + React
|
|
75
|
+
4) Create React App
|
|
76
|
+
5) Node.js Backend
|
|
77
|
+
|
|
78
|
+
선택 [1]:
|
|
79
|
+
```
|
|
80
|
+
|
|
33
81
|
## Usage / 사용법
|
|
34
82
|
|
|
35
83
|
### CLI
|
|
36
84
|
|
|
37
85
|
```bash
|
|
86
|
+
# Interactive setup (recommended for new projects)
|
|
87
|
+
# 인터랙티브 설정 (새 프로젝트에 권장)
|
|
88
|
+
npx metadatafy init
|
|
89
|
+
|
|
38
90
|
# Analyze project and generate metadata
|
|
39
91
|
# 프로젝트 분석 및 메타데이터 생성
|
|
40
92
|
npx metadatafy analyze
|
|
41
93
|
|
|
42
94
|
# With options / 옵션과 함께
|
|
43
95
|
npx metadatafy analyze --project-id my-project --output ./metadata.json --verbose
|
|
44
|
-
|
|
45
|
-
# Generate config file / 설정 파일 생성
|
|
46
|
-
npx metadatafy init
|
|
47
96
|
```
|
|
48
97
|
|
|
49
|
-
#### CLI
|
|
98
|
+
#### CLI Commands / CLI 명령어
|
|
99
|
+
|
|
100
|
+
| Command | Description |
|
|
101
|
+
|---------|-------------|
|
|
102
|
+
| `init` | Interactive setup wizard / 인터랙티브 설정 마법사 |
|
|
103
|
+
| `analyze` | Analyze project and generate metadata / 프로젝트 분석 및 메타데이터 생성 |
|
|
104
|
+
|
|
105
|
+
#### Analyze Options / Analyze 옵션
|
|
50
106
|
|
|
51
107
|
| Option | Short | Description |
|
|
52
108
|
|--------|-------|-------------|
|
package/dist/next.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunkBT3J264A_cjs=require('./chunk-BT3J264A.cjs'),
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunkBT3J264A_cjs=require('./chunk-BT3J264A.cjs'),l=require('path'),y=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 l__namespace=/*#__PURE__*/_interopNamespace(l);var y__namespace=/*#__PURE__*/_interopNamespace(y);async function m(e,t){let a=new chunkBT3J264A_cjs.y(e),o=new chunkBT3J264A_cjs.z(e),i=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 s=l__namespace.resolve(t,e.output.file.path);await o.write(r,s),e.verbose&&console.log(`[metadata-plugin] Wrote metadata to ${s}`);}i&&(await i.send(r),e.verbose&&console.log("[metadata-plugin] Sent metadata to API"));}function P(e={}){let t=chunkBT3J264A_cjs.d(e),a=chunkBT3J264A_cjs.e(t);if(a.length>0)throw new Error(`[metadata-plugin] Invalid config:
|
|
2
2
|
${a.join(`
|
|
3
|
-
`)}`);return {name:"metadata-adapter",async onBuildComplete({projectDir:o}){t.verbose&&console.log("[metadata-plugin] Build completed, running analysis..."),await
|
|
3
|
+
`)}`);return {name:"metadata-adapter",async onBuildComplete({projectDir:o}){t.verbose&&console.log("[metadata-plugin] Build completed, running analysis..."),await m(t,o),t.verbose&&console.log("[metadata-plugin] Analysis completed");}}}async function C(e,t={}){let a=l__namespace.join(e,".metadata-adapter.js"),o=`
|
|
4
4
|
// Auto-generated by metadatafy
|
|
5
5
|
// This adapter enables metadata extraction with Turbopack (Next.js 16+)
|
|
6
6
|
|
|
7
7
|
const { createMetadataAdapter } = require('metadatafy/next');
|
|
8
8
|
|
|
9
9
|
module.exports = createMetadataAdapter(${JSON.stringify(t,null,2)});
|
|
10
|
-
`;return await
|
|
10
|
+
`;return await y__namespace.writeFile(a,o.trim()),a}function b(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
11
|
${o.join(`
|
|
12
|
-
`)}`);return
|
|
12
|
+
`)}`);let i=false;return r=>{let s=r.compiler?.runAfterProductionCompile;return {...r,compiler:{...r.compiler,async runAfterProductionCompile(n){s&&await s(n),!(a!=="build"&&a!=="both")&&(i=true,t.verbose&&console.log("[metadata-plugin] runAfterProductionCompile triggered"),await m(t,n.projectDir),t.verbose&&console.log("[metadata-plugin] Analysis completed"));}},webpack(n,p){let{dev:f,isServer:x}=p;return !x||i||(a==="both"||a==="build"&&!f||a==="dev"&&f)&&(n.plugins=n.plugins||[],n.plugins.push(new c(t))),typeof r.webpack=="function"?r.webpack(n,p):n}}}}var c=class{constructor(t){this.hasRun=false;this.config=t;}apply(t){let a="MetadataWebpackPlugin";t.hooks.beforeCompile.tapAsync(a,async(o,i)=>{if(this.hasRun)return i();this.hasRun=true;try{await m(this.config,t.context),i();}catch(r){i(r);}}),t.hooks.watchRun.tap(a,()=>{});}};exports.createMetadataAdapter=P;exports.default=b;exports.generateAdapterFile=C;exports.withMetadata=b;
|
package/dist/next.d.cts
CHANGED
|
@@ -34,8 +34,8 @@ declare function createMetadataAdapter(options?: NextPluginOptions): {
|
|
|
34
34
|
declare function generateAdapterFile(projectDir: string, options?: NextPluginOptions): Promise<string>;
|
|
35
35
|
/**
|
|
36
36
|
* Next.js 설정을 확장하는 함수
|
|
37
|
-
* Next.js 16+ Turbopack:
|
|
38
|
-
* Next.js 15- Webpack: webpack 플러그인 사용
|
|
37
|
+
* Next.js 16+ Turbopack: compiler.runAfterProductionCompile 사용
|
|
38
|
+
* Next.js 15- Webpack: webpack 플러그인 사용 (폴백)
|
|
39
39
|
*/
|
|
40
40
|
declare function withMetadata(options?: NextPluginOptions): (nextConfig: NextConfig) => NextConfig;
|
|
41
41
|
|
package/dist/next.d.ts
CHANGED
|
@@ -34,8 +34,8 @@ declare function createMetadataAdapter(options?: NextPluginOptions): {
|
|
|
34
34
|
declare function generateAdapterFile(projectDir: string, options?: NextPluginOptions): Promise<string>;
|
|
35
35
|
/**
|
|
36
36
|
* Next.js 설정을 확장하는 함수
|
|
37
|
-
* Next.js 16+ Turbopack:
|
|
38
|
-
* Next.js 15- Webpack: webpack 플러그인 사용
|
|
37
|
+
* Next.js 16+ Turbopack: compiler.runAfterProductionCompile 사용
|
|
38
|
+
* Next.js 15- Webpack: webpack 플러그인 사용 (폴백)
|
|
39
39
|
*/
|
|
40
40
|
declare function withMetadata(options?: NextPluginOptions): (nextConfig: NextConfig) => NextConfig;
|
|
41
41
|
|
package/dist/next.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {d,e,y,z,A}from'./chunk-WUEHYY36.js';import*as
|
|
1
|
+
import {d,e,y as y$1,z,A}from'./chunk-WUEHYY36.js';import*as l from'path';import*as y from'fs/promises';async function m(e,t){let a=new y$1(e),o=new z(e),i=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 s=l.resolve(t,e.output.file.path);await o.write(r,s),e.verbose&&console.log(`[metadata-plugin] Wrote metadata to ${s}`);}i&&(await i.send(r),e.verbose&&console.log("[metadata-plugin] Sent metadata to API"));}function P(e$1={}){let t=d(e$1),a=e(t);if(a.length>0)throw new Error(`[metadata-plugin] Invalid config:
|
|
2
2
|
${a.join(`
|
|
3
|
-
`)}`);return {name:"metadata-adapter",async onBuildComplete({projectDir:o}){t.verbose&&console.log("[metadata-plugin] Build completed, running analysis..."),await
|
|
3
|
+
`)}`);return {name:"metadata-adapter",async onBuildComplete({projectDir:o}){t.verbose&&console.log("[metadata-plugin] Build completed, running analysis..."),await m(t,o),t.verbose&&console.log("[metadata-plugin] Analysis completed");}}}async function C(e,t={}){let a=l.join(e,".metadata-adapter.js"),o=`
|
|
4
4
|
// Auto-generated by metadatafy
|
|
5
5
|
// This adapter enables metadata extraction with Turbopack (Next.js 16+)
|
|
6
6
|
|
|
7
7
|
const { createMetadataAdapter } = require('metadatafy/next');
|
|
8
8
|
|
|
9
9
|
module.exports = createMetadataAdapter(${JSON.stringify(t,null,2)});
|
|
10
|
-
`;return await
|
|
10
|
+
`;return await y.writeFile(a,o.trim()),a}function b(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
11
|
${o.join(`
|
|
12
|
-
`)}`);return
|
|
12
|
+
`)}`);let i=false;return r=>{let s=r.compiler?.runAfterProductionCompile;return {...r,compiler:{...r.compiler,async runAfterProductionCompile(n){s&&await s(n),!(a!=="build"&&a!=="both")&&(i=true,t.verbose&&console.log("[metadata-plugin] runAfterProductionCompile triggered"),await m(t,n.projectDir),t.verbose&&console.log("[metadata-plugin] Analysis completed"));}},webpack(n,p){let{dev:f,isServer:x}=p;return !x||i||(a==="both"||a==="build"&&!f||a==="dev"&&f)&&(n.plugins=n.plugins||[],n.plugins.push(new c(t))),typeof r.webpack=="function"?r.webpack(n,p):n}}}}var c=class{constructor(t){this.hasRun=false;this.config=t;}apply(t){let a="MetadataWebpackPlugin";t.hooks.beforeCompile.tapAsync(a,async(o,i)=>{if(this.hasRun)return i();this.hasRun=true;try{await m(this.config,t.context),i();}catch(r){i(r);}}),t.hooks.watchRun.tap(a,()=>{});}};export{P as createMetadataAdapter,b as default,C as generateAdapterFile,b as withMetadata};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "metadatafy",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Build plugin for extracting project metadata for ticket analysis system",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@types/node": "^20.0.0",
|
|
56
56
|
"@types/webpack": "^5.28.5",
|
|
57
57
|
"eslint": "^9.0.0",
|
|
58
|
-
"next": "^
|
|
58
|
+
"next": "^16.1.1",
|
|
59
59
|
"tsup": "^8.0.0",
|
|
60
60
|
"typescript": "^5.0.0",
|
|
61
61
|
"typescript-eslint": "^8.0.0",
|