Code Monkey home page Code Monkey logo

generator-tsx's Introduction

TSX Yeoman Generator

GitHub Workflow NPM version npm license codecov Greenkeeper badge code style: prettier Netlify Status

screenshot

Goals

See Design Goals.

Features

Configuration

Add the following GitHub secrets to your repo:

  • CODECOV_TOKEN
  • NPM_TOKEN

Installation

First, install Yeoman and generator-tsx using npm (we assume you have pre-installed Node.js).

npm install -g yo generator-tsx

Next, create a new folder for your project:

mkdir project-x
cd project-x

Finally, run the tsx generator to create your initial project files:

yo tsx [<appname>] [<version>] [options]

Project files are generated in the project-x directory.

Run yo tsx --help for more information about arguments and options.

Sub-generators

All generators create project files including tests.

actions

yo tsx:actions foo

Creates Redux Actions in src/actions/foo/*.

This action also modifies src/actions/index.ts.

api

yo tsx:api foo

Creates an API client in src/api/foo/*.

component

yo tsx:component Foo [--connect]

Creates a React Component as a simple function in src/components/Foo/*.

helper

yo tsx:helper foo

Creates a helper function named foo and places it in src/helpers/foo.ts (supports slashes in the name for folder depth).

model

yo tsx:model Foo

Creates a model, defined as a TypeScript Interface, in src/models/Foo.ts.

reducer

yo tsx:reducer foo

Creates a Redux Reducer in src/reducers/foo/*.

theme

yo tsx:theme foo

Creates a theme in src/themes/foo that is modeled after your existing src/models/Theme.ts interface.

util

yo tsx:util foo

Creates a utility function named foo and places it in src/utils/foo.ts (supports slashes in the name for folder depth).

Roadmap

For details on our planned features and future direction, please refer to our roadmap.

Getting To Know Yeoman

  • Yeoman has a heart of gold.
  • Yeoman is a person with feelings and opinions, but is very easy to work with.
  • Yeoman can be too opinionated at times but is easily convinced not to be.
  • Feel free to learn more about Yeoman.

Contributing

Contributions are welcomed! Read the Contributing Guide for more information.

Licensing

This project is licensed under the Apache V2 License. See LICENSE for more information.

generator-tsx's People

Contributors

dependabot[bot] avatar greenkeeper[bot] avatar jedmao avatar jednano avatar semantic-release-bot avatar

Stargazers

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

Watchers

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

generator-tsx's Issues

Please ensure license headers, code of conduct and contributor guidelines are in place

TL;DR copy files over from github.com/adobe/starter-repo

Before adding any code to this repo, please ensure you have in place:

  • an Adobe Legal-approved code of conduct
  • a CONTRIBUTING.md that at a minimum references the need for external contributors to sign Adobe's CLA
  • license headers in all source files compatible with your chosen license.

These are requirements from Adobe's legal department. If you'd like help with this, please fill out the form at opensource.corp.adobe.com.

Thanks!
-Fil, Adobe Open Source Office

An in-range update of coveralls is breaking the build 🚨

The devDependency coveralls was updated from 3.0.5 to 3.0.6.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

coveralls is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

Commits

The new version differs by 3 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/yeoman-generator is breaking the build 🚨

The devDependency @types/yeoman-generator was updated from 3.1.3 to 3.1.4.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/yeoman-generator is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of commitlint is breaking the build 🚨

There have been updates to the commitlint monorepo:

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the commitlint group definition.

commitlint is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

Commits

The new version differs by 39 commits.

  • c17420d v8.1.0
  • ca19d70 chore: update dependency lodash to v4.17.14 (#724)
  • 5757ef2 build(deps): bump lodash.template from 4.4.0 to 4.5.0 (#721)
  • 5b5f855 build(deps): bump lodash.merge from 4.6.0 to 4.6.2 (#722)
  • 4cb979d build(deps): bump lodash from 4.17.11 to 4.17.13 (#723)
  • a89c1ba chore: add devcontainer setup
  • 9aa5709 chore: pin dependencies (#714)
  • c9ef5e2 chore: centralize typescript and jest setups (#710)
  • c9dcf1a chore: pin dependencies (#708)
  • 6a6a8b0 refactor: rewrite top level to typescript (#679)
  • 0fedbc0 chore: update dependency @types/jest to v24.0.15 (#694)
  • 0b9c7ed chore: update dependency typescript to v3.5.2 (#695)
  • 4efb34b chore: update dependency globby to v10 (#705)
  • 804af8b chore: update dependency lint-staged to v8.2.1 (#696)
  • 9075844 fix: add explicit dependency on chalk (#687)

There are 39 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @typescript-eslint/eslint-plugin is breaking the build 🚨

The devDependency @typescript-eslint/eslint-plugin was updated from 1.9.0 to 1.10.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@typescript-eslint/eslint-plugin is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Support polyfill

I really like this generator. But now I am having the problem to add polyfill support (e.g. support old Chrome and IE11 etc).

I want to use core-js. relay-compiler demands core-js2, while using core-js2, I come across this:

[craco] =============
[craco] Failed to compile.
[craco] 
[craco] ./src/index.tsx
[craco] Module not found: Can't resolve 'core-js/modules/es.array-buffer.constructor' in 'd:\me\svn\FE\src'

I know es.array-buffer is core-js3 feature, but I have no clue to find out which package wants it.

In summary, will the support of polyfill be added to the roadmap, or could you give me some hint on how to track this error?

An in-range update of tslib is breaking the build 🚨

The dependency tslib was updated from 1.9.3 to 1.10.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

tslib is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details

Release Notes for tslib 1.10.0

This release fixes enumerability in object rest's __rest helper (see details here) and adds a new __spreadArrays helper (done as part of a change for more accurate array spreads).

Commits

The new version differs by 5 commits.

  • e1aae12 Update version to '1.10.0'.
  • ab40523 Add '__spreadArrays' helper (#67)
  • 57efce4 Modified __rest to check if property is enumerable. (#66)
  • ca03390 Merge pull request #57 from styfle/patch-1
  • b99cbbc Update .npmignore

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

Polyfill breaks again

Bug Report

Describe the bug

On IE11, an error shows as in the screenshot. The same codes work well in Chrome and Firefox.

The IE console error is

DOM7011: The code on this page disabled back and forward caching. For more information, see: http://go.microsoft.com/fwlink/?LinkID=291337
localhost:11207
HTML1300: Navigation occurred.
localhost:11207

SCRIPT5079: Cannot modify non-writable property 'length'
4.chunk.js (39279,13)
The above error occurred in one of your React components:
    in Unknown (created by Context.Consumer)
    in Route (at App.tsx:26)
    in Switch (at App.tsx:25)
    in Suspense (at App.tsx:24)
    in App (at src/index.tsx:27)
    in Router (created by BrowserRouter)
    in BrowserRouter (at createProviders.tsx:26)
    in IntlProvider (at createProviders.tsx:22)
    in Provider (at createProviders.tsx:18)
    in Unknown (at createProviders.tsx:21)
    in Unknown (at src/index.tsx:26)

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://fb.me/react-error-boundaries to learn more about error boundaries.
The development server has disconnected.
Refresh the page if necessary.
TypeError: Object doesn't support property or method 'repeat'
   {
      [functions]: ,
      __proto__: { },
      description: "Object doesn't support property or method 'repeat'",
      message: "Object doesn't support property or method 'repeat'",
      name: "TypeError",
      number: -2146827850,
      stack: "TypeError: Object doesn't support property or method 'repeat'
   at Anonymous function (Unknown script code:1:105285)
   at i (Unknown script code:1:105071)
   at ee (Unknown script code:1:288639)
   at Yu (Unknown script code:1:197888)
   at No (Unknown script code:1:210278)
   at Gi (Unknown script code:1:235769)
   at $i (Unknown script code:1:236156)
   at Ta (Unknown script code:1:243056)
   at ka (Unknown script code:1:242436)
   at Ea (Unknown script code:1:241457)",
      Symbol()_9.yxk4rhhbw55: undefined,
      Symbol(react.concurrent_mode)_r.yxk4rhhbw55: undefined,
      Symbol(react.context)_q.yxk4rhhbw55: undefined,
      Symbol(react.element)_k.yxk4rhhbw55: undefined,
      Symbol(react.forward_ref)_s.yxk4rhhbw55: undefined,
      Symbol(react.fragment)_m.yxk4rhhbw55: undefined,
      Symbol(react.lazy)_v.yxk4rhhbw55: undefined,
      Symbol(react.memo)_u.yxk4rhhbw55: undefined,
      Symbol(react.portal)_l.yxk4rhhbw55: undefined,
      Symbol(react.profiler)_o.yxk4rhhbw55: undefined,
      Symbol(react.provider)_p.yxk4rhhbw55: undefined,
      Symbol(react.strict_mode)_n.yxk4rhhbw55: undefined,
      Symbol(react.suspense)_t.yxk4rhhbw55: undefined
   }

SCRIPT438: Object doesn't support property or method 'repeat'
script block (26) (1,242617)
Unhandled promise rejection TypeError: Cannot modify non-writable property 'length'
   "Unhandled promise rejection"
   {
      [functions]: ,
      __proto__: { },
      description: "Cannot modify non-writable property 'length'",
      message: "Cannot modify non-writable property 'length'",
      name: "TypeError",
      number: -2146823209,
      stack: "TypeError: Cannot modify non-writable property 'length'
   at defineProperty (http://localhost:11207/static/js/4.chunk.js:23979:3)
   at mimicFn (http://localhost:11207/static/js/1.chunk.js:266042:7)
   at module.exports (http://localhost:11207/static/js/1.chunk.js:266099:5)
   at Anonymous function (http://localhost:11207/static/js/1.chunk.js:270250:3)
   at createCommonjsModule (http://localhost:11207/static/js/1.chunk.js:230234:3)
   at Anonymous function (http://localhost:11207/static/js/1.chunk.js:270236:1)
   at ./node_modules/prettier/index.js (http://localhost:11207/static/js/1.chunk.js:229979:29)
   at __webpack_require__ (http://localhost:11207/static/js/bundle.js:787:12)
   at fn (http://localhost:11207/static/js/bundle.js:150:13)
   at ./src/components/Legacy/js/app/viewer.js (http://localhost:11207/static/js/2.chunk.js:3458:22)
   at __webpack_require__ (http://localhost:11207/static/js/bundle.js:787:12)
   at fn (http://localhost:11207/static/js/bundle.js:150:13)
   at ./src/components/Legacy/js",
      Symbol()_5.qwjdeh4i5vk: undefined,
      Symbol(allowStale)_16.qwjdeh4i5l: undefined,
      Symbol(cache)_1b.qwjdeh4i5l: undefined,
      Symbol(child-nodes)_10.qwjdeh4i5l: undefined,
      Symbol(cursor)_11.qwjdeh4i5l: undefined,
      Symbol(cursor)_z.qwjdeh4i5lt: undefined,
      Symbol(dispose)_18.qwjdeh4i5l: undefined,
      Symbol(length)_14.qwjdeh4i5l: undefined,
      Symbol(lengthCalculator)_15.qwjdeh4i5l: undefined,
      Symbol(lruList)_1a.qwjdeh4i5l: undefined,
      Symbol(max)_13.qwjdeh4i5l: undefined,
      Symbol(maxAge)_17.qwjdeh4i5l: undefined,
      Symbol(node-ignore)_12.qwjdeh4i5l: undefined,
      Symbol(noDisposeOnSet)_19.qwjdeh4i5l: undefined,
      Symbol(react.async_mode)_x.qwjdeh4i5lt: undefined,
      Symbol(react.concurrent_mode)_s.qwjdeh4i5yt: undefined,
      Symbol(react.context)_r.qwjdeh4i5yt: undefined,
      Symbol(react.element)_l.qwjdeh4i5yt: undefined,
      Symbol(react.forward_ref)_t.qwjdeh4i5yt: undefined,
      Symbol(react.fragment)_n.qwjdeh4i5yt: undefined,
      Symbol(react.lazy)_w.qwjdeh4i5lt: undefined,
      Symbol(react.memo)_v.qwjdeh4i5yt: undefined,
      Symbol(react.portal)_m.qwjdeh4i5yt: undefined,
      Symbol(react.profiler)_p.qwjdeh4i5yt: undefined,
      Symbol(react.provider)_q.qwjdeh4i5yt: undefined,
      Symbol(react.strict_mode)_o.qwjdeh4i5yt: undefined,
      Symbol(react.suspense)_u.qwjdeh4i5yt: undefined,
      Symbol(util.promisify.custom)_y.qwjdeh4i5lt: undefined
   }

The codes are:

// These must be the first lines in src/index.js
import 'react-app-polyfill/ie11'
import 'react-app-polyfill/stable'
import 'proxy-polyfill'

import React, { lazy, Suspense } from 'react'
import Helmet from 'react-helmet'
import { Route, Switch } from 'react-router-dom'
import { FormattedMessage } from 'react-intl'

// import Nav from '../Nav'
import Spinner from '../Spinner'

const Legacy = lazy(() => import('../Legacy'))
const NotFound = lazy(() => import('../NotFound'))

// Add this to show a nav bar.
// 		<Nav />

const App: React.SFC = () => (
	<>
		<FormattedMessage id="page.image.title">
			{title => (
				<Helmet>
					<title>{title}</title>
				</Helmet>
			)}
		</FormattedMessage>
		<Suspense fallback={<Spinner />}>
			<Switch>
				<Route path="/" exact component={Legacy} />
				<Route component={NotFound} />
			</Switch>
		</Suspense>
	</>
)

export default App

Big refactor without README update

Question

Recently I do yo tsx newApp, and find that yo tsx:api someApi will not create src/api, and the total architecture is different, e.g. components/Routers are added. Is there any new usage README? Looks like yo functionalities are broken.

Description

words

[Security] Workflow master.yml is using vulnerable action actions/checkout

The workflow master.yml is referencing action actions/checkout using references v1. However this reference is missing the commit a6747255bd19d7a757dbdda8c654a9f84db19839 which may contain fix to the some vulnerability.
The vulnerability fix that is missing by actions version could be related to:
(1) CVE fix
(2) upgrade of vulnerable dependency
(3) fix to secret leak and others.
Please consider to update the reference to the action.

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.