# @smartworld.team/npx-update-template

> Updating Template Repositories

Latest version **1.0.2** (published 2022-04-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install @smartworld.team/npx-update-template
pnpm add @smartworld.team/npx-update-template
yarn add @smartworld.team/npx-update-template
bun add @smartworld.team/npx-update-template
```

Provides the command `npx-update-template`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-04-01 |
| First published | 2022-03-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 89.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nikita Vtorushin |
| Maintainers | smartworld-llc, nikitavoryet |
| Keywords | github, template, repo, tool, tooling, nodejs, typescript, update-template, npx-update-template, npx-template, npx |

## Links

- npm: https://www.npmjs.com/package/@smartworld.team/npx-update-template
- Repository: https://github.com/SmartWorld-LLC/npx-update-template
- Homepage: https://github.com/SmartWorld-LLC/npx-update-template#readme
- Issues: https://github.com/SmartWorld-LLC/npx-update-template/issues
- npm.io page: https://npm.io/package/@smartworld.team/npx-update-template

## Dependencies (7)

- [semver](https://npm.io/package/semver.md) ^7.3.5
- [ts-node](https://npm.io/package/ts-node.md) ^10.6.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^10.0.1
- [fast-glob](https://npm.io/package/fast-glob.md) ^3.2.11
- [deep-equal](https://npm.io/package/deep-equal.md) ^2.0.5
- [ansi-colors](https://npm.io/package/ansi-colors.md) ^4.1.1
- [eslint-config-google](https://npm.io/package/eslint-config-google.md) ^0.14.0

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2022-04-01
- 1.0.1 — 2022-03-22
- 1.0.0 — 2022-03-22

## README

# npx-update-template
[![NPM version](https://img.shields.io/npm/v/@smartworld.team/npx-update-template.svg?style=flat)](https://npmjs.org/package/@smartworld.team/npx-update-template)
[![NPM downloads](https://img.shields.io/npm/dm/@smartworld.team/npx-update-template.svg?style=flat)](https://npmjs.org/package/@smartworld.team/npx-update-template)

When creating a repository template, there is a problem with updating a child repository, this package will help you make updates almost painlessly.
At the moment, automation is that this package will reduce the update to actions that cannot be done without a person. The repository will be updated and uploaded to a specific branch named: template. After all the updates - you just have to merge the two branches and test.
## Get started
### How to use

### Install npm package in you template repo:

```
npm i @smartworld.team/npx-update-template
```

### Create a file at the root template repo:

```
touch .templaterc.json
```

### The file must consist of an object:

```
{
  directories?: Array<string>;
  templateDir?: string;
  npmDependencies?: boolean;
  npmScripts?: boolean;
  packageFile?: string;
}
```

### Example .templaterc.json 

```json
{
  "directories": ["template/src/**/*.ts", "template/core/**/*.*"],
  "templateDir": "template",
  "packageFile": "template",
  "npmDependencies": true,
  "npmScripts": true
}
```

```
directories     - An array containing the full path to the folder with masks
templateDir     - If you have a separate folder responsible for the content of the template, you need to specify where exactly the files are located
packageFile     - You can specify which dependencies to update
npmDependencies - There is a version check logic, if the template has an older version, then the version of the child repository will not be replaced. If the template is updated and has a more current version - the dependency will be replaced with the version from the template
npmScripts      - Whether scripts need to be updated. If the script already exists, the replacement will not be performed, this flag will add only non-existing scripts
```

### Script For update:
To update, create a command inside your template
```json
{
  "scripts": {
    "update": "npx-update-template git@github.com:SmartWorld-LLC/npx-update-template.git"
  }
}
```

<details>
  <summary>Charts</summary>

<details>
  <summary>Sketchy Update</summary>
  <img src="./charts/sketchy_update.svg" alt='sketchy_update'>
</details>

<details>
  <summary>Merge Object</summary>
  <img src="./charts/merge_object.svg" alt='merge_object'>
</details>

<details>
  <summary>Compare Version</summary>
  <img src="./charts/compare_version.svg" alt='compare_version'>
</details>

</details>


## 📄 License

[MIT](./LICENSE) © [SmartWorld](https://smartworld.team)


<p align="center">
  <sub>An open source project by <a href="https://smartworld.team">SmartWorld</a> </sub>
</p>

---
_Source: https://npm.io/package/@smartworld.team/npx-update-template · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
