matter.js
d35d53b4 - Add an "npm init" bootstrapping tool for matter.js (#1320)

Commit
17 days ago
Add an "npm init" bootstrapping tool for matter.js (#1320) * Add an "npm init" bootstrapping tool for matter.js Adds the package `@matter/create`. This will create a new matter.js-based project with appropriate package.json, tsconfig, and skeleton files that use our examples as templates. It uses the first line from the example's README.md to describe the template in the help and ignores examples that have no README.md. The tool works as follows: * `npm init @matter` creates a new project using a default template * `npm init @matter <template>` initializes based on a different template * `npm init @matter help` gives detailed help As part of this I put some time into improving our dependency graphs which had gotten quite hairy in a few places. Mostly this didn't affect production code but it did force developers to install a huge number of unnecessary packages. Dependency optimizations include: * The new "@matter/create" has zero dependencies so it gives the user feedback as quickly as possible * @matter/main no longer loads @matter/react-native automatically. This avoids a massive dependency graph that includes many deprecated packages * Testing code is now in new package @matter/testing rather than @matter/tools. This was responsible for most of the tooling dependencies * Replaced yargs (many deps) with commander (no deps) in @matter/tools, @matter/testing and @matter/cli-tool * Replaced "glob" (many deps) with our own version based on minimatch (2 deps but used by npm so reasonable) * Remove v8-profiler-next (many deps) from testing, use node's native v8 inspector API instead Includes a completely unrelated change to element constructors in @matter/model. Doesn't affect anything currently but will allow generated model files to be more concise once I get a chance to tweak the generator. * Fix for node 18 Disables profiler on node 18 because it doesn't support the promisified inspector API * Fix crypto shim for node 18 Mm, thanks prettier :)
Author
Parents
Loading