metadatafy 1.1.1 → 1.1.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.
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'),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:
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 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=`
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 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:
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 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;
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: experimental.adapterPath 사용
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: experimental.adapterPath 사용
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 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:
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 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=`
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 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:
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 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};
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.1",
3
+ "version": "1.1.2",
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": "^14.0.0",
58
+ "next": "^16.1.1",
59
59
  "tsup": "^8.0.0",
60
60
  "typescript": "^5.0.0",
61
61
  "typescript-eslint": "^8.0.0",