chayns-toolkit 3.3.5 → 3.3.6

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.
Files changed (2) hide show
  1. package/lib/cli.js +1 -1
  2. package/package.json +1 -3
package/lib/cli.js CHANGED
@@ -42,7 +42,7 @@ export default config;
42
42
  `);let r=new As.ESLint({fix:!0}),e=await r.lintFiles(["./src"]);await As.ESLint.outputFixes(e);let t=e.reduce((i,o)=>i+o.warningCount,0),n=e.reduce((i,o)=>i+o.errorCount,0),s="";(t||n)&&(s=await(await r.loadFormatter("pretty")).format(e)),n+t===0?x.info(`No linting errors were found.
43
43
  `):(x.warn(`${n} errors and ${t} were found:
44
44
  `),console.log(s))}catch(r){x.error(`An error occured while linting your project:
45
- `),x.blank(r.message)}}var Xu=G(require("fs")),Zu=require("jest"),Cs=G(require("path"));function ec({watch:r,setupFile:e}){return async({config:t})=>{let n={transform:{"\\.[jt]sx?$":["babel-jest",{presets:["@babel/preset-react","@babel/preset-env"]}]},moduleFileExtensions:["ts","tsx","js","jsx"],moduleNameMapper:{"^.+\\.(css|less|scss)$":"babel-jest","\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":Cs.default.resolve(__dirname,"assets","file-mock.js")},testPathIgnorePatterns:["^.+\\.eslintrc\\.js$"],setupFilesAfterEnv:[Cs.default.resolve(__dirname,"assets","react-testing-library.setup.js")],testEnvironment:"jsdom"};if(typeof t.jest=="function"){let i=t.jest;n=i(n)}if(e){let i=F.resolvePath(e),o=`The specified setup file for the tests (${i}) could not be found.`;try{Xu.default.existsSync(i)?n.setupFilesAfterEnv&&n.setupFilesAfterEnv.push(i):x.warn(o)}catch{x.warn(o)}}let s=[];s.push("--config",JSON.stringify(n)),r&&s.push("--watch"),await(0,Zu.run)(s)}}var Os=G(st()),tc=G(require("http")),rc=G(require("https")),nc=G(require("serve-handler")),xs=G(require("fs"));function sc(r){return async({config:e})=>{let{host:t,port:n,cert:s,key:i}=e.development,o,a;s&&(o=xs.default.readFileSync(s)),i&&(a=xs.default.readFileSync(i));let u=!!(o&&a),l=async(f,h)=>{f.headers.origin&&(h.setHeader("Access-Control-Allow-Origin",f.headers.origin),h.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, PATCH, OPTIONS"),h.setHeader("Access-Control-Allow-Headers","Authorization, Content-Type, X-Requested-With"),f.headers["Access-Control-Request-Private-Network"]&&(h.setHeader("Access-Control-Allow-Private-Network","true"),h.setHeader("Access-Control-Allow-Credentials","true"))),h.setHeader("Vary","Origin");let A=Date.now();await(0,nc.default)(f,h,{public:e.output.path??"build",cleanUrls:["!**/*.html"]}),console.log(f.method,f.url),console.log("Returned",(h.statusCode===200?Os.default.green:Os.default.red)(h.statusCode),"in",Date.now()-A,"ms")};(u?rc.default.createServer({key:a,cert:o},l):tc.default.createServer(l)).listen(r.port??n,()=>{let f=`http${u?"s":""}://${t}:${r.port??n}`;console.log(`Running at ${f}`)}),await Promise.resolve()}}var Be=new Bs;Be.version("3.3.5","-v, --version","output the version number");Be.command("dev").description("start up a development server with hot module replacement").option("-d, --devtools","open react-devtools in a separate window",!1).action(async r=>{ot(!0),await Fe([ir,or],[Es({devtools:r.devtools})])});Be.command("build").description("bundles your code for production").option("-a, --analyze","analyze your bundle size",!1).option("-w, --watch","watch for file changes",!1).action(async r=>{try{ot(!1),await Fe([qi({analyze:r.analyze,watch:r.watch})])}catch(e){x.error(e),x.exit(1)}console.info("")});Be.command("lint").description("lints your code for possible errors").action(async()=>{await Qu(),console.info("")});Be.command("serve").description("serves the files from a local build folder").option("-p, --port <number>","port number").action(async({port:r})=>{try{await Fe([sc({port:r})])}catch(e){x.error(e)}});Be.command("test").description("executes all Jest tests for this project").option("-w, --watch","watch for changes to rerun tests",!1).option("--setupFile <path>","file that should be executed before the tests are initialized","").action(async r=>{try{await Fe([ec(r)])}catch(e){x.error(e)}console.info("")});Be.parse(process.argv);
45
+ `),x.blank(r.message)}}var Xu=G(require("fs")),Zu=require("jest"),Cs=G(require("path"));function ec({watch:r,setupFile:e}){return async({config:t})=>{let n={transform:{"\\.[jt]sx?$":["babel-jest",{presets:["@babel/preset-react","@babel/preset-env"]}]},moduleFileExtensions:["ts","tsx","js","jsx"],moduleNameMapper:{"^.+\\.(css|less|scss)$":"babel-jest","\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":Cs.default.resolve(__dirname,"assets","file-mock.js")},testPathIgnorePatterns:["^.+\\.eslintrc\\.js$"],setupFilesAfterEnv:[Cs.default.resolve(__dirname,"assets","react-testing-library.setup.js")],testEnvironment:"jsdom"};if(typeof t.jest=="function"){let i=t.jest;n=i(n)}if(e){let i=F.resolvePath(e),o=`The specified setup file for the tests (${i}) could not be found.`;try{Xu.default.existsSync(i)?n.setupFilesAfterEnv&&n.setupFilesAfterEnv.push(i):x.warn(o)}catch{x.warn(o)}}let s=[];s.push("--config",JSON.stringify(n)),r&&s.push("--watch"),await(0,Zu.run)(s)}}var Os=G(st()),tc=G(require("http")),rc=G(require("https")),nc=G(require("serve-handler")),xs=G(require("fs"));function sc(r){return async({config:e})=>{let{host:t,port:n,cert:s,key:i}=e.development,o,a;s&&(o=xs.default.readFileSync(s)),i&&(a=xs.default.readFileSync(i));let u=!!(o&&a),l=async(f,h)=>{f.headers.origin&&(h.setHeader("Access-Control-Allow-Origin",f.headers.origin),h.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, PATCH, OPTIONS"),h.setHeader("Access-Control-Allow-Headers","Authorization, Content-Type, X-Requested-With"),f.headers["Access-Control-Request-Private-Network"]&&(h.setHeader("Access-Control-Allow-Private-Network","true"),h.setHeader("Access-Control-Allow-Credentials","true"))),h.setHeader("Vary","Origin");let A=Date.now();await(0,nc.default)(f,h,{public:e.output.path??"build",cleanUrls:["!**/*.html"]}),console.log(f.method,f.url),console.log("Returned",(h.statusCode===200?Os.default.green:Os.default.red)(h.statusCode),"in",Date.now()-A,"ms")};(u?rc.default.createServer({key:a,cert:o},l):tc.default.createServer(l)).listen(r.port??n,()=>{let f=`http${u?"s":""}://${t}:${r.port??n}`;console.log(`Running at ${f}`)}),await Promise.resolve()}}var Be=new Bs;Be.version("3.3.6","-v, --version","output the version number");Be.command("dev").description("start up a development server with hot module replacement").option("-d, --devtools","open react-devtools in a separate window",!1).action(async r=>{ot(!0),await Fe([ir,or],[Es({devtools:r.devtools})])});Be.command("build").description("bundles your code for production").option("-a, --analyze","analyze your bundle size",!1).option("-w, --watch","watch for file changes",!1).action(async r=>{try{ot(!1),await Fe([qi({analyze:r.analyze,watch:r.watch})])}catch(e){x.error(e),x.exit(1)}console.info("")});Be.command("lint").description("lints your code for possible errors").action(async()=>{await Qu(),console.info("")});Be.command("serve").description("serves the files from a local build folder").option("-p, --port <number>","port number").action(async({port:r})=>{try{await Fe([sc({port:r})])}catch(e){x.error(e)}});Be.command("test").description("executes all Jest tests for this project").option("-w, --watch","watch for changes to rerun tests",!1).option("--setupFile <path>","file that should be executed before the tests are initialized","").action(async r=>{try{await Fe([ec(r)])}catch(e){x.error(e)}console.info("")});Be.parse(process.argv);
46
46
  /*! Bundled license information:
47
47
 
48
48
  is-extglob/index.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chayns-toolkit",
3
- "version": "3.3.5",
3
+ "version": "3.3.6",
4
4
  "description": "A zero-config toolchain for developing chayns® apps.",
5
5
  "keywords": [
6
6
  "chayns",
@@ -60,8 +60,6 @@
60
60
  "@rsbuild/plugin-sass": "^1.2.2",
61
61
  "@rsbuild/plugin-svgr": "^1.0.7",
62
62
  "@testing-library/jest-dom": "^6.6.3",
63
- "@typescript-eslint/eslint-plugin": "^5.62.0",
64
- "@typescript-eslint/parser": "^5.62.0",
65
63
  "ajv": "^8.17.1",
66
64
  "eslint": "^9.30.1",
67
65
  "eslint-formatter-pretty": "^6.0.1",