GithubHelp home page GithubHelp logo

create's Introduction

@sxzz/create npm

Command-line for creating projects from templates.

Install

npm i -g @sxzz/create

Usage

create [path]
# e.g: create hello-world

Configuration

Most formats of configuration are supported. The configuration file is located in $HOME/.config/create.config.[js,mjs,ts,mts,json,yml,yaml]

TypeScript Schema

URL format: repo[/subpath][#ref]. See examples.

Run create config to modify config.

git:
  init: true # optional, defaults to true

templates:
  - name: Library # must be unique
    # color: '#008800' # optional
    children:
      - name: TypeScript
        color: '#3178c6'
        url: sxzz/node-lib-starter # remote URL or local path
  - name: Web App
    url: xxxxx
    git:
      init: false # overwrite global config

Sponsors

Credits

License

MIT License Β© 2022-PRESENT 三咲智子

create's People

Contributors

duowb avatar mys1024 avatar renovate[bot] avatar sxzz avatar twoke945 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

create's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): update all non-major dependencies (@types/node, bumpp, eslint, pnpm)

Detected dependencies

github-actions
.github/workflows/release.yml
  • actions/checkout v4
  • actions/setup-node v4
npm
package.json
  • @antfu/utils ^0.7.10
  • cac ^6.7.14
  • chalk ^5.3.0
  • consola ^3.2.3
  • escape-string-regexp ^5.0.0
  • execa ^9.3.1
  • find-up ^7.0.0
  • giget ^1.2.3
  • js-yaml ^4.1.0
  • prompts ^2.4.2
  • replace-in-file ^8.1.0
  • unconfig ^0.5.5
  • @sxzz/eslint-config ^3.17.3
  • @sxzz/prettier-config ^2.0.2
  • @types/js-yaml ^4.0.9
  • @types/node ^22.4.2
  • @types/prompts ^2.4.9
  • bumpp ^9.5.1
  • eslint ^9.9.0
  • prettier ^3.3.3
  • tsup ^8.2.4
  • tsx ^4.17.0
  • typescript ^5.5.4
  • pnpm 9.7.1

  • Check this box to trigger a request for Renovate to run again on this repository

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Location: .github/renovate.json5
Error type: The renovate configuration file contains some invalid settings
Message: Invalid configuration option: node

Failed to download template from github: Cannot read property 'repo' of undefined

Describe the bug

> create test
√ Pick a template » Library
√ Pick a template » TypeScript

 ERROR  Failed to download template from github: Cannot read property 'repo' of undefined                                                                                                                                          16:47:47

  at /C:/Users/duowe/AppData/Roaming/nvm/v14.19.3/node_modules/@sxzz/create/node_modules/giget/dist/shared/giget.dd19862e.mjs:152:11
  at processTicksAndRejections (internal/process/task_queues.js:95:5)
  at async downloadTemplate (/C:/Users/duowe/AppData/Roaming/nvm/v14.19.3/node_modules/@sxzz/create/node_modules/giget/dist/shared/giget.dd19862e.mjs:151:20)
  at async create (/C:/Users/duowe/AppData/Roaming/nvm/v14.19.3/node_modules/@sxzz/create/dist/chunk-BEWY7M6W.js:114:3)
  at async run (/C:/Users/duowe/AppData/Roaming/nvm/v14.19.3/node_modules/@sxzz/create/dist/chunk-BEWY7M6W.js:38:3)
 npx giget@latest [email protected]:sxzz/node-lib-starter.git
npx: installed 17 in 4.935s
Error: Failed to download template from registry: request to https://raw.githubusercontent.com/unjs/giget/main/templates/[email protected]:sxzz/node-lib-starter.git.json failed, reason: unable to verify the first certificate
    at file:///C:/Users/duowe/AppData/Roaming/npm-cache/_npx/6520/node_modules/giget/dist/shared/giget.5e7ec864.mjs:158:11
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async downloadTemplate (file:///C:/Users/duowe/AppData/Roaming/npm-cache/_npx/6520/node_modules/giget/dist/shared/giget.5e7ec864.mjs:157:20)
    at async main (file:///C:/Users/duowe/AppData/Roaming/npm-cache/_npx/6520/node_modules/giget/dist/cli.mjs:32:13)
 npx giget@latest [email protected]:sxzz/node-lib-starter.git
npx: installed 17 in 1.938s
Error: Failed to download template from registry: Failed to download [email protected]:sxzz/node-lib-starter.git template info from https://raw.githubusercontent.com/unjs/giget/main/templates/[email protected]:sxzz/node-lib-starter.git.json: 404 Not Found
    at file:///C:/Users/duowe/AppData/Roaming/npm-cache/_npx/18988/node_modules/giget/dist/shared/giget.5e7ec864.mjs:158:11
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async downloadTemplate (file:///C:/Users/duowe/AppData/Roaming/npm-cache/_npx/18988/node_modules/giget/dist/shared/giget.5e7ec864.mjs:157:20)
    at async main (file:///C:/Users/duowe/AppData/Roaming/npm-cache/_npx/18988/node_modules/giget/dist/cli.mjs:32:13)
// config.ts

import type { Config } from 'C:/Users/duowe/AppData/Roaming/nvm/v14.19.3/node_modules/@sxzz/create/dist/types'

const config: Config = {
  "git": {
    "add": true
  },
  "templates": [
    {
      "name": "Library",
      "color": "green",
      "children": [
        {
          "name": "TypeScript",
          "color": "#3178c6",
          "url": "[email protected]:sxzz/node-lib-starter.git"
        }
      ]
    },
    {
      "name": "Web App",
      "url": "[email protected]:sxzz/node-lib-starter.git",
      "git": {
        "init": false
      }
    }
  ]
}

export default config

Reproduction

None

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (8) x64 Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
    Memory: 4.25 GB / 15.71 GB
  Binaries:
    Node: 14.19.3 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 6.14.17 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (107.0.1418.52)
    Internet Explorer: 11.0.19041.1566

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.