{"version":3,"file":"warning-utils.mjs","names":[],"sources":["../src/warning-utils.ts"],"sourcesContent":["import warning from 'process-warning';\n\nconst warningInstance = warning();\nconst verdaccioWarning = 'VerdaccioWarning';\nconst verdaccioDeprecation = 'VerdaccioDeprecation';\n\nexport enum Codes {\n  VERWAR001 = 'VERWAR001',\n  VERWAR002 = 'VERWAR002',\n  VERWAR003 = 'VERWAR003',\n  VERWAR004 = 'VERWAR004',\n  // deprecation warnings\n  VERDEP003 = 'VERDEP003',\n  VERDEP004 = 'VERDEP004',\n  VERWAR006 = 'VERWAR006',\n  VERWAR007 = 'VERWAR007',\n}\n\n/* general warnings */\n\nwarningInstance.create(\n  verdaccioWarning,\n  Codes.VERWAR001,\n  `Verdaccio doesn't need superuser privileges. don't run it under root`\n);\n\nwarningInstance.create(\n  verdaccioWarning,\n  Codes.VERWAR002,\n  `The configuration property \"logs\" has been deprecated, please rename to \"log\" for future compatibility`\n);\n\nwarningInstance.create(\n  verdaccioWarning,\n  Codes.VERWAR003,\n  'rotating-file type is not longer supported, consider use [logrotate] instead'\n);\n\nwarningInstance.create(\n  verdaccioWarning,\n  Codes.VERWAR004,\n  `invalid address - %s, we expect a port (e.g. \"4873\"), \nhost:port (e.g. \"localhost:4873\") or full url '(e.g. \"http://localhost:4873/\")\nhttps://verdaccio.org/docs/en/configuration#listen-port`\n);\n\nwarningInstance.create(\n  verdaccioDeprecation,\n  Codes.VERWAR006,\n  'the auth plugin method \"add_user\" in the auth plugin is deprecated and will be removed in next major release, rename to \"adduser\"'\n);\n\nwarningInstance.create(\n  verdaccioDeprecation,\n  Codes.VERWAR007,\n  `the secret length is too long, it must be 32 characters long, please consider generate a new one \n  Learn more at https://verdaccio.org/docs/configuration/#.verdaccio-db`\n);\n\n/* deprecation warnings */\n\nwarningInstance.create(\n  verdaccioDeprecation,\n  Codes.VERDEP003,\n  'multiple addresses will be deprecated in the next major, only use one'\n);\n\nwarningInstance.create(\n  verdaccioDeprecation,\n  Codes.VERDEP004,\n  `JavaScript configuration files are deprecated and will be removed in the next major release, please migrate to YAML (.yaml)\n  Learn more at https://verdaccio.org/docs/configuration`\n);\n\nexport function emit(code: string, a?: string, b?: string, c?: string) {\n  warningInstance.emit(code, a, b, c);\n}\n"],"mappings":";;;;;;;AAEA,IAAM,kBAAkB,QAAQ;AAChC,IAAM,mBAAmB;AACzB,IAAM,uBAAuB;AAE7B,IAAY,QAAL,yBAAA,OAAA;CACL,MAAA,eAAA;CACA,MAAA,eAAA;CACA,MAAA,eAAA;CACA,MAAA,eAAA;CAEA,MAAA,eAAA;CACA,MAAA,eAAA;CACA,MAAA,eAAA;CACA,MAAA,eAAA;;AACF,EAAA,CAAA,CAAA;AAIA,gBAAgB,OACd,kBAAA,aAEA,sEACF;AAEA,gBAAgB,OACd,kBAAA,aAEA,wGACF;AAEA,gBAAgB,OACd,kBAAA,aAEA,8EACF;AAEA,gBAAgB,OACd,kBAAA,aAEA;;wDAGF;AAEA,gBAAgB,OACd,sBAAA,aAEA,uIACF;AAEA,gBAAgB,OACd,sBAAA,aAEA;wEAEF;AAIA,gBAAgB,OACd,sBAAA,aAEA,uEACF;AAEA,gBAAgB,OACd,sBAAA,aAEA;yDAEF;AAEA,SAAgB,KAAK,MAAc,GAAY,GAAY,GAAY;CACrE,gBAAgB,KAAK,MAAM,GAAG,GAAG,CAAC;AACpC"}