@matter/tools 0.11.0-alpha.0-20241005-e3e4e4a7a
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/LICENSE +201 -0
- package/README.md +100 -0
- package/bin/build.js +10 -0
- package/bin/prepare-chip.js +5 -0
- package/bin/run.js +7 -0
- package/bin/test.js +7 -0
- package/bin/version.js +7 -0
- package/chip/Dockerfile +23 -0
- package/dist/cjs/building/builder.d.ts +35 -0
- package/dist/cjs/building/builder.d.ts.map +1 -0
- package/dist/cjs/building/builder.js +210 -0
- package/dist/cjs/building/builder.js.map +6 -0
- package/dist/cjs/building/cli.d.ts +7 -0
- package/dist/cjs/building/cli.d.ts.map +1 -0
- package/dist/cjs/building/cli.js +100 -0
- package/dist/cjs/building/cli.js.map +6 -0
- package/dist/cjs/building/error.d.ts +16 -0
- package/dist/cjs/building/error.d.ts.map +1 -0
- package/dist/cjs/building/error.js +50 -0
- package/dist/cjs/building/error.js.map +6 -0
- package/dist/cjs/building/graph.d.ts +37 -0
- package/dist/cjs/building/graph.d.ts.map +1 -0
- package/dist/cjs/building/graph.js +222 -0
- package/dist/cjs/building/graph.js.map +6 -0
- package/dist/cjs/building/project.d.ts +56 -0
- package/dist/cjs/building/project.d.ts.map +1 -0
- package/dist/cjs/building/project.js +239 -0
- package/dist/cjs/building/project.js.map +6 -0
- package/dist/cjs/building/tsconfig.d.ts +16 -0
- package/dist/cjs/building/tsconfig.d.ts.map +1 -0
- package/dist/cjs/building/tsconfig.js +70 -0
- package/dist/cjs/building/tsconfig.js.map +6 -0
- package/dist/cjs/building/typescript/context.d.ts +16 -0
- package/dist/cjs/building/typescript/context.d.ts.map +1 -0
- package/dist/cjs/building/typescript/context.js +82 -0
- package/dist/cjs/building/typescript/context.js.map +6 -0
- package/dist/cjs/building/typescript/incremental-compiler.d.ts +10 -0
- package/dist/cjs/building/typescript/incremental-compiler.d.ts.map +1 -0
- package/dist/cjs/building/typescript/incremental-compiler.js +119 -0
- package/dist/cjs/building/typescript/incremental-compiler.js.map +6 -0
- package/dist/cjs/building/typescript/language-service.d.ts +13 -0
- package/dist/cjs/building/typescript/language-service.d.ts.map +1 -0
- package/dist/cjs/building/typescript/language-service.js +109 -0
- package/dist/cjs/building/typescript/language-service.js.map +6 -0
- package/dist/cjs/building/typescript/solution-builder.d.ts +10 -0
- package/dist/cjs/building/typescript/solution-builder.d.ts.map +1 -0
- package/dist/cjs/building/typescript/solution-builder.js +72 -0
- package/dist/cjs/building/typescript/solution-builder.js.map +6 -0
- package/dist/cjs/building/typescript.d.ts +13 -0
- package/dist/cjs/building/typescript.d.ts.map +1 -0
- package/dist/cjs/building/typescript.js +31 -0
- package/dist/cjs/building/typescript.js.map +6 -0
- package/dist/cjs/index.d.ts +15 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +32 -0
- package/dist/cjs/index.js.map +6 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/running/cli.d.ts +19 -0
- package/dist/cjs/running/cli.d.ts.map +1 -0
- package/dist/cjs/running/cli.js +82 -0
- package/dist/cjs/running/cli.js.map +6 -0
- package/dist/cjs/running/execute.d.ts +8 -0
- package/dist/cjs/running/execute.d.ts.map +1 -0
- package/dist/cjs/running/execute.js +82 -0
- package/dist/cjs/running/execute.js.map +6 -0
- package/dist/cjs/testing/chip/pics-file.d.ts +20 -0
- package/dist/cjs/testing/chip/pics-file.d.ts.map +1 -0
- package/dist/cjs/testing/chip/pics-file.js +79 -0
- package/dist/cjs/testing/chip/pics-file.js.map +6 -0
- package/dist/cjs/testing/chip.d.ts +60 -0
- package/dist/cjs/testing/chip.d.ts.map +1 -0
- package/dist/cjs/testing/chip.js +306 -0
- package/dist/cjs/testing/chip.js.map +6 -0
- package/dist/cjs/testing/cli.d.ts +9 -0
- package/dist/cjs/testing/cli.d.ts.map +1 -0
- package/dist/cjs/testing/cli.js +117 -0
- package/dist/cjs/testing/cli.js.map +6 -0
- package/dist/cjs/testing/failure-detail.d.ts +19 -0
- package/dist/cjs/testing/failure-detail.d.ts.map +1 -0
- package/dist/cjs/testing/failure-detail.js +143 -0
- package/dist/cjs/testing/failure-detail.js.map +6 -0
- package/dist/cjs/testing/files.d.ts +8 -0
- package/dist/cjs/testing/files.d.ts.map +1 -0
- package/dist/cjs/testing/files.js +52 -0
- package/dist/cjs/testing/files.js.map +6 -0
- package/dist/cjs/testing/global-declarations.d.ts +38 -0
- package/dist/cjs/testing/global-declarations.d.ts.map +1 -0
- package/dist/cjs/testing/global-declarations.js +8 -0
- package/dist/cjs/testing/global-declarations.js.map +6 -0
- package/dist/cjs/testing/global-definitions.d.ts +7 -0
- package/dist/cjs/testing/global-definitions.d.ts.map +1 -0
- package/dist/cjs/testing/global-definitions.js +50 -0
- package/dist/cjs/testing/global-definitions.js.map +6 -0
- package/dist/cjs/testing/mocha.d.ts +36 -0
- package/dist/cjs/testing/mocha.d.ts.map +1 -0
- package/dist/cjs/testing/mocha.js +155 -0
- package/dist/cjs/testing/mocha.js.map +6 -0
- package/dist/cjs/testing/mocharc.cjs +68 -0
- package/dist/cjs/testing/mocharc.d.cts +7 -0
- package/dist/cjs/testing/mocks/crypto.d.ts +7 -0
- package/dist/cjs/testing/mocks/crypto.d.ts.map +1 -0
- package/dist/cjs/testing/mocks/crypto.js +79 -0
- package/dist/cjs/testing/mocks/crypto.js.map +6 -0
- package/dist/cjs/testing/mocks/environment.d.ts +7 -0
- package/dist/cjs/testing/mocks/environment.d.ts.map +1 -0
- package/dist/cjs/testing/mocks/environment.js +7 -0
- package/dist/cjs/testing/mocks/environment.js.map +6 -0
- package/dist/cjs/testing/mocks/index.d.ts +10 -0
- package/dist/cjs/testing/mocks/index.d.ts.map +1 -0
- package/dist/cjs/testing/mocks/index.js +27 -0
- package/dist/cjs/testing/mocks/index.js.map +6 -0
- package/dist/cjs/testing/mocks/logging.d.ts +28 -0
- package/dist/cjs/testing/mocks/logging.d.ts.map +1 -0
- package/dist/cjs/testing/mocks/logging.js +93 -0
- package/dist/cjs/testing/mocks/logging.js.map +6 -0
- package/dist/cjs/testing/mocks/time.d.ts +88 -0
- package/dist/cjs/testing/mocks/time.d.ts.map +1 -0
- package/dist/cjs/testing/mocks/time.js +250 -0
- package/dist/cjs/testing/mocks/time.js.map +6 -0
- package/dist/cjs/testing/node.d.ts +16 -0
- package/dist/cjs/testing/node.d.ts.map +1 -0
- package/dist/cjs/testing/node.js +108 -0
- package/dist/cjs/testing/node.js.map +6 -0
- package/dist/cjs/testing/options.d.ts +19 -0
- package/dist/cjs/testing/options.d.ts.map +1 -0
- package/dist/cjs/testing/options.js +62 -0
- package/dist/cjs/testing/options.js.map +6 -0
- package/dist/cjs/testing/reporter.d.ts +50 -0
- package/dist/cjs/testing/reporter.d.ts.map +1 -0
- package/dist/cjs/testing/reporter.js +137 -0
- package/dist/cjs/testing/reporter.js.map +6 -0
- package/dist/cjs/testing/runner.d.ts +22 -0
- package/dist/cjs/testing/runner.d.ts.map +1 -0
- package/dist/cjs/testing/runner.js +116 -0
- package/dist/cjs/testing/runner.js.map +6 -0
- package/dist/cjs/testing/web.d.ts +8 -0
- package/dist/cjs/testing/web.d.ts.map +1 -0
- package/dist/cjs/testing/web.js +165 -0
- package/dist/cjs/testing/web.js.map +6 -0
- package/dist/cjs/util/bootstrap.mjs +105 -0
- package/dist/cjs/util/docker.d.ts +27 -0
- package/dist/cjs/util/docker.d.ts.map +1 -0
- package/dist/cjs/util/docker.js +163 -0
- package/dist/cjs/util/docker.js.map +6 -0
- package/dist/cjs/util/errors.d.ts +8 -0
- package/dist/cjs/util/errors.d.ts.map +1 -0
- package/dist/cjs/util/errors.js +55 -0
- package/dist/cjs/util/errors.js.map +6 -0
- package/dist/cjs/util/index.d.ts +8 -0
- package/dist/cjs/util/index.d.ts.map +1 -0
- package/dist/cjs/util/index.js +25 -0
- package/dist/cjs/util/index.js.map +6 -0
- package/dist/cjs/util/node-shims.d.ts +7 -0
- package/dist/cjs/util/node-shims.d.ts.map +1 -0
- package/dist/cjs/util/node-shims.js +12 -0
- package/dist/cjs/util/node-shims.js.map +6 -0
- package/dist/cjs/util/package.d.ts +61 -0
- package/dist/cjs/util/package.d.ts.map +1 -0
- package/dist/cjs/util/package.js +324 -0
- package/dist/cjs/util/package.js.map +6 -0
- package/dist/cjs/util/progress.d.ts +31 -0
- package/dist/cjs/util/progress.d.ts.map +1 -0
- package/dist/cjs/util/progress.js +232 -0
- package/dist/cjs/util/progress.js.map +6 -0
- package/dist/cjs/util/tools-path.cjs +13 -0
- package/dist/cjs/util/tools-path.d.cts +7 -0
- package/dist/cjs/util/trace-unhandled.d.ts +9 -0
- package/dist/cjs/util/trace-unhandled.d.ts.map +1 -0
- package/dist/cjs/util/trace-unhandled.js +48 -0
- package/dist/cjs/util/trace-unhandled.js.map +6 -0
- package/dist/cjs/util/wtf.d.ts +10 -0
- package/dist/cjs/util/wtf.d.ts.map +1 -0
- package/dist/cjs/util/wtf.js +53 -0
- package/dist/cjs/util/wtf.js.map +6 -0
- package/dist/cjs/versioning/cli.d.ts +7 -0
- package/dist/cjs/versioning/cli.d.ts.map +1 -0
- package/dist/cjs/versioning/cli.js +62 -0
- package/dist/cjs/versioning/cli.js.map +6 -0
- package/dist/cjs/versioning/versioner.d.ts +18 -0
- package/dist/cjs/versioning/versioner.d.ts.map +1 -0
- package/dist/cjs/versioning/versioner.js +145 -0
- package/dist/cjs/versioning/versioner.js.map +6 -0
- package/dist/esm/building/builder.d.ts +35 -0
- package/dist/esm/building/builder.d.ts.map +1 -0
- package/dist/esm/building/builder.js +180 -0
- package/dist/esm/building/builder.js.map +6 -0
- package/dist/esm/building/cli.d.ts +7 -0
- package/dist/esm/building/cli.d.ts.map +1 -0
- package/dist/esm/building/cli.js +70 -0
- package/dist/esm/building/cli.js.map +6 -0
- package/dist/esm/building/error.d.ts +16 -0
- package/dist/esm/building/error.d.ts.map +1 -0
- package/dist/esm/building/error.js +30 -0
- package/dist/esm/building/error.js.map +6 -0
- package/dist/esm/building/graph.d.ts +37 -0
- package/dist/esm/building/graph.d.ts.map +1 -0
- package/dist/esm/building/graph.js +192 -0
- package/dist/esm/building/graph.js.map +6 -0
- package/dist/esm/building/project.d.ts +56 -0
- package/dist/esm/building/project.d.ts.map +1 -0
- package/dist/esm/building/project.js +219 -0
- package/dist/esm/building/project.js.map +6 -0
- package/dist/esm/building/tsconfig.d.ts +16 -0
- package/dist/esm/building/tsconfig.d.ts.map +1 -0
- package/dist/esm/building/tsconfig.js +50 -0
- package/dist/esm/building/tsconfig.js.map +6 -0
- package/dist/esm/building/typescript/context.d.ts +16 -0
- package/dist/esm/building/typescript/context.d.ts.map +1 -0
- package/dist/esm/building/typescript/context.js +68 -0
- package/dist/esm/building/typescript/context.js.map +6 -0
- package/dist/esm/building/typescript/incremental-compiler.d.ts +10 -0
- package/dist/esm/building/typescript/incremental-compiler.d.ts.map +1 -0
- package/dist/esm/building/typescript/incremental-compiler.js +99 -0
- package/dist/esm/building/typescript/incremental-compiler.js.map +6 -0
- package/dist/esm/building/typescript/language-service.d.ts +13 -0
- package/dist/esm/building/typescript/language-service.d.ts.map +1 -0
- package/dist/esm/building/typescript/language-service.js +99 -0
- package/dist/esm/building/typescript/language-service.js.map +6 -0
- package/dist/esm/building/typescript/solution-builder.d.ts +10 -0
- package/dist/esm/building/typescript/solution-builder.d.ts.map +1 -0
- package/dist/esm/building/typescript/solution-builder.js +52 -0
- package/dist/esm/building/typescript/solution-builder.js.map +6 -0
- package/dist/esm/building/typescript.d.ts +13 -0
- package/dist/esm/building/typescript.d.ts.map +1 -0
- package/dist/esm/building/typescript.js +11 -0
- package/dist/esm/building/typescript.js.map +6 -0
- package/dist/esm/index.d.ts +15 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +15 -0
- package/dist/esm/index.js.map +6 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/running/cli.d.ts +19 -0
- package/dist/esm/running/cli.d.ts.map +1 -0
- package/dist/esm/running/cli.js +62 -0
- package/dist/esm/running/cli.js.map +6 -0
- package/dist/esm/running/execute.d.ts +8 -0
- package/dist/esm/running/execute.d.ts.map +1 -0
- package/dist/esm/running/execute.js +52 -0
- package/dist/esm/running/execute.js.map +6 -0
- package/dist/esm/testing/chip/pics-file.d.ts +20 -0
- package/dist/esm/testing/chip/pics-file.d.ts.map +1 -0
- package/dist/esm/testing/chip/pics-file.js +59 -0
- package/dist/esm/testing/chip/pics-file.js.map +6 -0
- package/dist/esm/testing/chip.d.ts +60 -0
- package/dist/esm/testing/chip.d.ts.map +1 -0
- package/dist/esm/testing/chip.js +286 -0
- package/dist/esm/testing/chip.js.map +6 -0
- package/dist/esm/testing/cli.d.ts +9 -0
- package/dist/esm/testing/cli.d.ts.map +1 -0
- package/dist/esm/testing/cli.js +87 -0
- package/dist/esm/testing/cli.js.map +6 -0
- package/dist/esm/testing/failure-detail.d.ts +19 -0
- package/dist/esm/testing/failure-detail.d.ts.map +1 -0
- package/dist/esm/testing/failure-detail.js +113 -0
- package/dist/esm/testing/failure-detail.js.map +6 -0
- package/dist/esm/testing/files.d.ts +8 -0
- package/dist/esm/testing/files.d.ts.map +1 -0
- package/dist/esm/testing/files.js +32 -0
- package/dist/esm/testing/files.js.map +6 -0
- package/dist/esm/testing/global-declarations.d.ts +38 -0
- package/dist/esm/testing/global-declarations.d.ts.map +1 -0
- package/dist/esm/testing/global-declarations.js +7 -0
- package/dist/esm/testing/global-declarations.js.map +6 -0
- package/dist/esm/testing/global-definitions.d.ts +7 -0
- package/dist/esm/testing/global-definitions.d.ts.map +1 -0
- package/dist/esm/testing/global-definitions.js +27 -0
- package/dist/esm/testing/global-definitions.js.map +6 -0
- package/dist/esm/testing/mocha.d.ts +36 -0
- package/dist/esm/testing/mocha.d.ts.map +1 -0
- package/dist/esm/testing/mocha.js +135 -0
- package/dist/esm/testing/mocha.js.map +6 -0
- package/dist/esm/testing/mocharc.cjs +68 -0
- package/dist/esm/testing/mocharc.d.cts +7 -0
- package/dist/esm/testing/mocks/crypto.d.ts +7 -0
- package/dist/esm/testing/mocks/crypto.d.ts.map +1 -0
- package/dist/esm/testing/mocks/crypto.js +59 -0
- package/dist/esm/testing/mocks/crypto.js.map +6 -0
- package/dist/esm/testing/mocks/environment.d.ts +7 -0
- package/dist/esm/testing/mocks/environment.d.ts.map +1 -0
- package/dist/esm/testing/mocks/environment.js +6 -0
- package/dist/esm/testing/mocks/environment.js.map +6 -0
- package/dist/esm/testing/mocks/index.d.ts +10 -0
- package/dist/esm/testing/mocks/index.d.ts.map +1 -0
- package/dist/esm/testing/mocks/index.js +10 -0
- package/dist/esm/testing/mocks/index.js.map +6 -0
- package/dist/esm/testing/mocks/logging.d.ts +28 -0
- package/dist/esm/testing/mocks/logging.d.ts.map +1 -0
- package/dist/esm/testing/mocks/logging.js +63 -0
- package/dist/esm/testing/mocks/logging.js.map +6 -0
- package/dist/esm/testing/mocks/time.d.ts +88 -0
- package/dist/esm/testing/mocks/time.d.ts.map +1 -0
- package/dist/esm/testing/mocks/time.js +230 -0
- package/dist/esm/testing/mocks/time.js.map +6 -0
- package/dist/esm/testing/node.d.ts +16 -0
- package/dist/esm/testing/node.d.ts.map +1 -0
- package/dist/esm/testing/node.js +78 -0
- package/dist/esm/testing/node.js.map +6 -0
- package/dist/esm/testing/options.d.ts +19 -0
- package/dist/esm/testing/options.d.ts.map +1 -0
- package/dist/esm/testing/options.js +42 -0
- package/dist/esm/testing/options.js.map +6 -0
- package/dist/esm/testing/reporter.d.ts +50 -0
- package/dist/esm/testing/reporter.d.ts.map +1 -0
- package/dist/esm/testing/reporter.js +107 -0
- package/dist/esm/testing/reporter.js.map +6 -0
- package/dist/esm/testing/runner.d.ts +22 -0
- package/dist/esm/testing/runner.d.ts.map +1 -0
- package/dist/esm/testing/runner.js +86 -0
- package/dist/esm/testing/runner.js.map +6 -0
- package/dist/esm/testing/web.d.ts +8 -0
- package/dist/esm/testing/web.d.ts.map +1 -0
- package/dist/esm/testing/web.js +135 -0
- package/dist/esm/testing/web.js.map +6 -0
- package/dist/esm/util/bootstrap.mjs +105 -0
- package/dist/esm/util/docker.d.ts +27 -0
- package/dist/esm/util/docker.d.ts.map +1 -0
- package/dist/esm/util/docker.js +133 -0
- package/dist/esm/util/docker.js.map +6 -0
- package/dist/esm/util/errors.d.ts +8 -0
- package/dist/esm/util/errors.d.ts.map +1 -0
- package/dist/esm/util/errors.js +35 -0
- package/dist/esm/util/errors.js.map +6 -0
- package/dist/esm/util/index.d.ts +8 -0
- package/dist/esm/util/index.d.ts.map +1 -0
- package/dist/esm/util/index.js +8 -0
- package/dist/esm/util/index.js.map +6 -0
- package/dist/esm/util/node-shims.d.ts +7 -0
- package/dist/esm/util/node-shims.d.ts.map +1 -0
- package/dist/esm/util/node-shims.js +11 -0
- package/dist/esm/util/node-shims.js.map +6 -0
- package/dist/esm/util/package.d.ts +61 -0
- package/dist/esm/util/package.d.ts.map +1 -0
- package/dist/esm/util/package.js +304 -0
- package/dist/esm/util/package.js.map +6 -0
- package/dist/esm/util/progress.d.ts +31 -0
- package/dist/esm/util/progress.d.ts.map +1 -0
- package/dist/esm/util/progress.js +202 -0
- package/dist/esm/util/progress.js.map +6 -0
- package/dist/esm/util/tools-path.cjs +13 -0
- package/dist/esm/util/tools-path.d.cts +7 -0
- package/dist/esm/util/trace-unhandled.d.ts +9 -0
- package/dist/esm/util/trace-unhandled.d.ts.map +1 -0
- package/dist/esm/util/trace-unhandled.js +18 -0
- package/dist/esm/util/trace-unhandled.js.map +6 -0
- package/dist/esm/util/wtf.d.ts +10 -0
- package/dist/esm/util/wtf.d.ts.map +1 -0
- package/dist/esm/util/wtf.js +23 -0
- package/dist/esm/util/wtf.js.map +6 -0
- package/dist/esm/versioning/cli.d.ts +7 -0
- package/dist/esm/versioning/cli.d.ts.map +1 -0
- package/dist/esm/versioning/cli.js +32 -0
- package/dist/esm/versioning/cli.js.map +6 -0
- package/dist/esm/versioning/versioner.d.ts +18 -0
- package/dist/esm/versioning/versioner.d.ts.map +1 -0
- package/dist/esm/versioning/versioner.js +115 -0
- package/dist/esm/versioning/versioner.js.map +6 -0
- package/package.json +82 -0
- package/src/building/builder.ts +216 -0
- package/src/building/cli.ts +89 -0
- package/src/building/error.ts +29 -0
- package/src/building/graph.ts +251 -0
- package/src/building/project.ts +313 -0
- package/src/building/tsconfig.ts +69 -0
- package/src/building/typescript/context.ts +85 -0
- package/src/building/typescript/incremental-compiler.ts +126 -0
- package/src/building/typescript/language-service.ts +132 -0
- package/src/building/typescript/solution-builder.ts +67 -0
- package/src/building/typescript.ts +15 -0
- package/src/index.ts +15 -0
- package/src/running/cli.ts +95 -0
- package/src/running/execute.ts +63 -0
- package/src/testing/chip/pics-file.ts +71 -0
- package/src/testing/chip/pics.properties +53 -0
- package/src/testing/chip.ts +420 -0
- package/src/testing/cli.ts +122 -0
- package/src/testing/failure-detail.ts +126 -0
- package/src/testing/files.ts +35 -0
- package/src/testing/global-declarations.ts +50 -0
- package/src/testing/global-definitions.ts +35 -0
- package/src/testing/index.html +16 -0
- package/src/testing/mocha.ts +162 -0
- package/src/testing/mocharc.cjs +68 -0
- package/src/testing/mocharc.d.cts +7 -0
- package/src/testing/mocks/crypto.ts +70 -0
- package/src/testing/mocks/environment.ts +7 -0
- package/src/testing/mocks/index.ts +10 -0
- package/src/testing/mocks/logging.ts +99 -0
- package/src/testing/mocks/time.ts +294 -0
- package/src/testing/node.ts +114 -0
- package/src/testing/options.ts +58 -0
- package/src/testing/reporter.ts +144 -0
- package/src/testing/runner.ts +98 -0
- package/src/testing/web.ts +174 -0
- package/src/tsconfig.json +14 -0
- package/src/util/bootstrap.mjs +105 -0
- package/src/util/docker.ts +176 -0
- package/src/util/errors.ts +33 -0
- package/src/util/index.ts +8 -0
- package/src/util/node-shims.ts +13 -0
- package/src/util/package.ts +369 -0
- package/src/util/progress.ts +252 -0
- package/src/util/tools-path.cjs +13 -0
- package/src/util/tools-path.d.cts +7 -0
- package/src/util/trace-unhandled.ts +17 -0
- package/src/util/wtf.ts +25 -0
- package/src/versioning/cli.ts +43 -0
- package/src/versioning/versioner.ts +139 -0
- package/test/testing/mocks/MockTimeTest.ts +113 -0
- package/test/tsconfig.json +15 -0
- package/tsc/tsconfig.app.json +7 -0
- package/tsc/tsconfig.base.json +41 -0
- package/tsc/tsconfig.lib.json +12 -0
- package/tsc/tsconfig.test.json +7 -0
- package/tsconfig.json +5 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Matter.js Tooling
|
|
2
|
+
|
|
3
|
+
This package supports build, test and execution infrastructure for other
|
|
4
|
+
matter.js packages.
|
|
5
|
+
|
|
6
|
+
> This package supports all Node.js LTS versions starting with 18.x
|
|
7
|
+
|
|
8
|
+
## Rational
|
|
9
|
+
|
|
10
|
+
Matter.js consists of a large number of generated TypeScript files. We support
|
|
11
|
+
multiple module formats targeting disparate JavaScript runtimes including Node
|
|
12
|
+
and web browsers. We publish a moderate (and growing) number of packages to
|
|
13
|
+
NPM. We support Linux, Windows and MacOS.
|
|
14
|
+
|
|
15
|
+
Previously, TSC analysis and test times had become quite slow. A proliferation
|
|
16
|
+
of configuration files for TSC and test framework was adding significant
|
|
17
|
+
redundancy to the codebase.
|
|
18
|
+
|
|
19
|
+
This package standardizes and centralizes configuration for build and test. It
|
|
20
|
+
minimizes reliance on TSC and generally does its best to run build and test as
|
|
21
|
+
quickly as possible.
|
|
22
|
+
|
|
23
|
+
## Dev workflow
|
|
24
|
+
|
|
25
|
+
Although Matter.js relies on third party tools for build and test, the
|
|
26
|
+
interface is command-line oriented and unique to Matter.js. As such it will be
|
|
27
|
+
unfamiliar to new developers.
|
|
28
|
+
|
|
29
|
+
To minimize developer burden, we also maintain traditional `tsconfig.json`
|
|
30
|
+
files with project references in each `src/` and `test/`. These files support
|
|
31
|
+
traditional IDE and `tsc --watch` workflows and are largely (but not entirely)
|
|
32
|
+
ignored by the tooling package.
|
|
33
|
+
|
|
34
|
+
These files do add configuration overhead but we minimize this with a shared
|
|
35
|
+
[tsconfig.base.json](tsconfig.base.json) supplied by this package.
|
|
36
|
+
|
|
37
|
+
We also supply a standard `.mocharc.cjs` in packages with tests. You can use
|
|
38
|
+
this with your IDE's Mocha integration for standard testing workflows.
|
|
39
|
+
|
|
40
|
+
## Build
|
|
41
|
+
|
|
42
|
+
We use [TSC](https://www.typescriptlang.org/docs/handbook/compiler-options.html)
|
|
43
|
+
to validate TypeScript types and generate declaration files. We
|
|
44
|
+
use [esbuild](https://esbuild.github.io/) for transcoding TypeScript to ESM
|
|
45
|
+
(ES6 module format) and CJS (CommonJS module format).
|
|
46
|
+
|
|
47
|
+
The [matter-build](./bin/build.js) script orchestrates TSC and esbuild. It
|
|
48
|
+
inspects `package.json` for the target module to determine whether to emit
|
|
49
|
+
ESM, CJS or both.
|
|
50
|
+
|
|
51
|
+
Use `matter-build --help` for command line usage. `matter-build --workspaces`
|
|
52
|
+
builds all workspace packages that have changed (or depend on other workspace
|
|
53
|
+
packages that have changed) since the last build.
|
|
54
|
+
|
|
55
|
+
`matter-build` itself is implemented in TypeScript. It uses `esbuild` to
|
|
56
|
+
bootstrap itself in fresh installs.
|
|
57
|
+
|
|
58
|
+
## Test
|
|
59
|
+
|
|
60
|
+
We run tests using [Mocha](https://mochajs.org/) with
|
|
61
|
+
[chai](https://www.chaijs.com/) for assertions. For multi-format modules we
|
|
62
|
+
run tests as both CJS and ESM. For packages that support browsers we run tests
|
|
63
|
+
in a headless browser using [Playwright](https://playwright.dev/).
|
|
64
|
+
|
|
65
|
+
The [matter-test](./bin/test.js) scripts orchestrates test execution. Use
|
|
66
|
+
`matter-test --help` for command line usage.
|
|
67
|
+
|
|
68
|
+
By default matter-test inspects `package.json` for the target module to
|
|
69
|
+
determine whether to test ESM, CJS or both under Node. Web tests do not run by
|
|
70
|
+
default but you can enable them using the `-w` option.
|
|
71
|
+
|
|
72
|
+
`matter-test` supports
|
|
73
|
+
environment variables of the form `MATTER_<OPTION>` for most command line
|
|
74
|
+
arguments. This includes `MATTER_SPEC`, `MATTER_PROFILE`, `MATTER_GREP`,
|
|
75
|
+
`MATTER_FGREP`, `MATTER_INVERT` and `MATTER_ALL_LOGS`.
|
|
76
|
+
|
|
77
|
+
Matter.js emits a significant volume of logging during testing. By default,
|
|
78
|
+
`matter-test` captures these logs internally and only emits them when
|
|
79
|
+
reporting on failed tests.
|
|
80
|
+
|
|
81
|
+
The test environment orchestrated by this package installs a small number of
|
|
82
|
+
Mocks for Matter.js infrastructure singletons.
|
|
83
|
+
[global-declarations.ts](src/testing/global-declarations.ts) defines a global
|
|
84
|
+
API for these mocks.
|
|
85
|
+
|
|
86
|
+
## Execution
|
|
87
|
+
|
|
88
|
+
The final command supplied by the tooling package is [matter-run](bin/run.js).
|
|
89
|
+
This command bootstraps tooling, transpiles the target module, and executes
|
|
90
|
+
the named JS or TS script.
|
|
91
|
+
|
|
92
|
+
`matter-run` understands Matter.js `package.json` conventions and
|
|
93
|
+
automatically transpiles typescript files in the target package prior to
|
|
94
|
+
execution.
|
|
95
|
+
|
|
96
|
+
`matter-run` accepts a script to run and passes other arguments to the script
|
|
97
|
+
verbatim.
|
|
98
|
+
|
|
99
|
+
If you set the environment variable `MATTER_ECHO`, `matter-run` will print the
|
|
100
|
+
command line prior to invoking a script.
|
package/bin/build.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import "../src/util/bootstrap.mjs";
|
|
4
|
+
|
|
5
|
+
// We do not use run script to avoid the performance hit so source maps are
|
|
6
|
+
// not enabled for the build script itself
|
|
7
|
+
|
|
8
|
+
// Run. Import dynamically because we may have just built
|
|
9
|
+
const main = (await import("../dist/esm/building/cli.js")).main;
|
|
10
|
+
await main();
|
package/bin/run.js
ADDED
package/bin/test.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env matter-run
|
|
2
|
+
|
|
3
|
+
// Use dynamic imports so we can thse modules before anything else
|
|
4
|
+
await(await import("../dist/esm/util/wtf.js")).wtf.initialize();
|
|
5
|
+
await(await import("../dist/esm/util/trace-unhandled.js")).traceUnhandled.initialize();
|
|
6
|
+
|
|
7
|
+
await (await import("../dist/esm/testing/cli.js")).main();
|
package/bin/version.js
ADDED
package/chip/Dockerfile
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
FROM ubuntu:22.04
|
|
2
|
+
|
|
3
|
+
SHELL ["/bin/bash", "-c"]
|
|
4
|
+
|
|
5
|
+
RUN apt-get -qq update
|
|
6
|
+
RUN apt-get -qq -y install git gcc g++ pkg-config libssl-dev libdbus-1-dev libglib2.0-dev libavahi-client-dev ninja-build \
|
|
7
|
+
python3-venv python3-dev python3-pip unzip libgirepository1.0-dev libcairo2-dev libreadline-dev
|
|
8
|
+
|
|
9
|
+
RUN git clone --depth=1 https://github.com/project-chip/connectedhomeip.git
|
|
10
|
+
WORKDIR /connectedhomeip
|
|
11
|
+
RUN ./scripts/checkout_submodules.py --shallow --platform linux
|
|
12
|
+
|
|
13
|
+
RUN source scripts/activate.sh && gn gen out/host && ninja -C out/host
|
|
14
|
+
|
|
15
|
+
RUN source scripts/activate.sh && ./scripts/build_python.sh --install_virtual_env /venv
|
|
16
|
+
|
|
17
|
+
ENV PATH="/venv/bin:$PATH"
|
|
18
|
+
|
|
19
|
+
RUN apt-get -qq -y install iproute2
|
|
20
|
+
|
|
21
|
+
WORKDIR /
|
|
22
|
+
|
|
23
|
+
ENTRYPOINT ["/venv/bin/python3", "-B"]
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022-2024 Matter.js Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Graph } from "./graph.js";
|
|
7
|
+
import { Project } from "./project.js";
|
|
8
|
+
import { TypescriptContext } from "./typescript/context.js";
|
|
9
|
+
export declare enum Target {
|
|
10
|
+
clean = "clean",
|
|
11
|
+
types = "types",
|
|
12
|
+
esm = "esm",
|
|
13
|
+
cjs = "cjs"
|
|
14
|
+
}
|
|
15
|
+
export interface Options {
|
|
16
|
+
targets?: Target[];
|
|
17
|
+
clean?: boolean;
|
|
18
|
+
graph?: Graph;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* High-level build coordination.
|
|
22
|
+
*
|
|
23
|
+
* Warning: This class is intended for command line use and will process.exit if things go wrong.
|
|
24
|
+
*/
|
|
25
|
+
export declare class Builder {
|
|
26
|
+
#private;
|
|
27
|
+
private options;
|
|
28
|
+
unconditional: boolean;
|
|
29
|
+
tsContext?: TypescriptContext;
|
|
30
|
+
graph?: Graph;
|
|
31
|
+
constructor(options?: Options);
|
|
32
|
+
configure(project: Project): Promise<void>;
|
|
33
|
+
build(project: Project): Promise<void>;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../../src/building/builder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAoB,OAAO,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,oBAAY,MAAM;IACd,KAAK,UAAU;IACf,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,GAAG,QAAQ;CACd;AAED,MAAM,WAAW,OAAO;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,KAAK,CAAC;CACjB;AAED;;;;GAIG;AACH,qBAAa,OAAO;;IAKJ,OAAO,CAAC,OAAO;IAJ3B,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC;gBAEM,OAAO,GAAE,OAAY;IAK5B,SAAS,CAAC,OAAO,EAAE,OAAO;IAkB1B,KAAK,CAAC,OAAO,EAAE,OAAO;CA0JtC"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var builder_exports = {};
|
|
30
|
+
__export(builder_exports, {
|
|
31
|
+
Builder: () => Builder,
|
|
32
|
+
Target: () => Target
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(builder_exports);
|
|
35
|
+
var import_ansi_colors = __toESM(require("ansi-colors"), 1);
|
|
36
|
+
var import_crypto = require("crypto");
|
|
37
|
+
var import_error = require("./error.js");
|
|
38
|
+
var import_graph = require("./graph.js");
|
|
39
|
+
var import_typescript = require("./typescript.js");
|
|
40
|
+
/**
|
|
41
|
+
* @license
|
|
42
|
+
* Copyright 2022-2024 Matter.js Authors
|
|
43
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
44
|
+
*/
|
|
45
|
+
var Target = /* @__PURE__ */ ((Target2) => {
|
|
46
|
+
Target2["clean"] = "clean";
|
|
47
|
+
Target2["types"] = "types";
|
|
48
|
+
Target2["esm"] = "esm";
|
|
49
|
+
Target2["cjs"] = "cjs";
|
|
50
|
+
return Target2;
|
|
51
|
+
})(Target || {});
|
|
52
|
+
class Builder {
|
|
53
|
+
constructor(options = {}) {
|
|
54
|
+
this.options = options;
|
|
55
|
+
this.unconditional = options.clean || options.targets !== void 0 && options.targets?.indexOf("clean" /* clean */) !== -1;
|
|
56
|
+
}
|
|
57
|
+
unconditional;
|
|
58
|
+
tsContext;
|
|
59
|
+
graph;
|
|
60
|
+
async configure(project) {
|
|
61
|
+
if (!project.pkg.hasConfig) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const progress = project.pkg.start("Configuring");
|
|
65
|
+
try {
|
|
66
|
+
await project.configure(progress);
|
|
67
|
+
} catch (e) {
|
|
68
|
+
progress.shutdown();
|
|
69
|
+
process.stderr.write(`${e.stack ?? e.message}
|
|
70
|
+
|
|
71
|
+
`);
|
|
72
|
+
process.exit(1);
|
|
73
|
+
}
|
|
74
|
+
progress.shutdown();
|
|
75
|
+
}
|
|
76
|
+
async build(project) {
|
|
77
|
+
const progress = project.pkg.start("Building");
|
|
78
|
+
try {
|
|
79
|
+
await this.#doBuild(project, progress);
|
|
80
|
+
} catch (e) {
|
|
81
|
+
progress.shutdown();
|
|
82
|
+
process.stderr.write(`${e.stack ?? e.message}
|
|
83
|
+
|
|
84
|
+
`);
|
|
85
|
+
process.exit(1);
|
|
86
|
+
}
|
|
87
|
+
progress.shutdown();
|
|
88
|
+
}
|
|
89
|
+
async #doBuild(project, progress) {
|
|
90
|
+
const targets = this.#selectTargets(project);
|
|
91
|
+
if (targets.has("clean" /* clean */) || this.options.clean) {
|
|
92
|
+
await progress.run("Clean", () => project.clean());
|
|
93
|
+
}
|
|
94
|
+
if (!targets.has("types" /* types */) && !targets.has("esm" /* esm */) && !targets.has("cjs" /* cjs */)) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const info = {};
|
|
98
|
+
const config = await project.configure(progress);
|
|
99
|
+
await config?.before?.({ project, progress });
|
|
100
|
+
const graph = this.graph ?? await import_graph.Graph.forProject(project.pkg.path);
|
|
101
|
+
let node;
|
|
102
|
+
if (graph) {
|
|
103
|
+
node = graph.get(project.pkg.name);
|
|
104
|
+
for (const dep of node.dependencies) {
|
|
105
|
+
if (dep.info.apiSha !== void 0) {
|
|
106
|
+
if (info.dependencyApiShas === void 0) {
|
|
107
|
+
info.dependencyApiShas = {};
|
|
108
|
+
}
|
|
109
|
+
info.dependencyApiShas[dep.pkg.name] = dep.info.apiSha;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (targets.has("types" /* types */)) {
|
|
114
|
+
try {
|
|
115
|
+
let context = this.tsContext;
|
|
116
|
+
if (context === void 0) {
|
|
117
|
+
context = this.tsContext = await (0, import_typescript.createTypescriptContext)(
|
|
118
|
+
project.pkg.workspace,
|
|
119
|
+
graph,
|
|
120
|
+
progress.refresh.bind(progress)
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
if (project.pkg.isLibrary) {
|
|
124
|
+
const apiSha = (0, import_crypto.createHash)("sha1");
|
|
125
|
+
if (node) {
|
|
126
|
+
for (const dep of node.dependencies) {
|
|
127
|
+
if (dep.info.apiSha !== void 0) {
|
|
128
|
+
apiSha.update(dep.info.apiSha);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
await progress.run(
|
|
133
|
+
`Generate ${progress.emphasize("type declarations")}`,
|
|
134
|
+
() => context.build(project.pkg, "src")
|
|
135
|
+
);
|
|
136
|
+
await progress.run(
|
|
137
|
+
`Install ${progress.emphasize("type declarations")}`,
|
|
138
|
+
() => project.installDeclarations(apiSha)
|
|
139
|
+
);
|
|
140
|
+
info.apiSha = apiSha.digest("hex");
|
|
141
|
+
} else {
|
|
142
|
+
await progress.run(
|
|
143
|
+
`Validate ${progress.emphasize("types")}`,
|
|
144
|
+
() => context.build(project.pkg, "src", false)
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
if (project.pkg.hasTests) {
|
|
148
|
+
await progress.run(
|
|
149
|
+
`Validate ${progress.emphasize("test types")}`,
|
|
150
|
+
() => context.build(project.pkg, "test")
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
} catch (e) {
|
|
154
|
+
if (e instanceof import_error.BuildError) {
|
|
155
|
+
progress.failure("Terminating due to type errors");
|
|
156
|
+
process.stderr.write(e.diagnostics);
|
|
157
|
+
process.exit(1);
|
|
158
|
+
}
|
|
159
|
+
throw e;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
if (targets.has("esm" /* esm */)) {
|
|
163
|
+
await this.#transpile(project, progress, "esm" /* esm */);
|
|
164
|
+
}
|
|
165
|
+
if (targets.has("cjs" /* cjs */)) {
|
|
166
|
+
await this.#transpile(project, progress, "cjs" /* cjs */);
|
|
167
|
+
}
|
|
168
|
+
await config?.after?.({ project, progress });
|
|
169
|
+
if (!this.options.targets?.length) {
|
|
170
|
+
await project.recordBuildInfo(info);
|
|
171
|
+
if (node) {
|
|
172
|
+
node.info = info;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
async #transpile(project, progress, format) {
|
|
177
|
+
const fmt = format.toUpperCase();
|
|
178
|
+
await progress.run(
|
|
179
|
+
`Transpile ${progress.emphasize("library")} to ${import_ansi_colors.default.bold(fmt)}`,
|
|
180
|
+
() => project.buildSource(format)
|
|
181
|
+
);
|
|
182
|
+
if (project.pkg.hasTests) {
|
|
183
|
+
await progress.run(
|
|
184
|
+
`Transpile ${progress.emphasize("tests")} to ${import_ansi_colors.default.bold(fmt)}`,
|
|
185
|
+
() => project.buildTests(format)
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
#selectTargets(project) {
|
|
190
|
+
const targets = new Set(this.options.targets);
|
|
191
|
+
if (!targets.size) {
|
|
192
|
+
targets.add("types" /* types */);
|
|
193
|
+
if (project.pkg.supportsEsm) {
|
|
194
|
+
targets.add("esm" /* esm */);
|
|
195
|
+
}
|
|
196
|
+
if (project.pkg.supportsCjs) {
|
|
197
|
+
targets.add("cjs" /* cjs */);
|
|
198
|
+
}
|
|
199
|
+
} else {
|
|
200
|
+
if (!project.pkg.supportsEsm) {
|
|
201
|
+
targets.delete("esm" /* esm */);
|
|
202
|
+
}
|
|
203
|
+
if (!project.pkg.supportsCjs) {
|
|
204
|
+
targets.delete("cjs" /* cjs */);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return targets;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=builder.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
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