Skip to content

Instantly share code, notes, and snippets.

{
"name": "test-web",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/test-web/src",
"projectType": "application",
"targets": {
// ...
"serve-fullstack": {
"executor": "@nx-trpc-example/plugin:serve-fullstack",
"options": {
import { ServeFullstackExecutorSchema } from './schema';
import { ExecutorContext } from '@nrwl/devkit';
import { ChildProcess, exec } from 'child_process';
import * as chalk from 'chalk';
const LARGE_BUFFER = 1024 * 1000000;
export default async function runExecutor(
options: ServeFullstackExecutorSchema,
_context: ExecutorContext
function prefixTerminalOutput(cp: ChildProcess, prefix: string) {
function logWithPrefix(data: string) {
if (!data) {
return;
}
console.log(
data
.split('\n')
.map((line) => `${prefix} ${line}`)
.join('\n')
async function startBackendServer(options: ServeFullstackExecutorSchema) {
let frontendServerStarted = false;
return new Promise(() => {
const childProcess = exec(`npx nx serve ${options.backendProject}`, {
maxBuffer: LARGE_BUFFER,
});
process.on('exit', () => childProcess.kill());
process.on('SIGTERM', () => childProcess.kill());
childProcess.stdout.on('data', (data) => {
if (!frontendServerStarted && data.includes('No errors found.')) {
// ...
async function createReactApplication(
tree: Tree,
options: AppGeneratorSchema,
webAppName: string
) {
await reactAppGenerator(tree, {
name: webAppName,
linter: Linter.EsLint,
async function createReactApplication(
tree: Tree,
options: AppGeneratorSchema,
webAppName: string
) {
await reactAppGenerator(tree, {
name: webAppName,
linter: Linter.EsLint,
style: 'css',
e2eTestRunner: 'none',
@import url("https://use.typekit.net/rcr1opg.css");
/*
! tailwindcss v3.2.2 | MIT License | https://tailwindcss.com
*/
/*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
*/

Rough Schedule

breaks are in bold

  • 8:00am PST | 11:00am EST - Introductions
  • 8:05am PST | 11:05am EST - Lab 1
  • 8:30am PST | 11:30am EST - Lab 2
  • 9:00am PST | 12:00pm EST - Lab 3
  • 9:30am PST | 12:30pm EST - BREAK!!
  • 10:00am PST | 1:00pm EST - Lab 4
@ZackDeRose
ZackDeRose / README.md
Last active February 25, 2021 17:46 — forked from kentcdodds/README.md
Function syntaxes supported by TypeScript

TypeScript Function Syntaxes

I'm trying to create examples of all the different ways to write functions and function type definitions in TypeScript.

One requirement is these examples must work with strict mode (noImplicitAny, etc) enabled.

If I'm missing anything, please add comments below with examples. I'll eventually put this into a blog post.

Keep in mind that there are TONS of combinations of different syntaxes. I only want to include those which are less obvious combinations or unique in some way.