content_type
stringclasses
8 values
main_lang
stringclasses
7 values
message
stringlengths
1
50
sha
stringlengths
40
40
patch
stringlengths
52
962k
file_count
int64
1
300
Python
Python
move regression test for #360 into own file
c6e5a5349dae8aedb306840891863853a927c1a7
<ide><path>spacy/tests/regression/test_issue360.py <add>from __future__ import unicode_literals <add>from ...en import English <add> <add>import pytest <add> <add> <add>@pytest.fixture <add>def en_tokenizer(): <add> return English.Defaults.create_tokenizer() <add> <add> <add>def test_big_ellipsis(en_tokenizer): <add> tokens = en_tokenizer(u'$45...............Asking') <add> assert len(tokens) > 2
1
Ruby
Ruby
use env dsl
db772eee8a50f8adaaae01eac6b5a59053a0f330
<ide><path>Library/Homebrew/requirements/python_dependency.rb <ide> def pour_bottle? <ide> build? || system_python? <ide> end <ide> <del> def modify_build_environment <add> env do <ide> if system_python? <ide> if python_binary == "python" <ide> version = python_short_version
1
Mixed
Python
add mmbt model to transformers repo
df3961121f23f30a69979720c493c491a5c482ed
<ide><path>README.md <ide> At some point in the future, you'll be able to seamlessly move from pre-training <ide> 9. **[CTRL](https://github.com/salesforce/ctrl/)** (from Salesforce) released with the paper [CTRL: A Conditional Transformer Language Model for Controllable Generation](https://arxiv.org/abs/1909.05858) by Nitish Shirish Keskar*, Bryan McCann*, Lav R. Varshney, Caiming Xiong and Richard Socher. <ide> 10. **[CamemBERT](https://camembert-model.fr)** (from Inria/Facebook/Sorbonne) released with the paper [CamemBERT: a Tasty French Language Model](https://arxiv.org/abs/1911.03894) by Louis Martin*, Benjamin Muller*, Pedro Javier Ortiz Suárez*, Yoann Dupont, Laurent Romary, Éric Villemonte de la Clergerie, Djamé Seddah and Benoît Sagot. <ide> 11. **[ALBERT](https://github.com/google-research/ALBERT)** (from Google Research and the Toyota Technological Institute at Chicago) released with the paper [ALBERT: A Lite BERT for Self-supervised Learning of Language Representations](https://arxiv.org/abs/1909.11942), by Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, Radu Soricut. <del>11. Want to contribute a new model? We have added a **detailed guide and templates** to guide you in the process of adding a new model. You can find them in the [`templates`](./templates) folder of the repository. Be sure to check the [contributing guidelines](./CONTRIBUTING.md) and contact the maintainers or open an issue to collect feedbacks before starting your PR. <add>12. **[MMBT](https://github.com/facebookresearch/mmbt/)** (from Facebook), released together with the paper a [Supervised Multimodal Bitransformers for Classifying Images and Text](https://arxiv.org/pdf/1909.02950.pdf) by Douwe Kiela, Suvrat Bhooshan, Hamed Firooz, Davide Testuggine. <add>12. Want to contribute a new model? We have added a **detailed guide and templates** to guide you in the process of adding a new model. You can find them in the [`templates`](./templates) folder of the repository. Be sure to check the [contributing guidelines](./CONTRIBUTING.md) and contact the maintainers or open an issue to collect feedbacks before starting your PR. <ide> <ide> These implementations have been tested on several datasets (see the example scripts) and should match the performances of the original implementations (e.g. ~93 F1 on SQuAD for BERT Whole-Word-Masking, ~88 F1 on RocStories for OpenAI GPT, ~18.3 perplexity on WikiText 103 for Transformer-XL, ~0.916 Peason R coefficient on STS-B for XLNet). You can find more details on the performances in the Examples section of the [documentation](https://huggingface.co/transformers/examples.html). <ide> <ide><path>examples/README.md <ide> Training with the previously defined hyper-parameters yields the following resul <ide> ```bash <ide> acc = 0.7093812375249501 <ide> ``` <add> <add>## MM-IMDb <add> <add>Based on the script [`run_mmimdb.py`](https://github.com/huggingface/transformers/blob/master/examples/run_mmimdb.py). <add> <add>[MM-IMDb](http://lisi1.unal.edu.co/mmimdb/) is a Multimodal dataset with around 26,000 movies including images, plots and other metadata. <add> <add>### Training on MM-IMDb <add> <add>``` <add>python run_mmimdb.py \ <add> --data_dir /path/to/mmimdb/dataset/ \ <add> --model_type bert \ <add> --model_name_or_path bert-base-uncased \ <add> --output_dir /path/to/save/dir/ \ <add> --do_train \ <add> --do_eval \ <add> --max_seq_len 512 \ <add> --gradient_accumulation_steps 20 \ <add> --num_image_embeds 3 \ <add> --num_train_epochs 100 \ <add> --patience 5 <add>``` <add> <add> <ide><path>examples/run_mmimdb.py <add># coding=utf-8 <add># Copyright (c) Facebook, Inc. and its affiliates. <add># Copyright (c) HuggingFace Inc. team. <add># <add># Licensed under the Apache License, Version 2.0 (the "License"); <add># you may not use this file except in compliance with the License. <add># You may obtain a copy of the License at <add># <add># http://www.apache.org/licenses/LICENSE-2.0 <add># <add># Unless required by applicable law or agreed to in writing, software <add># distributed under the License is distributed on an "AS IS" BASIS, <add># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <add># See the License for the specific language governing permissions and <add># limitations under the License. <add>""" Finetuning the library models for multimodal multiclass prediction on MM-IMDB dataset.""" <add> <add>from __future__ import absolute_import, division, print_function <add> <add>import argparse <add>import glob <add>import logging <add>import os <add>import random <add>import json <add>from sklearn.metrics import f1_score <add> <add>import numpy as np <add>import torch <add>import torch.nn as nn <add>from torch.utils.data import DataLoader, RandomSampler, SequentialSampler <add>from torch.utils.data.distributed import DistributedSampler <add> <add>try: <add> from torch.utils.tensorboard import SummaryWriter <add>except: <add> from tensorboardX import SummaryWriter <add> <add>from tqdm import tqdm, trange <add> <add>from utils_mmimdb import ImageEncoder, JsonlDataset, collate_fn, get_mmimdb_labels, get_image_transforms <add> <add>from transformers import (WEIGHTS_NAME, <add> BertConfig, BertModel, BertTokenizer, <add> RobertaConfig, RobertaModel, RobertaTokenizer, <add> XLMConfig, XLMModel, XLMTokenizer, <add> XLNetConfig, XLNetModel, XLNetTokenizer, <add> DistilBertConfig, DistilBertModel, DistilBertTokenizer, <add> AlbertConfig, AlbertModel, AlbertTokenizer, <add> MMBTForClassification, MMBTConfig) <add> <add>from transformers import AdamW, get_linear_schedule_with_warmup <add> <add>logger = logging.getLogger(__name__) <add> <add>ALL_MODELS = sum((tuple(conf.pretrained_config_archive_map.keys()) for conf in (BertConfig, XLNetConfig, XLMConfig, <add> RobertaConfig, DistilBertConfig)), ()) <add> <add>MODEL_CLASSES = { <add> 'bert': (BertConfig, BertModel, BertTokenizer), <add> 'xlnet': (XLNetConfig, XLNetModel, XLNetTokenizer), <add> 'xlm': (XLMConfig, XLMModel, XLMTokenizer), <add> 'roberta': (RobertaConfig, RobertaModel, RobertaTokenizer), <add> 'distilbert': (DistilBertConfig, DistilBertModel, DistilBertTokenizer), <add> 'albert': (AlbertConfig, AlbertModel, AlbertTokenizer) <add>} <add> <add> <add>def set_seed(args): <add> random.seed(args.seed) <add> np.random.seed(args.seed) <add> torch.manual_seed(args.seed) <add> if args.n_gpu > 0: <add> torch.cuda.manual_seed_all(args.seed) <add> <add> <add>def train(args, train_dataset, model, tokenizer, criterion): <add> """ Train the model """ <add> if args.local_rank in [-1, 0]: <add> tb_writer = SummaryWriter() <add> <add> args.train_batch_size = args.per_gpu_train_batch_size * max(1, args.n_gpu) <add> train_sampler = RandomSampler(train_dataset) if args.local_rank == -1 else DistributedSampler(train_dataset) <add> train_dataloader = DataLoader(train_dataset, sampler=train_sampler, <add> batch_size=args.train_batch_size, <add> collate_fn=collate_fn, <add> num_workers=args.num_workers) <add> <add> if args.max_steps > 0: <add> t_total = args.max_steps <add> args.num_train_epochs = args.max_steps // (len(train_dataloader) // args.gradient_accumulation_steps) + 1 <add> else: <add> t_total = len(train_dataloader) // args.gradient_accumulation_steps * args.num_train_epochs <add> <add> # Prepare optimizer and schedule (linear warmup and decay) <add> no_decay = ['bias', 'LayerNorm.weight'] <add> optimizer_grouped_parameters = [ <add> {'params': [p for n, p in model.named_parameters() if not any(nd in n for nd in no_decay)], 'weight_decay': args.weight_decay}, <add> {'params': [p for n, p in model.named_parameters() if any(nd in n for nd in no_decay)], 'weight_decay': 0.0} <add> ] <add> <add> optimizer = AdamW(optimizer_grouped_parameters, lr=args.learning_rate, eps=args.adam_epsilon) <add> scheduler = get_linear_schedule_with_warmup(optimizer, num_warmup_steps=args.warmup_steps, num_training_steps=t_total) <add> if args.fp16: <add> try: <add> from apex import amp <add> except ImportError: <add> raise ImportError("Please install apex from https://www.github.com/nvidia/apex to use fp16 training.") <add> model, optimizer = amp.initialize(model, optimizer, opt_level=args.fp16_opt_level) <add> <add> # multi-gpu training (should be after apex fp16 initialization) <add> if args.n_gpu > 1: <add> model = torch.nn.DataParallel(model) <add> <add> # Distributed training (should be after apex fp16 initialization) <add> if args.local_rank != -1: <add> model = torch.nn.parallel.DistributedDataParallel(model, device_ids=[args.local_rank], <add> output_device=args.local_rank, <add> find_unused_parameters=True) <add> <add> # Train! <add> logger.info("***** Running training *****") <add> logger.info(" Num examples = %d", len(train_dataset)) <add> logger.info(" Num Epochs = %d", args.num_train_epochs) <add> logger.info(" Instantaneous batch size per GPU = %d", args.per_gpu_train_batch_size) <add> logger.info(" Total train batch size (w. parallel, distributed & accumulation) = %d", <add> args.train_batch_size * args.gradient_accumulation_steps * (torch.distributed.get_world_size() if args.local_rank != -1 else 1)) <add> logger.info(" Gradient Accumulation steps = %d", args.gradient_accumulation_steps) <add> logger.info(" Total optimization steps = %d", t_total) <add> <add> global_step = 0 <add> tr_loss, logging_loss = 0.0, 0.0 <add> best_f1, n_no_improve = 0, 0 <add> model.zero_grad() <add> train_iterator = trange(int(args.num_train_epochs), desc="Epoch", disable=args.local_rank not in [-1, 0]) <add> set_seed(args) # Added here for reproductibility (even between python 2 and 3) <add> for _ in train_iterator: <add> epoch_iterator = tqdm(train_dataloader, desc="Iteration", disable=args.local_rank not in [-1, 0]) <add> for step, batch in enumerate(epoch_iterator): <add> model.train() <add> batch = tuple(t.to(args.device) for t in batch) <add> labels = batch[5] <add> inputs = {'input_ids': batch[0], <add> 'input_modal': batch[2], <add> 'attention_mask': batch[1], <add> 'modal_start_tokens': batch[3], <add> 'modal_end_tokens': batch[4]} <add> outputs = model(**inputs) <add> logits = outputs[0] # model outputs are always tuple in transformers (see doc) <add> loss = criterion(logits, labels) <add> <add> if args.n_gpu > 1: <add> loss = loss.mean() # mean() to average on multi-gpu parallel training <add> if args.gradient_accumulation_steps > 1: <add> loss = loss / args.gradient_accumulation_steps <add> <add> if args.fp16: <add> with amp.scale_loss(loss, optimizer) as scaled_loss: <add> scaled_loss.backward() <add> else: <add> loss.backward() <add> <add> tr_loss += loss.item() <add> if (step + 1) % args.gradient_accumulation_steps == 0: <add> if args.fp16: <add> torch.nn.utils.clip_grad_norm_(amp.master_params(optimizer), args.max_grad_norm) <add> else: <add> torch.nn.utils.clip_grad_norm_(model.parameters(), args.max_grad_norm) <add> <add> optimizer.step() <add> scheduler.step() # Update learning rate schedule <add> model.zero_grad() <add> global_step += 1 <add> <add> if args.local_rank in [-1, 0] and args.logging_steps > 0 and global_step % args.logging_steps == 0: <add> logs = {} <add> if args.local_rank == -1 and args.evaluate_during_training: # Only evaluate when single GPU otherwise metrics may not average well <add> results = evaluate(args, model, tokenizer, criterion) <add> for key, value in results.items(): <add> eval_key = 'eval_{}'.format(key) <add> logs[eval_key] = value <add> <add> loss_scalar = (tr_loss - logging_loss) / args.logging_steps <add> learning_rate_scalar = scheduler.get_lr()[0] <add> logs['learning_rate'] = learning_rate_scalar <add> logs['loss'] = loss_scalar <add> logging_loss = tr_loss <add> <add> for key, value in logs.items(): <add> tb_writer.add_scalar(key, value, global_step) <add> print(json.dumps({**logs, **{'step': global_step}})) <add> <add> if args.local_rank in [-1, 0] and args.save_steps > 0 and global_step % args.save_steps == 0: <add> # Save model checkpoint <add> output_dir = os.path.join(args.output_dir, 'checkpoint-{}'.format(global_step)) <add> if not os.path.exists(output_dir): <add> os.makedirs(output_dir) <add> model_to_save = model.module if hasattr(model, 'module') else model # Take care of distributed/parallel training <add> torch.save(model_to_save.state_dict(), os.path.join(output_dir, WEIGHTS_NAME)) <add> torch.save(args, os.path.join(output_dir, 'training_args.bin')) <add> logger.info("Saving model checkpoint to %s", output_dir) <add> <add> if args.max_steps > 0 and global_step > args.max_steps: <add> epoch_iterator.close() <add> break <add> if args.max_steps > 0 and global_step > args.max_steps: <add> train_iterator.close() <add> break <add> <add> if args.local_rank == -1: <add> results = evaluate(args, model, tokenizer, criterion) <add> if results['micro_f1'] > best_f1: <add> best_f1 = results['micro_f1'] <add> n_no_improve = 0 <add> else: <add> n_no_improve += 1 <add> <add> if n_no_improve > args.patience: <add> train_iterator.close() <add> break <add> <add> if args.local_rank in [-1, 0]: <add> tb_writer.close() <add> <add> return global_step, tr_loss / global_step <add> <add> <add>def evaluate(args, model, tokenizer, criterion, prefix=""): <add> # Loop to handle MNLI double evaluation (matched, mis-matched) <add> eval_output_dir = args.output_dir <add> eval_dataset = load_examples(args, tokenizer, evaluate=True) <add> <add> if not os.path.exists(eval_output_dir) and args.local_rank in [-1, 0]: <add> os.makedirs(eval_output_dir) <add> <add> args.eval_batch_size = args.per_gpu_eval_batch_size * max(1, args.n_gpu) <add> # Note that DistributedSampler samples randomly <add> eval_sampler = SequentialSampler(eval_dataset) <add> eval_dataloader = DataLoader(eval_dataset, sampler=eval_sampler, batch_size=args.eval_batch_size, collate_fn=collate_fn) <add> <add> # multi-gpu eval <add> if args.n_gpu > 1: <add> model = torch.nn.DataParallel(model) <add> <add> # Eval! <add> logger.info("***** Running evaluation {} *****".format(prefix)) <add> logger.info(" Num examples = %d", len(eval_dataset)) <add> logger.info(" Batch size = %d", args.eval_batch_size) <add> eval_loss = 0.0 <add> nb_eval_steps = 0 <add> preds = None <add> out_label_ids = None <add> for batch in tqdm(eval_dataloader, desc="Evaluating"): <add> model.eval() <add> batch = tuple(t.to(args.device) for t in batch) <add> <add> with torch.no_grad(): <add> batch = tuple(t.to(args.device) for t in batch) <add> labels = batch[5] <add> inputs = {'input_ids': batch[0], <add> 'input_modal': batch[2], <add> 'attention_mask': batch[1], <add> 'modal_start_tokens': batch[3], <add> 'modal_end_tokens': batch[4]} <add> outputs = model(**inputs) <add> logits = outputs[0] # model outputs are always tuple in transformers (see doc) <add> tmp_eval_loss = criterion(logits, labels) <add> eval_loss += tmp_eval_loss.mean().item() <add> nb_eval_steps += 1 <add> if preds is None: <add> preds = torch.sigmoid(logits).detach().cpu().numpy() > 0.5 <add> out_label_ids = labels.detach().cpu().numpy() <add> else: <add> preds = np.append(preds, torch.sigmoid(logits).detach().cpu().numpy() > 0.5, axis=0) <add> out_label_ids = np.append(out_label_ids, labels.detach().cpu().numpy(), axis=0) <add> <add> eval_loss = eval_loss / nb_eval_steps <add> result = { <add> "loss": eval_loss, <add> "macro_f1": f1_score(out_label_ids, preds, average="macro"), <add> "micro_f1": f1_score(out_label_ids, preds, average="micro") <add> } <add> <add> output_eval_file = os.path.join(eval_output_dir, prefix, "eval_results.txt") <add> with open(output_eval_file, "w") as writer: <add> logger.info("***** Eval results {} *****".format(prefix)) <add> for key in sorted(result.keys()): <add> logger.info(" %s = %s", key, str(result[key])) <add> writer.write("%s = %s\n" % (key, str(result[key]))) <add> <add> return result <add> <add> <add>def load_examples(args, tokenizer, evaluate=False): <add> path = os.path.join(args.data_dir, "dev.jsonl" if evaluate else "train.jsonl") <add> transforms = get_image_transforms() <add> labels = get_mmimdb_labels() <add> dataset = JsonlDataset(path, tokenizer, transforms, labels, args.max_seq_length - args.num_image_embeds - 2) <add> return dataset <add> <add> <add>def main(): <add> parser = argparse.ArgumentParser() <add> <add> ## Required parameters <add> parser.add_argument("--data_dir", default=None, type=str, required=True, <add> help="The input data dir. Should contain the .jsonl files for MMIMDB.") <add> parser.add_argument("--model_type", default=None, type=str, required=True, <add> help="Model type selected in the list: " + ", ".join(MODEL_CLASSES.keys())) <add> parser.add_argument("--model_name_or_path", default=None, type=str, required=True, <add> help="Path to pre-trained model or shortcut name selected in the list: " + ", ".join(ALL_MODELS)) <add> parser.add_argument("--output_dir", default=None, type=str, required=True, <add> help="The output directory where the model predictions and checkpoints will be written.") <add> <add> ## Other parameters <add> parser.add_argument("--config_name", default="", type=str, <add> help="Pretrained config name or path if not the same as model_name") <add> parser.add_argument("--tokenizer_name", default="", type=str, <add> help="Pretrained tokenizer name or path if not the same as model_name") <add> parser.add_argument("--cache_dir", default="", type=str, <add> help="Where do you want to store the pre-trained models downloaded from s3") <add> parser.add_argument("--max_seq_length", default=128, type=int, <add> help="The maximum total input sequence length after tokenization. Sequences longer " <add> "than this will be truncated, sequences shorter will be padded.") <add> parser.add_argument("--num_image_embeds", default=1, type=int, <add> help="Number of Image Embeddings from the Image Encoder") <add> parser.add_argument("--do_train", action='store_true', <add> help="Whether to run training.") <add> parser.add_argument("--do_eval", action='store_true', <add> help="Whether to run eval on the dev set.") <add> parser.add_argument("--evaluate_during_training", action='store_true', <add> help="Rul evaluation during training at each logging step.") <add> parser.add_argument("--do_lower_case", action='store_true', <add> help="Set this flag if you are using an uncased model.") <add> <add> parser.add_argument("--per_gpu_train_batch_size", default=8, type=int, <add> help="Batch size per GPU/CPU for training.") <add> parser.add_argument("--per_gpu_eval_batch_size", default=8, type=int, <add> help="Batch size per GPU/CPU for evaluation.") <add> parser.add_argument('--gradient_accumulation_steps', type=int, default=1, <add> help="Number of updates steps to accumulate before performing a backward/update pass.") <add> parser.add_argument("--learning_rate", default=5e-5, type=float, <add> help="The initial learning rate for Adam.") <add> parser.add_argument("--weight_decay", default=0.0, type=float, <add> help="Weight deay if we apply some.") <add> parser.add_argument("--adam_epsilon", default=1e-8, type=float, <add> help="Epsilon for Adam optimizer.") <add> parser.add_argument("--max_grad_norm", default=1.0, type=float, <add> help="Max gradient norm.") <add> parser.add_argument("--num_train_epochs", default=3.0, type=float, <add> help="Total number of training epochs to perform.") <add> parser.add_argument("--patience", default=5, type=int, <add> help="Patience for Early Stopping.") <add> parser.add_argument("--max_steps", default=-1, type=int, <add> help="If > 0: set total number of training steps to perform. Override num_train_epochs.") <add> parser.add_argument("--warmup_steps", default=0, type=int, <add> help="Linear warmup over warmup_steps.") <add> <add> parser.add_argument('--logging_steps', type=int, default=50, <add> help="Log every X updates steps.") <add> parser.add_argument('--save_steps', type=int, default=50, <add> help="Save checkpoint every X updates steps.") <add> parser.add_argument("--eval_all_checkpoints", action='store_true', <add> help="Evaluate all checkpoints starting with the same prefix as model_name ending and ending with step number") <add> parser.add_argument("--no_cuda", action='store_true', <add> help="Avoid using CUDA when available") <add> parser.add_argument('--num_workers', type=int, default=8, <add> help="number of worker threads for dataloading") <add> parser.add_argument('--overwrite_output_dir', action='store_true', <add> help="Overwrite the content of the output directory") <add> parser.add_argument('--overwrite_cache', action='store_true', <add> help="Overwrite the cached training and evaluation sets") <add> parser.add_argument('--seed', type=int, default=42, <add> help="random seed for initialization") <add> <add> parser.add_argument('--fp16', action='store_true', <add> help="Whether to use 16-bit (mixed) precision (through NVIDIA apex) instead of 32-bit") <add> parser.add_argument('--fp16_opt_level', type=str, default='O1', <add> help="For fp16: Apex AMP optimization level selected in ['O0', 'O1', 'O2', and 'O3']." <add> "See details at https://nvidia.github.io/apex/amp.html") <add> parser.add_argument("--local_rank", type=int, default=-1, <add> help="For distributed training: local_rank") <add> parser.add_argument('--server_ip', type=str, default='', help="For distant debugging.") <add> parser.add_argument('--server_port', type=str, default='', help="For distant debugging.") <add> args = parser.parse_args() <add> <add> if os.path.exists(args.output_dir) and os.listdir(args.output_dir) and args.do_train and not args.overwrite_output_dir: <add> raise ValueError("Output directory ({}) already exists and is not empty. Use --overwrite_output_dir to overcome.".format(args.output_dir)) <add> <add> # Setup distant debugging if needed <add> if args.server_ip and args.server_port: <add> # Distant debugging - see https://code.visualstudio.com/docs/python/debugging#_attach-to-a-local-script <add> import ptvsd <add> print("Waiting for debugger attach") <add> ptvsd.enable_attach(address=(args.server_ip, args.server_port), redirect_output=True) <add> ptvsd.wait_for_attach() <add> <add> # Setup CUDA, GPU & distributed training <add> if args.local_rank == -1 or args.no_cuda: <add> device = torch.device("cuda" if torch.cuda.is_available() and not args.no_cuda else "cpu") <add> args.n_gpu = torch.cuda.device_count() <add> else: # Initializes the distributed backend which will take care of sychronizing nodes/GPUs <add> torch.cuda.set_device(args.local_rank) <add> device = torch.device("cuda", args.local_rank) <add> torch.distributed.init_process_group(backend='nccl') <add> args.n_gpu = 1 <add> <add> args.device = device <add> <add> # Setup logging <add> logging.basicConfig(format = '%(asctime)s - %(levelname)s - %(name)s - %(message)s', <add> datefmt = '%m/%d/%Y %H:%M:%S', <add> level = logging.INFO if args.local_rank in [-1, 0] else logging.WARN) <add> logger.warning("Process rank: %s, device: %s, n_gpu: %s, distributed training: %s, 16-bits training: %s", <add> args.local_rank, device, args.n_gpu, bool(args.local_rank != -1), args.fp16) <add> <add> # Set seed <add> set_seed(args) <add> <add> # Load pretrained model and tokenizer <add> if args.local_rank not in [-1, 0]: <add> torch.distributed.barrier() # Make sure only the first process in distributed training will download model & vocab <add> <add> # Setup model <add> labels = get_mmimdb_labels() <add> num_labels = len(labels) <add> args.model_type = args.model_type.lower() <add> config_class, model_class, tokenizer_class = MODEL_CLASSES[args.model_type] <add> transformer_config = config_class.from_pretrained(args.config_name if args.config_name else args.model_name_or_path) <add> tokenizer = tokenizer_class.from_pretrained(args.tokenizer_name if args.tokenizer_name else args.model_name_or_path, <add> do_lower_case=args.do_lower_case, <add> cache_dir=args.cache_dir if args.cache_dir else None) <add> transformer = model_class.from_pretrained(args.model_name_or_path, <add> config=transformer_config, <add> cache_dir=args.cache_dir if args.cache_dir else None) <add> img_encoder = ImageEncoder(args) <add> config = MMBTConfig(transformer_config, num_labels=num_labels) <add> model = MMBTForClassification(config, transformer, img_encoder) <add> <add> if args.local_rank == 0: <add> torch.distributed.barrier() # Make sure only the first process in distributed training will download model & vocab <add> <add> model.to(args.device) <add> <add> logger.info("Training/evaluation parameters %s", args) <add> <add> # Training <add> if args.do_train: <add> train_dataset = load_examples(args, tokenizer, evaluate=False) <add> label_frequences = train_dataset.get_label_frequencies() <add> label_frequences = [label_frequences[l] for l in labels] <add> label_weights = (torch.tensor(label_frequences, device=args.device, dtype=torch.float) / len(train_dataset)) ** -1 <add> criterion = nn.BCEWithLogitsLoss(pos_weight=label_weights) <add> global_step, tr_loss = train(args, train_dataset, model, tokenizer, criterion) <add> logger.info(" global_step = %s, average loss = %s", global_step, tr_loss) <add> <add> <add> # Saving best-practices: if you use defaults names for the model, you can reload it using from_pretrained() <add> if args.do_train and (args.local_rank == -1 or torch.distributed.get_rank() == 0): <add> # Create output directory if needed <add> if not os.path.exists(args.output_dir) and args.local_rank in [-1, 0]: <add> os.makedirs(args.output_dir) <add> <add> logger.info("Saving model checkpoint to %s", args.output_dir) <add> # Save a trained model, configuration and tokenizer using `save_pretrained()`. <add> # They can then be reloaded using `from_pretrained()` <add> model_to_save = model.module if hasattr(model, 'module') else model # Take care of distributed/parallel training <add> torch.save(model_to_save.state_dict(), os.path.join(args.output_dir, WEIGHTS_NAME)) <add> tokenizer.save_pretrained(args.output_dir) <add> <add> # Good practice: save your training arguments together with the trained model <add> torch.save(args, os.path.join(args.output_dir, 'training_args.bin')) <add> <add> # Load a trained model and vocabulary that you have fine-tuned <add> model = MMBTForClassification(config, transformer, img_encoder) <add> model.load_state_dict(torch.load(os.path.join(args.output_dir, WEIGHTS_NAME))) <add> tokenizer = tokenizer_class.from_pretrained(args.output_dir) <add> model.to(args.device) <add> <add> <add> # Evaluation <add> results = {} <add> if args.do_eval and args.local_rank in [-1, 0]: <add> tokenizer = tokenizer_class.from_pretrained(args.output_dir, do_lower_case=args.do_lower_case) <add> checkpoints = [args.output_dir] <add> if args.eval_all_checkpoints: <add> checkpoints = list(os.path.dirname(c) for c in sorted(glob.glob(args.output_dir + '/**/' + WEIGHTS_NAME, recursive=True))) <add> logging.getLogger("transformers.modeling_utils").setLevel(logging.WARN) # Reduce logging <add> logger.info("Evaluate the following checkpoints: %s", checkpoints) <add> for checkpoint in checkpoints: <add> global_step = checkpoint.split('-')[-1] if len(checkpoints) > 1 else "" <add> prefix = checkpoint.split('/')[-1] if checkpoint.find('checkpoint') != -1 else "" <add> model = MMBTForClassification(config, transformer, img_encoder) <add> model.load_state_dict(torch.load(checkpoint)) <add> model.to(args.device) <add> result = evaluate(args, model, tokenizer, criterion, prefix=prefix) <add> result = dict((k + '_{}'.format(global_step), v) for k, v in result.items()) <add> results.update(result) <add> <add> return results <add> <add> <add>if __name__ == "__main__": <add> main() <ide><path>examples/utils_mmimdb.py <add># coding=utf-8 <add># Copyright (c) Facebook, Inc. and its affiliates. <add># Copyright (c) HuggingFace Inc. team. <add># <add># Licensed under the Apache License, Version 2.0 (the "License"); <add># you may not use this file except in compliance with the License. <add># You may obtain a copy of the License at <add># <add># http://www.apache.org/licenses/LICENSE-2.0 <add># <add># Unless required by applicable law or agreed to in writing, software <add># distributed under the License is distributed on an "AS IS" BASIS, <add># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <add># See the License for the specific language governing permissions and <add># limitations under the License. <add> <add>import json <add>import os <add>from collections import Counter <add>from PIL import Image <add> <add>import torch <add>import torch.nn as nn <add>import torchvision <add>import torchvision.transforms as transforms <add>from torch.utils.data import Dataset <add> <add>POOLING_BREAKDOWN = { <add> 1: (1, 1), <add> 2: (2, 1), <add> 3: (3, 1), <add> 4: (2, 2), <add> 5: (5, 1), <add> 6: (3, 2), <add> 7: (7, 1), <add> 8: (4, 2), <add> 9: (3, 3) <add>} <add> <add> <add>class ImageEncoder(nn.Module): <add> def __init__(self, args): <add> super(ImageEncoder, self).__init__() <add> model = torchvision.models.resnet152(pretrained=True) <add> modules = list(model.children())[:-2] <add> self.model = nn.Sequential(*modules) <add> self.pool = nn.AdaptiveAvgPool2d(POOLING_BREAKDOWN[args.num_image_embeds]) <add> <add> def forward(self, x): <add> # Bx3x224x224 -> Bx2048x7x7 -> Bx2048xN -> BxNx2048 <add> out = self.pool(self.model(x)) <add> out = torch.flatten(out, start_dim=2) <add> out = out.transpose(1, 2).contiguous() <add> return out # BxNx2048 <add> <add> <add> <add>class JsonlDataset(Dataset): <add> def __init__(self, data_path, tokenizer, transforms, labels, max_seq_length): <add> self.data = [json.loads(l) for l in open(data_path)] <add> self.data_dir = os.path.dirname(data_path) <add> self.tokenizer = tokenizer <add> self.labels = labels <add> self.n_classes = len(labels) <add> self.max_seq_length = max_seq_length <add> <add> self.transforms = transforms <add> <add> def __len__(self): <add> return len(self.data) <add> <add> def __getitem__(self, index): <add> sentence = torch.LongTensor(self.tokenizer.encode(self.data[index]["text"], add_special_tokens=True)) <add> start_token, sentence, end_token = sentence[0], sentence[1:-1], sentence[-1] <add> sentence = sentence[:self.max_seq_length] <add> <add> label = torch.zeros(self.n_classes) <add> label[[self.labels.index(tgt) for tgt in self.data[index]["label"]]] = 1 <add> <add> image = Image.open(os.path.join(self.data_dir, self.data[index]["img"])).convert("RGB") <add> image = self.transforms(image) <add> <add> return {"image_start_token": start_token, "image_end_token": end_token, <add> "sentence": sentence, "image": image, "label": label} <add> <add> def get_label_frequencies(self): <add> label_freqs = Counter() <add> for row in self.data: <add> label_freqs.update(row["label"]) <add> return label_freqs <add> <add> <add>def collate_fn(batch): <add> lens = [len(row["sentence"]) for row in batch] <add> bsz, max_seq_len = len(batch), max(lens) <add> <add> mask_tensor = torch.zeros(bsz, max_seq_len, dtype=torch.long) <add> text_tensor = torch.zeros(bsz, max_seq_len, dtype=torch.long) <add> <add> for i_batch, (input_row, length) in enumerate(zip(batch, lens)): <add> text_tensor[i_batch, :length] = input_row["sentence"] <add> mask_tensor[i_batch, :length] = 1 <add> <add> img_tensor = torch.stack([row["image"] for row in batch]) <add> tgt_tensor = torch.stack([row["label"] for row in batch]) <add> img_start_token = torch.stack([row["image_start_token"] for row in batch]) <add> img_end_token = torch.stack([row["image_end_token"] for row in batch]) <add> <add> return text_tensor, mask_tensor, img_tensor, img_start_token, img_end_token, tgt_tensor <add> <add> <add>def get_mmimdb_labels(): <add> return ['Crime', 'Drama', 'Thriller', 'Action', 'Comedy', 'Romance', <add> 'Documentary', 'Short', 'Mystery', 'History', 'Family', 'Adventure', <add> 'Fantasy', 'Sci-Fi', 'Western', 'Horror', 'Sport', 'War', 'Music', <add> 'Musical', 'Animation', 'Biography', 'Film-Noir'] <add> <add> <add>def get_image_transforms(): <add> return transforms.Compose( <add> [ <add> transforms.Resize(256), <add> transforms.CenterCrop(224), <add> transforms.ToTensor(), <add> transforms.Normalize( <add> mean=[0.46777044, 0.44531429, 0.40661017], <add> std=[0.12221994, 0.12145835, 0.14380469], <add> ), <add> ] <add> ) <ide><path>transformers/__init__.py <ide> from .configuration_distilbert import DistilBertConfig, DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP <ide> from .configuration_albert import AlbertConfig, ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP <ide> from .configuration_camembert import CamembertConfig, CAMEMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP <add>from .configuration_mmbt import MMBTConfig <ide> <ide> # Modeling <ide> if is_torch_available(): <ide> AlbertForQuestionAnswering, <ide> load_tf_weights_in_albert, ALBERT_PRETRAINED_MODEL_ARCHIVE_MAP) <ide> <add> from .modeling_mmbt import ModalEmbeddings, MMBTModel, MMBTForClassification <add> <ide> # Optimization <ide> from .optimization import (AdamW, get_constant_schedule, get_constant_schedule_with_warmup, get_cosine_schedule_with_warmup, <ide> get_cosine_with_hard_restarts_schedule_with_warmup, get_linear_schedule_with_warmup) <ide><path>transformers/configuration_mmbt.py <add># coding=utf-8 <add># Copyright (c) Facebook, Inc. and its affiliates. <add># Copyright (c) HuggingFace Inc. team. <add># <add># Licensed under the Apache License, Version 2.0 (the "License"); <add># you may not use this file except in compliance with the License. <add># You may obtain a copy of the License at <add># <add># http://www.apache.org/licenses/LICENSE-2.0 <add># <add># Unless required by applicable law or agreed to in writing, software <add># distributed under the License is distributed on an "AS IS" BASIS, <add># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <add># See the License for the specific language governing permissions and <add># limitations under the License. <add>""" MMBT configuration """ <add> <add>from __future__ import (absolute_import, division, print_function, <add> unicode_literals) <add> <add>import logging <add> <add>logger = logging.getLogger(__name__) <add> <add> <add>class MMBTConfig(object): <add> """Configuration class to store the configuration of a `MMBT Model`. <add> <add> Args: <add> config: config of the underlying Transformer models. It's values are copied over to use a single config. <add> num_labels: Size of final Linear layer for classification. <add> modal_hidden_size: Embedding dimension of the non-text modality encoder. <add> """ <add> def __init__(self, config, num_labels=None, modal_hidden_size=2048): <add> self.__dict__ = config.__dict__ <add> self.modal_hidden_size = modal_hidden_size <add> if num_labels: <add> self.num_labels = num_labels <ide><path>transformers/modeling_mmbt.py <add># coding=utf-8 <add># Copyright (c) Facebook, Inc. and its affiliates. <add># Copyright (c) HuggingFace Inc. team. <add># <add># Licensed under the Apache License, Version 2.0 (the "License"); <add># you may not use this file except in compliance with the License. <add># You may obtain a copy of the License at <add># <add># http://www.apache.org/licenses/LICENSE-2.0 <add># <add># Unless required by applicable law or agreed to in writing, software <add># distributed under the License is distributed on an "AS IS" BASIS, <add># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <add># See the License for the specific language governing permissions and <add># limitations under the License. <add>"""PyTorch MMBT model. """ <add> <add>from __future__ import (absolute_import, division, print_function, <add> unicode_literals) <add> <add>import logging <add> <add>import torch <add>import torch.nn as nn <add>from torch.nn import CrossEntropyLoss, MSELoss <add> <add>from .file_utils import add_start_docstrings <add> <add>logger = logging.getLogger(__name__) <add> <add> <add>class ModalEmbeddings(nn.Module): <add> """Generic Modal Embeddings which takes in an encoder, and a transformer embedding. <add> """ <add> def __init__(self, config, encoder, embeddings): <add> super(ModalEmbeddings, self).__init__() <add> self.config = config <add> self.encoder = encoder <add> self.proj_embeddings = nn.Linear(config.modal_hidden_size, config.hidden_size) <add> self.position_embeddings = embeddings.position_embeddings <add> self.token_type_embeddings = embeddings.token_type_embeddings <add> self.word_embeddings = embeddings.word_embeddings <add> self.LayerNorm = embeddings.LayerNorm <add> self.dropout = nn.Dropout(p=config.hidden_dropout_prob) <add> <add> def forward(self, input_modal, start_token=None, end_token=None, position_ids=None, token_type_ids=None): <add> token_embeddings = self.proj_embeddings(self.encoder(input_modal)) <add> seq_length = token_embeddings.size(1) <add> <add> if start_token is not None: <add> start_token_embeds = self.word_embeddings(start_token) <add> seq_length += 1 <add> token_embeddings = torch.cat([start_token_embeds.unsqueeze(1), token_embeddings], dim=1) <add> <add> if end_token is not None: <add> end_token_embeds = self.word_embeddings(end_token) <add> seq_length += 1 <add> token_embeddings = torch.cat([token_embeddings, end_token_embeds.unsqueeze(1)], dim=1) <add> <add> if position_ids is None: <add> position_ids = torch.arange(seq_length, dtype=torch.long, device=input_modal.device) <add> position_ids = position_ids.unsqueeze(0).expand(input_modal.size(0), seq_length) <add> <add> if token_type_ids is None: <add> token_type_ids = torch.zeros((input_modal.size(0), seq_length), dtype=torch.long, device=input_modal.device) <add> <add> position_embeddings = self.position_embeddings(position_ids) <add> token_type_embeddings = self.token_type_embeddings(token_type_ids) <add> embeddings = token_embeddings + position_embeddings + token_type_embeddings <add> embeddings = self.LayerNorm(embeddings) <add> embeddings = self.dropout(embeddings) <add> return embeddings <add> <add> <add>MMBT_START_DOCSTRING = r""" MMBT model was proposed in <add> `Supervised Multimodal Bitransformers for Classifying Images and Text`_ <add> by Douwe Kiela, Suvrat Bhooshan, Hamed Firooz, Davide Testuggine. <add> It's a supervised multimodal bitransformer model that fuses information from text and other image encoders, <add> and obtain state-of-the-art performance on various multimodal classification benchmark tasks. <add> <add> This model is a PyTorch `torch.nn.Module`_ sub-class. Use it as a regular PyTorch Module and <add> refer to the PyTorch documentation for all matter related to general usage and behavior. <add> <add> .. _`Supervised Multimodal Bitransformers for Classifying Images and Text`: <add> https://www.github.com/salesforce/ctrl <add> <add> .. _`torch.nn.Module`: <add> https://pytorch.org/docs/stable/nn.html#module <add> <add> Parameters: <add> config (:class:`~transformers.MMBTConfig`): Model configuration class with all the parameters of the model. <add> Initializing with a config file does not load the weights associated with the model, only the configuration. <add> transformer (:class: `~nn.Module`): A text transformer that is used by MMBT. <add> It should have embeddings, encoder, and pooler attributes. <add> encoder (:class: `~nn.Module`): Encoder for the second modality. <add> It should take in a batch of modal inputs and return k, n dimension embeddings. <add>""" <add> <add>MMBT_INPUTS_DOCSTRING = r""" Inputs: <add> **input_modal**: ``torch.FloatTensor`` of shape ``(batch_size, ***)``: <add> The other modality data. It will be the shape that the encoder for that type expects. <add> e.g. With an Image Encoder, the shape would be (batch_size, channels, height, width) <add> **input_ids**: ``torch.LongTensor`` of shape ``(batch_size, sequence_length)``: <add> Indices of input sequence tokens in the vocabulary. <add> It does not expect [CLS] token to be added as it's appended to the end of other modality embeddings. <add> See :func:`transformers.PreTrainedTokenizer.encode` and <add> :func:`transformers.PreTrainedTokenizer.convert_tokens_to_ids` for details. <add> **modal_start_tokens**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size,)``: <add> Optional start token to be added to Other Modality Embedding. [CLS] Most commonly used for Classification tasks. <add> **modal_end_tokens**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size,)``: <add> Optional end token to be added to Other Modality Embedding. [SEP] Most commonly used. <add> **attention_mask**: (`optional`) ``torch.FloatTensor`` of shape ``(batch_size, sequence_length)``: <add> Mask to avoid performing attention on padding token indices. <add> Mask values selected in ``[0, 1]``: <add> ``1`` for tokens that are NOT MASKED, ``0`` for MASKED tokens. <add> **token_type_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, sequence_length)``: <add> Segment token indices to indicate different portions of the inputs. <add> **modal_token_type_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, modal_sequence_length)``: <add> Segment token indices to indicate different portions of the non-text modality. <add> The embeddings from these tokens will be summed with the respective token embeddings for the non-text modality. <add> **position_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, sequence_length)``: <add> Indices of positions of each input sequence tokens in the position embeddings. <add> **modal_position_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, modal_sequence_length)``: <add> Indices of positions of each input sequence tokens in the position embeddings for the non-text modality. <add> **head_mask**: (`optional`) ``torch.FloatTensor`` of shape ``(num_heads,)`` or ``(num_layers, num_heads)``: <add> Mask to nullify selected heads of the self-attention modules. <add> Mask values selected in ``[0, 1]``: <add> ``1`` indicates the head is **not masked**, ``0`` indicates the head is **masked**. <add> **inputs_embeds**: (`optional`) ``torch.FloatTensor`` of shape ``(batch_size, sequence_length, embedding_dim)``: <add> Optionally, instead of passing ``input_ids`` you can choose to directly pass an embedded representation. <add> This is useful if you want more control over how to convert `input_ids` indices into associated vectors <add> than the model's internal embedding lookup matrix. <add> **encoder_hidden_states**: (`optional`) ``torch.FloatTensor`` of shape ``(batch_size, sequence_length, hidden_size)``: <add> Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if the model <add> is configured as a decoder. <add> **encoder_attention_mask**: (`optional`) ``torch.FloatTensor`` of shape ``(batch_size, sequence_length)``: <add> Mask to avoid performing attention on the padding token indices of the encoder input. This mask <add> is used in the cross-attention if the model is configured as a decoder. <add> Mask values selected in ``[0, 1]``: <add> ``1`` for tokens that are NOT MASKED, ``0`` for MASKED tokens. <add>""" <add> <add>@add_start_docstrings("The bare MMBT Model outputting raw hidden-states without any specific head on top.", <add> MMBT_START_DOCSTRING, MMBT_INPUTS_DOCSTRING) <add>class MMBTModel(nn.Module): <add> r""" <add> Outputs: `Tuple` comprising various elements depending on the configuration (config) and inputs: <add> **last_hidden_state**: ``torch.FloatTensor`` of shape ``(batch_size, sequence_length, hidden_size)`` <add> Sequence of hidden-states at the output of the last layer of the model. <add> **pooler_output**: ``torch.FloatTensor`` of shape ``(batch_size, hidden_size)`` <add> Last layer hidden-state of the first token of the sequence (classification token) <add> further processed by a Linear layer and a Tanh activation function. The Linear <add> layer weights are trained from the next sentence prediction (classification) <add> objective during Bert pretraining. This output is usually *not* a good summary <add> of the semantic content of the input, you're often better with averaging or pooling <add> the sequence of hidden-states for the whole input sequence. <add> **hidden_states**: (`optional`, returned when ``config.output_hidden_states=True``) <add> list of ``torch.FloatTensor`` (one for the output of each layer + the output of the embeddings) <add> of shape ``(batch_size, sequence_length, hidden_size)``: <add> Hidden-states of the model at the output of each layer plus the initial embedding outputs. <add> **attentions**: (`optional`, returned when ``config.output_attentions=True``) <add> list of ``torch.FloatTensor`` (one for each layer) of shape ``(batch_size, num_heads, sequence_length, sequence_length)``: <add> Attentions weights after the attention softmax, used to compute the weighted average in the self-attention heads. <add> <add> Examples:: <add> transformer = BertModel.from_pretrained('bert-base-uncased') <add> encoder = ImageEncoder(args) <add> mmbt = MMBTModel(config, transformer, encoder) <add> """ <add> def __init__(self, config, transformer, encoder): <add> super(MMBTModel, self).__init__() <add> self.config = config <add> self.transformer = transformer <add> self.modal_encoder = ModalEmbeddings(config, encoder, transformer.embeddings) <add> <add> def forward(self, input_modal, input_ids=None, modal_start_tokens=None, <add> modal_end_tokens=None, attention_mask=None, <add> token_type_ids=None, modal_token_type_ids=None, <add> position_ids=None, modal_position_ids=None, head_mask=None, <add> inputs_embeds=None, encoder_hidden_states=None, <add> encoder_attention_mask=None): <add> <add> <add> if input_ids is not None and inputs_embeds is not None: <add> raise ValueError("You cannot specify both input_ids and inputs_embeds at the same time") <add> elif input_ids is not None: <add> input_txt_shape = input_ids.size() <add> elif inputs_embeds is not None: <add> input_txt_shape = inputs_embeds.size()[:-1] <add> else: <add> raise ValueError("You have to specify either input_ids or inputs_embeds") <add> <add> device = input_ids.device if input_ids is not None else inputs_embeds.device <add> <add> modal_embeddings = self.modal_encoder(input_modal, <add> start_token=modal_start_tokens, <add> end_token=modal_end_tokens, <add> position_ids=modal_position_ids, <add> token_type_ids=modal_token_type_ids) <add> <add> input_modal_shape = modal_embeddings.size()[:-1] <add> <add> if token_type_ids is None: <add> token_type_ids = torch.ones(input_txt_shape, dtype=torch.long, device=device) <add> <add> txt_embeddings = self.transformer.embeddings(input_ids=input_ids, <add> position_ids=position_ids, <add> token_type_ids=token_type_ids, <add> inputs_embeds=inputs_embeds) <add> <add> embedding_output = torch.cat([modal_embeddings, txt_embeddings], 1) <add> <add> input_shape = embedding_output.size()[:-1] <add> <add> if attention_mask is None: <add> attention_mask = torch.ones(input_shape, device=device) <add> else: <add> attention_mask = torch.cat([torch.ones(input_modal_shape, device=device, dtype=torch.long), attention_mask], dim=1) <add> <add> if encoder_attention_mask is None: <add> encoder_attention_mask = torch.ones(input_shape, device=device) <add> else: <add> encoder_attention_mask = torch.cat([torch.ones(input_modal_shape, device=device), encoder_attention_mask], dim=1) <add> <add> # We can provide a self-attention mask of dimensions [batch_size, from_seq_length, to_seq_length] <add> # ourselves in which case we just need to make it broadcastable to all heads. <add> if attention_mask.dim() == 3: <add> extended_attention_mask = attention_mask[:, None, :, :] <add> <add> # Provided a padding mask of dimensions [batch_size, seq_length] <add> # - if the model is a decoder, apply a causal mask in addition to the padding mask <add> # - if the model is an encoder, make the mask broadcastable to [batch_size, num_heads, seq_length, seq_length] <add> if attention_mask.dim() == 2: <add> if self.config.is_decoder: <add> batch_size, seq_length = input_shape <add> seq_ids = torch.arange(seq_length, device=device) <add> causal_mask = seq_ids[None, None, :].repeat(batch_size, seq_length, 1) <= seq_ids[None, :, None] <add> extended_attention_mask = causal_mask[:, None, :, :] * attention_mask[:, None, None, :] <add> else: <add> extended_attention_mask = attention_mask[:, None, None, :] <add> <add> # Since attention_mask is 1.0 for positions we want to attend and 0.0 for <add> # masked positions, this operation will create a tensor which is 0.0 for <add> # positions we want to attend and -10000.0 for masked positions. <add> # Since we are adding it to the raw scores before the softmax, this is <add> # effectively the same as removing these entirely. <add> extended_attention_mask = extended_attention_mask.to(dtype=next(self.parameters()).dtype) # fp16 compatibility <add> extended_attention_mask = (1.0 - extended_attention_mask) * -10000.0 <add> <add> # If a 2D ou 3D attention mask is provided for the cross-attention <add> # we need to make broadcastabe to [batch_size, num_heads, seq_length, seq_length] <add> if encoder_attention_mask.dim() == 3: <add> encoder_extended_attention_mask = encoder_attention_mask[:, None, :, :] <add> if encoder_attention_mask.dim() == 2: <add> encoder_extended_attention_mask = encoder_attention_mask[:, None, None, :] <add> <add> encoder_extended_attention_mask = encoder_extended_attention_mask.to(dtype=next(self.parameters()).dtype) # fp16 compatibility <add> encoder_extended_attention_mask = (1.0 - encoder_extended_attention_mask) * -10000.0 <add> <add> # Prepare head mask if needed <add> # 1.0 in head_mask indicate we keep the head <add> # attention_probs has shape bsz x n_heads x N x N <add> # input head_mask has shape [num_heads] or [num_hidden_layers x num_heads] <add> # and head_mask is converted to shape [num_hidden_layers x batch x num_heads x seq_length x seq_length] <add> if head_mask is not None: <add> if head_mask.dim() == 1: <add> head_mask = head_mask.unsqueeze(0).unsqueeze(0).unsqueeze(-1).unsqueeze(-1) <add> head_mask = head_mask.expand(self.config.num_hidden_layers, -1, -1, -1, -1) <add> elif head_mask.dim() == 2: <add> head_mask = head_mask.unsqueeze(1).unsqueeze(-1).unsqueeze(-1) # We can specify head_mask for each layer <add> head_mask = head_mask.to(dtype=next(self.parameters()).dtype) # switch to fload if need + fp16 compatibility <add> else: <add> head_mask = [None] * self.config.num_hidden_layers <add> <add> <add> encoder_outputs = self.transformer.encoder(embedding_output, <add> attention_mask=extended_attention_mask, <add> head_mask=head_mask, <add> encoder_hidden_states=encoder_hidden_states, <add> encoder_attention_mask=encoder_extended_attention_mask) <add> <add> sequence_output = encoder_outputs[0] <add> pooled_output = self.transformer.pooler(sequence_output) <add> <add> outputs = (sequence_output, pooled_output,) + encoder_outputs[1:] # add hidden_states and attentions if they are here <add> return outputs # sequence_output, pooled_output, (hidden_states), (attentions) <add> <add> <add> def get_input_embeddings(self): <add> return self.embeddings.word_embeddings <add> <add> def set_input_embeddings(self, value): <add> self.embeddings.word_embeddings = value <add> <add> <add>@add_start_docstrings("""MMBT Model with a sequence classification/regression head on top (a linear layer on top of <add> the pooled output)""", MMBT_START_DOCSTRING, MMBT_INPUTS_DOCSTRING) <add>class MMBTForClassification(nn.Module): <add> r""" <add> **labels**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size,)``: <add> Labels for computing the sequence classification/regression loss. <add> Indices should be in ``[0, ..., config.num_labels - 1]``. <add> If ``config.num_labels == 1`` a regression loss is computed (Mean-Square loss), <add> If ``config.num_labels > 1`` a classification loss is computed (Cross-Entropy). <add> <add> Outputs: `Tuple` comprising various elements depending on the configuration (config) and inputs: <add> **loss**: (`optional`, returned when ``labels`` is provided) ``torch.FloatTensor`` of shape ``(1,)``: <add> Classification (or regression if config.num_labels==1) loss. <add> **logits**: ``torch.FloatTensor`` of shape ``(batch_size, config.num_labels)`` <add> Classification (or regression if config.num_labels==1) scores (before SoftMax). <add> **hidden_states**: (`optional`, returned when ``config.output_hidden_states=True``) <add> list of ``torch.FloatTensor`` (one for the output of each layer + the output of the embeddings) <add> of shape ``(batch_size, sequence_length, hidden_size)``: <add> Hidden-states of the model at the output of each layer plus the initial embedding outputs. <add> **attentions**: (`optional`, returned when ``config.output_attentions=True``) <add> list of ``torch.FloatTensor`` (one for each layer) of shape ``(batch_size, num_heads, sequence_length, sequence_length)``: <add> Attentions weights after the attention softmax, used to compute the weighted average in the self-attention heads. <add> <add> Examples:: <add> <add> transformer = BertModel.from_pretrained('bert-base-uncased') <add> encoder = ImageEncoder(args) <add> model = MMBTForClassification(config, transformer, encoder) <add> outputs = model(input_modal, input_ids, labels=labels) <add> loss, logits = outputs[:2] <add> """ <add> <add> def __init__(self, config, transformer, encoder): <add> super(MMBTForClassification, self).__init__() <add> self.num_labels = config.num_labels <add> <add> self.mmbt = MMBTModel(config, transformer, encoder) <add> self.dropout = nn.Dropout(config.hidden_dropout_prob) <add> self.classifier = nn.Linear(config.hidden_size, config.num_labels) <add> <add> def forward(self, input_modal, input_ids=None, modal_start_tokens=None, modal_end_tokens=None, <add> attention_mask=None, token_type_ids=None, modal_token_type_ids=None, position_ids=None, <add> modal_position_ids=None, head_mask=None, inputs_embeds=None, labels=None): <add> <add> outputs = self.mmbt(input_modal=input_modal, input_ids=input_ids, <add> modal_start_tokens=modal_start_tokens, <add> modal_end_tokens=modal_end_tokens, <add> attention_mask=attention_mask, <add> token_type_ids=token_type_ids, <add> modal_token_type_ids=modal_token_type_ids, <add> position_ids=position_ids, <add> modal_position_ids=modal_position_ids, <add> head_mask=head_mask, <add> inputs_embeds=inputs_embeds) <add> <add> pooled_output = outputs[1] <add> <add> pooled_output = self.dropout(pooled_output) <add> logits = self.classifier(pooled_output) <add> <add> outputs = (logits,) + outputs[2:] # add hidden states and attention if they are here <add> <add> if labels is not None: <add> if self.num_labels == 1: <add> # We are doing regression <add> loss_fct = MSELoss() <add> loss = loss_fct(logits.view(-1), labels.view(-1)) <add> else: <add> loss_fct = CrossEntropyLoss() <add> loss = loss_fct(logits.view(-1, self.num_labels), labels.view(-1)) <add> outputs = (loss,) + outputs <add> <add> return outputs # (loss), logits, (hidden_states), (attentions) <ide>\ No newline at end of file
7
Ruby
Ruby
apply suggestions from code review
f11786d63d4287c85a5298353467b89bfe9398b0
<ide><path>Library/Homebrew/dev-cmd/bump.rb <ide> def retrieve_and_display_info(formula_or_cask, name, repositories, args:) <ide> livecheck_latest = livecheck_result(formula_or_cask) <ide> pull_requests = retrieve_pull_requests(formula_or_cask, name) unless args.no_pull_requests? <ide> <del> print_name = begin <del> "#{name} (cask)" if formula_or_cask.is_a?(Cask::Cask) && Formula[name] && !args.cask? <add> name += begin <add> (" (cask)" if formula_or_cask.is_a?(Cask::Cask) && !args.cask? && Formula[name]).to_s <ide> rescue FormulaUnavailableError <del> nil <add> "" <ide> end <del> print_name ||= name <ide> <ide> title = if current_version == repology_latest && <ide> current_version == livecheck_latest <del> "#{print_name} is up to date!" <add> "#{name} is up to date!" <ide> else <del> print_name <add> name <ide> end <ide> <ide> ohai title <ide><path>Library/Homebrew/livecheck/livecheck.rb <ide> def run_checks( <ide> formula = formula_or_cask if formula_or_cask.is_a?(Formula) <ide> cask = formula_or_cask if formula_or_cask.is_a?(Cask::Cask) <ide> name = formula_or_cask_name(formula_or_cask, full_name: full_name) <del> print_name = begin <del> "#{name} (cask)" if cask && Formula[name] && handle_name_conflict <del> rescue FormulaUnavailableError <del> nil <del> end <del> print_name ||= name <ide> <ide> if debug && i.positive? <ide> puts <<~EOS <ide> def run_checks( <ide> next info <ide> end <ide> <del> info[:cask] = print_name <del> print_latest_version(info, verbose: verbose) <add> print_latest_version(info, verbose: verbose, handle_name_conflict: handle_name_conflict) <ide> nil <ide> rescue => e <ide> Homebrew.failed = true <ide> def run_checks( <ide> progress&.increment <ide> status_hash(formula_or_cask, "error", [e.to_s], full_name: full_name, verbose: verbose) <ide> elsif !quiet <del> onoe "#{Tty.blue}#{print_name}#{Tty.reset}: #{e}" <add> name = formula_or_cask_name(formula_or_cask, full_name: full_name) <add> name += begin <add> (" (cask)" if cask && handle_name_conflict && Formula[name]).to_s <add> rescue FormulaUnavailableError <add> "" <add> end <add> <add> onoe "#{Tty.blue}#{name}#{Tty.reset}: #{e}" <ide> $stderr.puts e.backtrace if debug && !e.is_a?(Livecheck::Error) <ide> nil <ide> end <ide> def status_hash(formula_or_cask, status_str, messages = nil, full_name: false, v <ide> end <ide> <ide> # Formats and prints the livecheck result for a formula. <del> sig { params(info: Hash, verbose: T::Boolean).void } <del> def print_latest_version(info, verbose:) <add> sig { params(info: Hash, verbose: T::Boolean, handle_name_conflict: T::Boolean).void } <add> def print_latest_version(info, verbose:, handle_name_conflict: false) <ide> formula_or_cask_s = "#{Tty.blue}#{info[:formula] || info[:cask]}#{Tty.reset}" <add> formula_or_cask_s += begin <add> (" (cask)" if info[:cask] && handle_name_conflict && Formula[info[:cask]]).to_s <add> rescue FormulaUnavailableError <add> "" <add> end <ide> formula_or_cask_s += " (guessed)" if !info[:meta][:livecheckable] && verbose <ide> <ide> current_s = if info[:version][:newer_than_upstream]
2
Python
Python
set version to v3.0.0
b6a198481bb5d206b3571977808c1527afb66bd1
<ide><path>spacy/about.py <ide> # fmt: off <ide> __title__ = "spacy" <del>__version__ = "3.0.1.dev0" <add>__version__ = "3.0.1" <ide> __download_url__ = "https://github.com/explosion/spacy-models/releases/download" <ide> __compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json" <ide> __projects__ = "https://github.com/explosion/projects"
1
PHP
PHP
use local variable
2ce99051636e8dee09ef405edb90a483f72b7f40
<ide><path>src/Illuminate/View/Component.php <ide> public function resolveView() <ide> <ide> $factory = Container::getInstance()->make('view'); <ide> <del> return $factory->exists($this->render()) <del> ? $this->render() <del> : $this->createBladeViewFromString($factory, $this->render()); <add> return $factory->exists($view) <add> ? $view <add> : $this->createBladeViewFromString($factory, $view); <ide> } <ide> <ide> /**
1
Text
Text
fix default server timeout description for https
26cb448b0d74fa6440ca77ca83b1adba6cc50a87
<ide><path>doc/api/https.md <ide> See [`http.Server#setTimeout()`][]. <ide> ### `server.timeout` <ide> <!-- YAML <ide> added: v0.11.2 <add>changes: <add> - version: v13.0.0 <add> pr-url: https://github.com/nodejs/node/pull/27558 <add> description: The default timeout changed from 120s to 0 (no timeout). <ide> --> <ide> <del>* {number} **Default:** `120000` (2 minutes) <add>* {number} **Default:** 0 (no timeout) <ide> <ide> See [`http.Server#timeout`][]. <ide>
1
Text
Text
add zyszys to collaborators
174da74701b28eeeb70a59045f2f1f44839cda51
<ide><path>README.md <ide> For information about the governance of the Node.js project, see <ide> **Yorkie Liu** &lt;[email protected]&gt; <ide> * [yosuke-furukawa](https://github.com/yosuke-furukawa) - <ide> **Yosuke Furukawa** &lt;[email protected]&gt; <add>* [ZYSzys](https://github.com/ZYSzys) - <add>**Yongsheng Zhang** &lt;[email protected]&gt; (he/him) <ide> <ide> ### Collaborator Emeriti <ide>
1
Ruby
Ruby
remove tests for not swallowing exceptions
2b0406cedb61c4c2f74ecca61fc07771e911fd35
<ide><path>activerecord/test/cases/adapters/mysql/connection_test.rb <ide> def test_mysql_set_session_variable_to_default <ide> end <ide> end <ide> <del> def test_mysql_begin_db_transaction_can_throw_an_exception <del> @connection.expects(:exec_query).with('BEGIN').raises('OH NOES') <del> assert_raise RuntimeError do <del> @connection.begin_db_transaction <del> end <del> end <del> <del> def test_mysql_commit_db_transaction_can_throw_an_exception <del> @connection.expects(:execute).with('COMMIT').raises('OH NOES') <del> assert_raise RuntimeError do <del> @connection.commit_db_transaction <del> end <del> end <del> <del> def test_mysql_rollback_db_transaction_can_throw_an_exception <del> @connection.expects(:execute).with('ROLLBACK').raises('OH NOES') <del> assert_raise RuntimeError do <del> @connection.rollback_db_transaction <del> end <del> end <del> <ide> private <ide> <ide> def run_without_connection <ide><path>activerecord/test/cases/adapters/mysql2/connection_test.rb <ide> def test_logs_name_rename_column_sql <ide> @connection.execute "DROP TABLE `bar_baz`" <ide> end <ide> <del> def test_mysql_begin_db_transaction_can_throw_an_exception <del> @connection.expects(:execute).with('BEGIN').raises('OH NOES') <del> assert_raise RuntimeError do <del> @connection.begin_db_transaction <del> end <del> end <del> <del> def test_mysql_commit_db_transaction_can_throw_an_exception <del> @connection.expects(:execute).with('COMMIT').raises('OH NOES') <del> assert_raise RuntimeError do <del> @connection.commit_db_transaction <del> end <del> end <del> <del> def test_mysql_rollback_db_transaction_can_throw_an_exception <del> @connection.expects(:execute).with('ROLLBACK').raises('OH NOES') <del> assert_raise RuntimeError do <del> @connection.rollback_db_transaction <del> end <del> end <del> <ide> private <ide> <ide> def run_without_connection
2
Text
Text
simplify example usage instructions
c03d4931debae938f1916c9ee85777a159d26371
<ide><path>contributing.md <ide> Deploy the example using [Vercel](https://vercel.com/now): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example DIRECTORY_NAME DIRECTORY_NAME-app <ide> yarn create next-app --example DIRECTORY_NAME DIRECTORY_NAME-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/DIRECTORY_NAME <del>cd DIRECTORY_NAME <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> ```` <ide><path>examples/active-class-name/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example active-class-name active-class-name-app <ide> yarn create next-app --example active-class-name active-class-name-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/active-class-name <del>cd active-class-name <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/amp-first/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example amp-first amp-first-app <ide> yarn create next-app --example amp-first amp-first-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/amp-first <del>cd amp-first <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Open [http://localhost:3000](http://localhost:3000) to view it in the browser. The page will reload if you make edits. You will also see AMP validation errors in the console. <ide> <ide> ## Todo <ide><path>examples/amp-story/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example amp-story amp-app <ide> yarn create next-app --example amp-story amp-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/amp-story <del>cd amp-story <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/amp/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example amp amp-app <ide> yarn create next-app --example amp amp-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/amp <del>cd amp <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/analyze-bundles/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example analyze-bundles analyze-bundles-app <ide> yarn create next-app --example analyze-bundles analyze-bundles-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/analyze-bundles <del>cd analyze-bundles <del>``` <del> <del>Install it <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> ### Analyze webpack output <ide> <ide> To analyze your webpack output, invoke the following command: <ide><path>examples/api-routes-apollo-server-and-client-auth/README.md <ide> In this simple example, we integrate Apollo seamlessly with [Next.js data fetchi <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) or [npx](https://github.com/zkat/npx#readme) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example api-routes-apollo-server-and-client-auth api-route <ide> yarn create next-app --example api-routes-apollo-server-and-client-auth api-routes-apollo-server-and-client-auth-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/api-routes-apollo-server-and-client-auth <del>cd api-routes-apollo-server-and-client-auth <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/api-routes-apollo-server-and-client/README.md <ide> In this simple example, we integrate Apollo seamlessly with [Next.js data fetchi <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example api-routes-apollo-server-and-client api-routes-apo <ide> yarn create next-app --example api-routes-apollo-server-and-client api-routes-apollo-server-and-client-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/api-routes-apollo-server-and-client <del>cd api-routes-apollo-server-and-client <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/api-routes-apollo-server/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example api-routes-apollo-server api-routes-apollo-server- <ide> yarn create next-app --example api-routes-apollo-server api-routes-apollo-server-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/api-routes-apollo-server <del>cd api-routes-apollo-server <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> ## Notes <ide><path>examples/api-routes-graphql/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example api-routes-graphql api-routes-graphql-app <ide> yarn create next-app --example api-routes-graphql api-routes-graphql-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/api-routes-graphql <del>cd api-routes-graphql <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/api-routes-middleware/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example api-routes-middleware api-routes-middleware-app <ide> yarn create next-app --example api-routes-middleware api-routes-middleware-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/api-routes-middleware <del>cd api-routes-middleware <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/api-routes-rest/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide><path>examples/api-routes/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example api-routes api-routes-app <ide> yarn create next-app --example api-routes api-routes-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/api-routes <del>cd api-routes <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/basic-export/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example basic-export basic-export-app <ide> yarn create next-app --example basic-export basic-export-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/basic-export <del>cd basic-export <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/blog-starter-typescript/README.md <ide> Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_mediu <ide> <ide> [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/git?c=1&s=https://github.com/vercel/next.js/tree/canary/examples/blog-starter-typescript) <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example blog-starter-typescript blog-starter-typescript-ap <ide> yarn create next-app --example blog-starter-typescript blog-starter-typescript-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/blog-starter-typescript <del>cd blog-starter-typescript <del>``` <del> <del>Install dependencies and run the example: <del> <del>```bash <del>npm install <del>npm run dev <del> <del># or <del> <del>yarn install <del>yarn dev <del>``` <del> <ide> Your blog should be up and running on [http://localhost:3000](http://localhost:3000)! If it doesn't work, post on [GitHub discussions](https://github.com/vercel/next.js/discussions). <ide> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/blog-starter/README.md <ide> Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_mediu <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example blog-starter blog-starter-app <ide> yarn create next-app --example blog-starter blog-starter-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/blog-starter <del>cd blog-starter <del>``` <del> <del>Install dependencies and run the example: <del> <del>```bash <del>npm install <del>npm run dev <del> <del># or <del> <del>yarn install <del>yarn dev <del>``` <del> <ide> Your blog should be up and running on [http://localhost:3000](http://localhost:3000)! If it doesn't work, post on [GitHub discussions](https://github.com/vercel/next.js/discussions). <ide> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/catch-all-routes/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example catch-all-routes catch-all-routes-app <ide> yarn create next-app --example catch-all-routes catch-all-routes-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/catch-all-routes <del>cd catch-all-routes <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/cms-agilitycms/README.md <ide> Once you have access to [the environment variables you'll need](#step-15-set-up- <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/zeit/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example cms-agilitycms cms-agilitycms-app <ide> yarn create next-app --example cms-agilitycms cms-agilitycms-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/cms-agilitycms <del>cd cms-agilitycms <del>``` <del> <ide> ## Configuration <ide> <ide> ### How is this Different from Other CMS Examples? <ide><path>examples/cms-buttercms/README.md <ide> Once you have access to [the environment variables you'll need](#step-2-set-up-e <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example cms-buttercms cms-buttercms-app <ide> yarn create next-app --example cms-buttercms cms-buttercms-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/cms-buttercms <del>cd cms-buttercms <del>``` <del> <ide> ## Configuration <ide> <ide> ### Step 1. Create an account on ButterCMS <ide><path>examples/cms-datocms/README.md <ide> Once you have access to [the environment variables you'll need](#step-5-set-up-e <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example cms-datocms cms-datocms-app <ide> yarn create next-app --example cms-datocms cms-datocms-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/cms-datocms <del>cd cms-datocms <del>``` <del> <ide> ## Configuration <ide> <ide> ### Step 1. Create an account and a project on DatoCMS <ide><path>examples/cms-graphcms/README.md <ide> Once you have access to [the environment variables you'll need](#step-3-set-up-e <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/zeit/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example cms-graphcms cms-graphcms-app <ide> yarn create next-app --example cms-graphcms cms-graphcms-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/cms-graphcms <del>cd cms-graphcms <del>``` <del> <ide> ## Configuration <ide> <ide> ### Step 1. Create an account and a project in GraphCMS <ide><path>examples/cms-kontent/README.md <ide> Once you have access to [the environment variables you'll need](#step-3-set-up-e <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide><path>examples/cms-prismic/README.md <ide> Once you have access to [the environment variables you'll need](#step-5-set-up-e <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example cms-prismic cms-prismic-app <ide> yarn create next-app --example cms-prismic cms-prismic-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/cms-prismic <del>cd cms-prismic <del>``` <del> <ide> ## Configuration <ide> <ide> ### Step 1. Create an account and a repository on Prismic <ide><path>examples/cms-sanity/README.md <ide> Once you have access to [the environment variables you'll need](#step-4-set-up-e <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example cms-sanity cms-sanity-app <ide> yarn create next-app --example cms-sanity cms-sanity-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/cms-sanity <del>cd cms-sanity <del>``` <del> <ide> ## Configuration <ide> <ide> ### Step 1. Create an account and a project on Sanity <ide><path>examples/cms-storyblok/README.md <ide> Once you have access to [the environment variables you'll need](#step-6-set-up-e <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example cms-storyblok cms-storyblok-app <ide> yarn create next-app --example cms-storyblok cms-storyblok-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/cms-storyblok <del>cd cms-storyblok <del>``` <del> <ide> ## Configuration <ide> <ide> ### Step 1. Create an account on Storyblok <ide><path>examples/cms-strapi/README.md <ide> Once you have access to [the environment variables you'll need](#step-7-set-up-e <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example cms-strapi cms-strapi-app <ide> yarn create next-app --example cms-strapi cms-strapi-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/cms-strapi <del>cd cms-strapi <del>``` <del> <ide> ## Configuration <ide> <ide> ### Step 1. Set up Strapi locally <ide><path>examples/cms-takeshape/README.md <ide> Once you have access to [the environment variables you'll need](#step-5-set-up-e <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example cms-takeshape cms-takeshape-app <ide> yarn create next-app --example cms-takeshape cms-takeshape-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/cms-takeshape <del>cd cms-takeshape <del>``` <del> <ide> ## Configuration <ide> <ide> ### Step 1. Create an account and a project on TakeShape <ide><path>examples/cms-wordpress/README.md <ide> Once you have access to [the environment variables you'll need](#step-3-set-up-e <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/zeit/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example cms-wordpress cms-wordpress-app <ide> yarn create next-app --example cms-wordpress cms-wordpress-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/cms-wordpress <del>cd cms-wordpress <del>``` <del> <ide> ## Configuration <ide> <ide> ### Step 1. Prepare your WordPress site <ide><path>examples/custom-routes-proxying/README.md <ide> This approach is very helpful when you are trying to incrementally migrate your <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example custom-routes-proxying custom-routes-proxying-app <ide> yarn create next-app --example custom-routes-proxying custom-routes-proxying-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/custom-routes-proxying <del>cd custom-routes-proxying <del>``` <del> <ide> ### Step 4. Run Next.js in development mode <ide> <ide> ```bash <ide><path>examples/custom-server-actionhero/README.md <ide> A more detailed example showcasing how to use fetch and web sockets to interact <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example custom-server-actionhero custom-server-actionhero- <ide> yarn create next-app --example custom-server-actionhero custom-server-actionhero-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/custom-server-actionhero <del>cd custom-server-actionhero <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run start <del># or <del>yarn <del>yarn start <del>``` <del> <ide> ## How does this work? <ide> <ide> 1. Create an initializer to load next.js and create a handler that can extract the normal node `req` and `res` from the connection <ide><path>examples/custom-server-express/README.md <ide> The example shows a server that serves the component living in `pages/a.js` when <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example custom-server-express custom-server-express-app <ide> yarn create next-app --example custom-server-express custom-server-express-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/custom-server-express <del>cd custom-server-express <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> ### Populate body property <ide> <ide> Without the use of the body-parser package `req.body` will return undefined. To get express to populate `req.body` you need to install the body parser package and call the package within server.js. <ide><path>examples/custom-server-fastify/README.md <ide> The example shows a server that serves the component living in `pages/a.js` when <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example custom-server-fastify custom-server-fastify-app <ide> # or <ide> yarn create next-app --example custom-server-fastify custom-server-fastify-app <ide> ``` <del> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/custom-server-fastify <del>cd custom-server-fastify <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <ide><path>examples/custom-server-hapi/README.md <ide> The example shows a server that serves the component living in `pages/a.js` when <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example custom-server-hapi custom-server-hapi-app <ide> # or <ide> yarn create next-app --example custom-server-hapi custom-server-hapi-app <ide> ``` <del> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/custom-server-hapi <del>cd custom-server-hapi <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <ide><path>examples/custom-server-koa/README.md <ide> The example shows a server that serves the component living in `pages/a.js` when <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example custom-server-koa custom-server-koa-app <ide> yarn create next-app --example custom-server-koa custom-server-koa-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/custom-server-koa <del>cd custom-server-koa <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> ## Side note: Enabling gzip compression <ide> <ide> The most common Koa middleware for handling the gzip compression is [compress](https://github.com/koajs/compress), but unfortunately it is currently not compatible with Next.<br> <ide><path>examples/custom-server-polka/README.md <ide> The example shows a server that serves the component living in `pages/a.js` when <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example custom-server-polka custom-server-polka-app <ide> # or <ide> yarn create next-app --example custom-server-polka custom-server-polka-app <ide> ``` <del> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/custom-server-polka <del>cd custom-server-polka <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <ide><path>examples/custom-server-typescript/README.md <ide> The second directory should be added to `.gitignore`. <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example custom-server-typescript custom-server-typescript-app <ide> # or <ide> yarn create next-app --example custom-server-typescript custom-server-typescript-app <ide> ``` <del> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/custom-server-typescript <del>cd custom-server-typescript <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <ide><path>examples/custom-server/README.md <ide> The example shows a server that serves the component living in `pages/a.js` when <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example custom-server custom-server-app <ide> # or <ide> yarn create next-app --example custom-server custom-server-app <ide> ``` <del> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/custom-server <del>cd custom-server <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <ide><path>examples/dynamic-routing/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example dynamic-routing dynamic-routing-app <ide> yarn create next-app --example dynamic-routing dynamic-routing-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/dynamic-routing <del>cd dynamic-routing <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/gh-pages/README.md <ide> This example shows the most basic idea behind Next. We have 2 pages: `pages/inde <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example gh-pages gh-pages-app <ide> yarn create next-app --example gh-pages gh-pages-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/gh-pages <del>cd gh-pages <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> ### Deploy it to github <ide> <ide> Edit `env-config.js` and replace `'Next-gh-page-example'` by your project name. <ide><path>examples/head-elements/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example head-elements head-elements-app <ide> yarn create next-app --example head-elements head-elements-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/head-elements <del>cd head-elements <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/hello-world/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example hello-world hello-world-app <ide> yarn create next-app --example hello-world hello-world-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/hello-world <del>cd hello-world <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/layout-component/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example layout-component layout-component-app <ide> yarn create next-app --example layout-component layout-component-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/layout-component <del>cd layout-component <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/nested-components/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example nested-components nested-components-app <ide> yarn create next-app --example nested-components nested-components-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/nested-components <del>cd nested-components <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/progressive-render/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example progressive-render progressive-render-app <ide> yarn create next-app --example progressive-render progressive-render-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/progressive-render <del>cd progressive-render <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/ssr-caching/README.md <ide> This app uses Next's [custom server and routing](https://nextjs.org/docs/advance <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example ssr-caching ssr-caching-app <ide> yarn create next-app --example ssr-caching ssr-caching-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/ssr-caching <del>cd ssr-caching <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/svg-components/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example svg-components svg-components-app <ide> yarn create next-app --example svg-components svg-components-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/svg-components <del>cd svg-components <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/using-preact/README.md <ide> This example uses [Preact](https://github.com/preactjs/preact) instead of React. <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example using-preact using-preact-app <ide> yarn create next-app --example using-preact using-preact-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/using-preact <del>cd using-preact <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/using-router/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example using-router using-router-app <ide> yarn create next-app --example using-router using-router-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/using-router <del>cd using-router <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-absolute-imports/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-absolute-imports with-absolute-imports-app <ide> yarn create next-app --example with-absolute-imports with-absolute-imports-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-absolute-imports <del>cd with-absolute-imports <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-algolia-react-instantsearch/README.md <ide> The goal of this example is to illustrate how you can use [Algolia React Instant <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-algolia-react-instantsearch with-algolia-reac <ide> yarn create next-app --example with-algolia-react-instantsearch with-algolia-react-instantsearch-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-algolia-react-instantsearch <del>cd with-algolia-react-instantsearch <del>``` <del> <del>Set up Algolia: <del> <del>- create an [algolia](https://www.algolia.com/) account or use this already [configured index](https://community.algolia.com/react-instantsearch/Getting_started.html#before-we-start) <del>- update the appId, apikey and indexName you want to search on in components/app.js <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-ant-design-less/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-ant-design-less with-ant-design-app <ide> yarn create next-app --example with-ant-design-less with-ant-design-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-ant-design-less <del>cd with-ant-design-less <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-ant-design-mobile/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-ant-design-mobile with-ant-design-mobile-app <ide> yarn create next-app --example with-ant-design-mobile with-ant-design-mobile-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-ant-design-mobile <del>cd with-ant-design-mobile <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-ant-design-pro-layout-less/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-ant-design-pro-layout-less with-ant-design-ap <ide> yarn create next-app --example with-ant-design-pro-layout-less with-ant-design-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-ant-design-pro-layout-less <del>cd with-ant-design-pro-layout-less <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-ant-design/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-ant-design with-ant-design-app <ide> yarn create next-app --example with-ant-design with-ant-design-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-ant-design <del>cd with-ant-design <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-aphrodite/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-aphrodite with-aphrodite-app <ide> yarn create next-app --example with-aphrodite with-aphrodite-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-aphrodite <del>cd with-aphrodite <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-apollo-and-redux/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-apollo-and-redux with-apollo-and-redux-app <ide> yarn create next-app --example with-apollo-and-redux with-apollo-and-redux-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-apollo-and-redux <del>cd with-apollo-and-redux <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-apollo/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-apollo with-apollo-app <ide> yarn create next-app --example with-apollo with-apollo-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-apollo <del>cd with-apollo <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-app-layout/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-app-layout with-app-layout-app <ide> yarn create next-app --example with-app-layout with-app-layout-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-app-layout <del>cd with-app-layout <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-astroturf/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-astroturf with-astroturf-app <ide> yarn create next-app --example with-astroturf with-astroturf-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-astroturf <del>cd with-astroturf <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-aws-amplify-typescript/README.md <ide> Two routes are implemented : <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-aws-amplify-typescript nextjs-aws-amplify-typ <ide> yarn create next-app --example with-aws-amplify-typescript nextjs-aws-amplify-typescript-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-aws-amplify-typescript <del>cd with-aws-amplify-typescript <del>``` <del> <ide> ### Initialize and deploy the Amplify project <ide> <ide> <details> <ide><path>examples/with-aws-amplify/README.md <ide> Two routes are implemented : <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-aws-amplify nextjs-aws-amplify-app <ide> yarn create next-app --example with-aws-amplify nextjs-aws-amplify-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-aws-amplify <del>cd with-aws-amplify <del>``` <del> <ide> ### Initialize and deploy the Amplify project <ide> <ide> <details> <ide><path>examples/with-babel-macros/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-babel-macros with-babel-macros-app <ide> yarn create next-app --example with-babel-macros with-babel-macros-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-babel-macros <del>cd with-babel-macros <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> ## Note <ide><path>examples/with-carbon-components/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-carbon-components with-carbon-components-app <ide> yarn create next-app --example with-carbon-components with-carbon-components-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-carbon-components <del>cd with-carbon-components <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> ## Optimizations <ide><path>examples/with-cerebral/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-cerebral with-cerebral-app <ide> yarn create next-app --example with-cerebral with-cerebral-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-cerebral <del>cd with-cerebral <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-chakra-ui/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-chakra-ui with-chakra-ui-app <ide> yarn create next-app --example with-chakra-ui with-chakra-ui-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-chakra-ui <del>cd with-chakra-ui <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-context-api/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-context-api with-context-api-app <ide> yarn create next-app --example with-context-api with-context-api-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-context-api <del>cd with-context-api <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-cookie-auth-fauna/README.md <ide> The helper function `auth` helps to retrieve the token across pages and redirect <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-cookie-auth-fauna with-cookie-auth-fauna-app <ide> yarn create next-app --example with-cookie-auth-fauna with-cookie-auth-fauna-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example [or clone the repo](https://github.com/vercel/next.js): <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-cookie-auth-fauna <del>cd with-cookie-auth-fauna <del>``` <del> <ide> ### Run locally <ide> <ide> First, you'll need to create an account on [Fauna](https://fauna.com/), then follow these steps: <ide><path>examples/with-custom-babel-config/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-custom-babel-config with-custom-babel-config- <ide> yarn create next-app --example with-custom-babel-config with-custom-babel-config-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-custom-babel-config <del>cd with-custom-babel-config <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-custom-reverse-proxy/README.md <ide> Sorry for the extra packages. I belong to the minority camp of writing ES6 code <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-custom-reverse-proxy with-custom-reverse-prox <ide> yarn create next-app --example with-custom-reverse-proxy with-custom-reverse-proxy-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-custom-reverse-proxy <del>cd with-custom-reverse-proxy <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> ## What it does <ide> <ide> Take any random query string to the index page and does a GET to `/api/<query string>` which gets routed internally to `https://swapi.co/api/<query string>`, or any API endpoint you wish to configure through the proxy. <ide><path>examples/with-cxs/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-cxs with-cxs-app <ide> yarn create next-app --example with-cxs with-cxs-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-cxs <del>cd with-cxs <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-docker/README.md <ide> You can check the [Example Dockerfile for your own Node.js project](https://gith <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-docker with-docker-app <ide> yarn create next-app --example with-docker with-docker-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-docker <del>cd with-docker <del>``` <del> <ide> Build it with docker: <ide> <ide> ```bash <ide><path>examples/with-draft-js/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-draft-js <ide> yarn create next-app --example with-draft-js with-draft-js-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-draft-js <del>cd with-draft-js <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-dynamic-app-layout/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-dynamic-app-layout with-dynamic-app-layout-ap <ide> yarn create next-app --example with-dynamic-app-layout with-dynamic-app-layout-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-dynamic-app-layout <del>cd with-dynamic-app-layout <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-dynamic-import/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-dynamic-import with-dynamic-import-app <ide> yarn create next-app --example with-dynamic-import with-dynamic-import-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-dynamic-import <del>cd with-dynamic-import <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-electron-typescript/README.md <ide> For development it's going to run a HTTP server and let Next.js handle routing. <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-electron-typescript with-electron-typescript- <ide> yarn create next-app --example with-electron-typescript with-electron-typescript-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-electron-typescript <del>cd with-electron-typescript <del>``` <del> <del>To install and start dev build: <del> <del>```bash <del>yarn install && yarn build && yarn start <del>``` <del> <ide> Available commands: <ide> <ide> ```bash <ide><path>examples/with-electron/README.md <ide> For development it's going to run a HTTP server and let Next.js handle routing. <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-electron with-electron-app <ide> yarn create next-app --example with-electron with-electron-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-electron <del>cd with-electron <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run start <del># or <del>yarn <del>yarn start <del>``` <del> <ide> You can create the production app using `npm run dist`. <ide><path>examples/with-emotion-11/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-emotion-11 with-emotion-11-app <ide> yarn create next-app --example with-emotion-11 with-emotion-11-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-emotion-11 <del>cd with-emotion-11 <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-emotion/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-emotion with-emotion-app <ide> yarn create next-app --example with-emotion with-emotion-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-emotion <del>cd with-emotion <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-env-from-next-config-js/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-env-from-next-config-js <ide> yarn create next-app --example with-env-from-next-config-js <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-env-from-next-config-js <del>cd with-env-from-next-config-js <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> > ## Special note <ide><path>examples/with-expo-typescript/README.md <ide> Deploy the native app to the App store and Play store using [Expo deployment](ht <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide><path>examples/with-expo/README.md <ide> Deploy the native app to the App store and Play store using [Expo deployment](ht <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide><path>examples/with-fela/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-fela with-fela-app <ide> yarn create next-app --example with-fela with-fela-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-fela <del>cd with-fela <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-filbert/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-filbert with-filbert-app <ide> yarn create next-app --example with-filbert with-filbert-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-filbert <del>cd with-filbert <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-firebase-authentication/README.md <ide> This example includes Firebase authentication and serverless [API routes](https: <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) or [npx](https://github.com/zkat/npx#readme) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-firebase-authentication with-firebase-authent <ide> yarn create next-app --example with-firebase-authentication with-firebase-authentication-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-firebase-authentication <del>cd with-firebase-authentication <del>``` <del> <ide> ## Configuration <ide> <ide> Set up Firebase: <ide><path>examples/with-firebase-cloud-messaging/README.md <ide> To demo how to implement firebase cloud messaging to send web push notification <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-firebase-cloud-messaging with-firebase-cloud- <ide> yarn create next-app --example with-firebase-cloud-messaging with-firebase-cloud-messaging-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-firebase-cloud-messaging <del>cd with-firebase-cloud-messaging <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> ## Set your send id <ide> <ide> set your `messagingSenderId` in `static/firebase-messaging-sw.js` and `utils/webPush.js` <ide><path>examples/with-firebase-hosting/README.md <ide> If you are having issues, feel free to tag @jthegedus in the [issue you create o <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> yarn create next-app --example with-firebase-hosting with-firebase-hosting-app <ide> <ide> Update `.firebaserc`: adding your firebase project ID <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-firebase-hosting <del>cd with-firebase-hosting <del>``` <del> <del>Update `.firebaserc`: adding your firebase project ID <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del> <del># to run Firebase locally for testing: <del>npm run serve <del> <del># to deploy it to the cloud with Firebase: <del>npm run deploy <del>``` <del> <ide> ## Typescript <ide> <ide> To use Typescript, simply follow [Typescript setup](https://nextjs.org/learn/excel/typescript/setup) as normal (package.json scripts are already set). <ide><path>examples/with-flow/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-flow with-flow-app <ide> yarn create next-app --example with-flow with-flow-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-flow <del>cd with-flow <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-framer-motion/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-framer-motion with-framer-motion <ide> yarn create next-app --example with-framer-motion with-framer-motion <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-framer-motion <del>cd with-framer-motion <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run build <del>npm start <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-glamor/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-glamor with-glamor-app <ide> yarn create next-app --example with-glamor with-glamor-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-glamor <del>cd with-glamor <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-goober/README.md <ide> Deploy the example using [Vercel](https://vercel.com/now): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-goober with-goober-app <ide> yarn create next-app --example with-goober with-goober-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-goober <del>cd with-goober <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-google-analytics-amp/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:: <ide> <ide> ```bash <ide> npx create-next-app --example with-google-analytics-amp with-google-analytics-am <ide> yarn create next-app --example with-google-analytics-amp with-google-analytics-amp-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-google-analytics-amp <del>cd with-google-analytics-amp <del>``` <del> <del>Install it and run: <del> <del>```bash <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-google-analytics/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:: <ide> <ide> ```bash <ide> npx create-next-app --example with-google-analytics with-google-analytics-app <ide> yarn create next-app --example with-google-analytics with-google-analytics-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-google-analytics <del>cd with-google-analytics <del>``` <del> <del>Install it and run: <del> <del>```bash <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-graphql-faunadb/README.md <ide> This script will ask for the admin token. Once you provide it with a valid token <ide> <ide> At the end, the newly generated client token will be printed and should be used to replace the '< GRAPHQL_SECRET >' placeholder in the next.config.js config. <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ``` <ide> npx create-next-app --example with-graphql-faunadb with-graphql-faunadb <ide> yarn create next-app --example with-graphql-faunadb with-graphql-faunadb <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-graphql-faunadb <del>cd with-graphql-faunadb <del>``` <del> <ide> ### Run locally <ide> <ide> Install packages, then run the development server: <ide><path>examples/with-graphql-hooks/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-graphql-hooks with-graphql-hooks-app <ide> yarn create next-app --example with-graphql-hooks with-graphql-hooks-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-graphql-hooks <del>cd with-graphql-hooks <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-graphql-react/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-graphql-react with-graphql-react-app <ide> yarn create next-app --example with-graphql-react with-graphql-react-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-graphql-react <del>cd with-graphql-react <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> ## Notes <ide><path>examples/with-grommet/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-grommet with-grommet-app <ide> yarn create next-app --example with-grommet with-grommet-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-grommet <del>cd with-grommet <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> ### Try it on CodeSandbox <ide><path>examples/with-hls-js/README.md <ide> Deploy the example using [Vercel](https://vercel.com/now): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-hls-js with-hls-js-app <ide> yarn create next-app --example with-hls-js with-hls-js-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-hls-js <del>cd with-hls-js <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-http2/README.md <ide> This example shows the most basic example using an HTTP2 server. We have 2 pages <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-http2 with-http2-app <ide> yarn create next-app --example with-http2 with-http2-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-http2 <del>cd with-http2 <del>``` <del> <del>Create the public and private keys: <del> <del>```bash <del>openssl req -x509 -newkey rsa:2048 -nodes -sha256 -subj '/CN=localhost' \ <del> -keyout localhost-privkey.pem -out localhost-cert.pem <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-i18n-rosetta/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-i18n-rosetta with-i18n-rosetta <ide> yarn create next-app --example with-i18n-rosetta with-i18n-rosetta <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-i18n-rosetta <del>cd with-i18n-rosetta <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-iron-session/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-iron-session with-iron-session-app <ide> yarn create next-app --example with-iron-session with-iron-session-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-iron-session <del>cd with-iron-session <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-kea/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-kea with-kea-app <ide> yarn create next-app --example with-kea with-kea-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-kea <del>cd with-kea <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-linaria/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-linaria with-linaria-app <ide> yarn create next-app --example with-linaria with-linaria-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-linaria <del>cd with-linaria <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-lingui/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-lingui with-lingui-app <ide> yarn create next-app --example with-lingui with-lingui-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-lingui <del>cd with-lingui <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> ### How to add more translated strings <ide><path>examples/with-loading/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-loading with-loading-app <ide> yarn create next-app --example with-loading with-loading-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-loading <del>cd with-loading <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-magic/README.md <ide> Deploy the example using [Vercel Now](https://vercel.com/docs/now-cli#commands/o <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide><path>examples/with-mdx/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-mdx with-mdx-app <ide> yarn create next-app --example with-mdx with-mdx-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-mdx <del>cd with-mdx <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-mobx-react-lite/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-mobx-react-lite with-mobx-react-lite-app <ide> yarn create next-app --example with-mobx-react-lite with-mobx-react-lite-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-mobx-react-lite <del>cd with-mobx-react-lite <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> ## Implementation details <ide><path>examples/with-mobx-state-tree-typescript/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-mobx-state-tree-typescript with-mobx-state-tr <ide> yarn create next-app --example with-mobx-state-tree-typescript with-mobx-state-tree-typescript-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example [or clone the repo](https://github.com/vercel/next.js): <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-mobx-state-tree-typescript <del>cd with-mobx-state-tree-typescript <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-mobx-state-tree/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-mobx-state-tree with-mobx-state-tree-app <ide> yarn create next-app --example with-mobx-state-tree with-mobx-state-tree-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-mobx-state-tree <del>cd with-mobx-state-tree <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-mobx/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-mobx with-mobx-app <ide> yarn create next-app --example with-mobx with-mobx-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-mobx <del>cd with-mobx <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-mocha/README.md <ide> This example features an app with Mocha tests. <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-mocha with-mocha-app <ide> yarn create next-app --example with-mocha with-mocha-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-mocha <del>cd with-mocha <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> ## Run Mocha tests <ide> <ide> ```bash <ide><path>examples/with-monaco-editor/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-monaco-editor with-monaco-editor-app <ide> yarn create next-app --example with-monaco-editor with-monaco-editor-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-monaco-editor <del>cd with-monaco-editor <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-mongodb-mongoose/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-mongodb-mongoose with-mongodb-mongoose-app <ide> yarn create next-app --example with-mongodb-mongoose with-mongodb-mongoose-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-mongodb-mongoose <del>cd with-mongodb-mongoose <del>``` <del> <ide> ## Install and run: <ide> <ide> ```bash <ide><path>examples/with-mongodb/README.md <ide> Once you have access to the environment variables you'll need, deploy the exampl <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide><path>examples/with-netlify-cms/README.md <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-netlify-cms with-netlify-cms-app <ide> yarn create next-app --example with-netlify-cms with-netlify-cms-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-netlify-cms <del>cd with-netlify-cms <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> ## How it works <ide><path>examples/with-next-auth/README.md <ide> More details about the providers can be found [here](https://next-auth.js.org/co <ide> <ide> It is vital that you know the deployment URL and define it in the environment file. <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-next-auth with-next-auth-app <ide> yarn create next-app --example with-next-auth with-next-auth-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-next-auth <del>cd with-next-auth <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> **Note:** For production you need to know in advance the domain (deployment URL) of your application, as it would be required for OAuth to work, once you have it set it to the `VERCEL_URL` environment variable under the settings of your Vercel project. <ide><path>examples/with-next-css/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-next-css with-next-css-app <ide> yarn create next-app --example with-next-css with-next-css-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-next-css <del>cd with-next-css <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-next-less/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-next-less with-next-less-app <ide> yarn create next-app --example with-next-less with-next-less-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-next-less <del>cd with-next-less <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-next-offline/README.md <ide> This example demonstrates how to use the [next-offline plugin](https://github.co <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-next-offline with-next-offline-app <ide> yarn create next-app --example with-next-offline with-next-offline-app <ide> ``` <ide> <del>### Download <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-next-offline <del>cd with-next-offline <del>``` <del> <del>### Install dependecies <del> <del>```bash <del>npm install <del># or <del>yarn <del>``` <del> <del>### Build <del> <del>#### Static export <del> <del>```bash <del>npm run export <del># or <del>yarn export <del>``` <del> <del>To serve it yourself, you can run: <del> <del>```bash <del>npx serve -s out <del>``` <del> <del>#### Server hosted <del> <del>```bash <del>npm run build <del># or <del>yarn build <del>``` <del> <del>To serve it yourself, run: <del> <del>```bash <del>npm start <del># or <del>yarn start <del>``` <del> <del>### Deploy <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-next-page-transitions/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-next-page-transitions with-next-page-transiti <ide> yarn create next-app --example with-next-page-transitions with-next-page-transitions <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-next-page-transitions <del>cd with-next-page-transitions <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run build <del>npm start <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-next-sass/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-next-sass with-next-sass-app <ide> yarn create next-app --example with-next-sass with-next-sass-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-next-sass <del>cd with-next-sass <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Run production build with: <ide> <ide> ```bash <ide><path>examples/with-next-seo/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-next-seo next-seo-app <ide> yarn create next-app --example with-next-seo next-seo-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-next-seo <del>cd with-next-seo <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-next-translate/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-next-translate with-next-translate-app <ide> yarn create next-app --example with-next-translate with-next-translate-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-next-translate <del>cd with-next-translate <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> ## Notes <ide><path>examples/with-orbit-components/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-orbit-components with-orbit-components-app <ide> yarn create next-app --example with-orbit-components with-orbit-components-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-orbit-components <del>cd with-orbit-components <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-overmind/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-overmind with-overmind-app <ide> yarn create next-app --example with-overmind with-overmind-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-overmind <del>cd with-overmind <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> ## Notes <ide><path>examples/with-passport/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-passport with-passport-app <ide> yarn create next-app --example with-passport with-passport-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example [or clone the repo](https://github.com/vercel/next.js): <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-passport <del>cd with-passport <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-patternfly/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-patternfly with-patternfly-app <ide> yarn create next-app --example with-patternfly with-patternfly-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-patternfly <del>cd with-patternfly <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-polyfills/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-polyfills with-polyfills-app <ide> yarn create next-app --example with-polyfills with-polyfills-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-polyfills <del>cd with-polyfills <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-portals-ssr/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-portals-ssr with-portals-ssr <ide> yarn create next-app --example with-portals-ssr with-portals-ssr <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-portals-ssr <del>cd with-portals-ssr <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-portals/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-portals with-portals-app <ide> yarn create next-app --example with-portals with-portals-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-portals <del>cd with-portals <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-prefetching/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-prefetching with-prefetching-app <ide> yarn create next-app --example with-prefetching with-prefetching-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-prefetching <del>cd with-prefetching <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-quill-js/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-quill-js with-quill-js-app <ide> yarn create next-app --example with-quill-js with-quill-js-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-quill-js <del>cd with-quill-js <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-rbx-bulma-pro/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-rbx-bulma-pro with-rbx-bulma-pro-app <ide> yarn create next-app --example with-rbx-bulma-pro with-rbx-bulma-pro-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-rbx-bulma-pro <del>cd with-rbx-bulma-pro <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-react-bootstrap/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-react-bootstrap with-react-bootstrap-app <ide> yarn create next-app --example with-react-bootstrap with-react-bootstrap-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-react-bootstrap <del>cd with-react-bootstrap <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-react-ga/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-react-ga with-react-ga-app <ide> yarn create next-app --example with-react-ga with-react-ga-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-react-ga <del>cd with-react-ga <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-react-helmet/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-react-helmet with-react-helmet-app <ide> yarn create next-app --example with-react-helmet with-react-helmet-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-react-helmet <del>cd with-react-helmet <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-react-jss/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-react-jss with-react-jss-app <ide> yarn create next-app --example with-react-jss with-react-jss-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-react-jss <del>cd with-react-jss <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-react-md-typescript/README.md <ide> Deploy the example using [Vercel](https://vercel.com/now): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide><path>examples/with-react-md/README.md <ide> Deploy the example using [Vercel](https://vercel.com/now): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide><path>examples/with-react-multi-carousel/README.md <ide> _Live Example: https://react-multi-carousel.now.sh_ <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-react-multi-carousel with-react-multi-carouse <ide> yarn create next-app --example with-react-multi-carousel with-react-multi-carousel-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-react-multi-carousel <del>cd with-react-multi-carousel <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> ## How does it work with ssr? <ide><path>examples/with-react-native-web/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-react-native-web <ide> yarn create next-app --example with-react-native-web with-react-native-web-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-react-native-web <del>cd with-react-native-web <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-react-relay-network-modern/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-react-relay-network-modern with-react-relay-n <ide> yarn create next-app --example with-react-relay-network-modern with-react-relay-network-modern-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-relay-modern <del>cd with-relay-modern <del>``` <del> <del>Install it: <del> <del>```bash <del>npm install <del># or <del>yarn <del>``` <del> <ide> Download schema introspection data from configured Relay endpoint <ide> <ide> ```bash <ide><path>examples/with-react-toolbox/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-react-toolbox with-react-toolbox-app <ide> yarn create next-app --example with-react-toolbox with-react-toolbox-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-react-toolbox <del>cd with-react-toolbox <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Notice that `yarn toolbox` (or `npm run toolbox`) should be rerun every time the `"reactToolbox"` configuration in `package.json` is changed, in order to update `/theme.js` and `public/theme.css`. The `"reactToolbox"` configuration includes styling, and the list of react-toolbox components to include. <ide> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-react-with-styles/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-react-with-styles with-react-with-styles-app <ide> yarn create next-app --example with-react-with-styles with-react-with-styles-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-react-with-styles <del>cd with-react-with-styles <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-realm-web/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-realm-web with-realm-web-app <ide> yarn create next-app --example with-realm-web with-realm-web-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-realm-web <del>cd with-realm-web <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> ## Configuration <ide><path>examples/with-reason-relay/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-reason-relay with-reason-relay <ide> yarn create next-app --example with-reason-relay with-reason-relay <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-reason-relay <del>cd with-reason-relay <del>``` <del> <del>Install it: <del> <del>```bash <del>npm install <del># or <del>yarn <del>``` <del> <del>Download schema introspection data from configured Relay endpoint <del> <del>```bash <del>npm run schema <del># or <del>yarn schema <del>``` <del> <del>Run Relay ahead-of-time compilation (should be re-run after any edits to components that query data with Relay) <del> <del>```bash <del>npm run relay <del># or <del>yarn relay <del>``` <del> <del>Build the project <del> <del>```bash <del>npm run build <del># or <del>yarn build <del>``` <del> <del>Run the project <del> <del>```bash <del>npm run dev <del># or <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-reasonml-todo/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-reasonml-todo with-reasonml-app <ide> yarn create next-app --example with-reasonml-todo with-reasonml-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-reasonml-todo <del>cd with-reasonml-todo <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <del>Build and run: <del> <del>```bash <del>npm run build <del>npm run start <del># or <del>yarn build <del>yarn start <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> ### Recommendation: <ide><path>examples/with-reasonml/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-reasonml with-reasonml-app <ide> yarn create next-app --example with-reasonml with-reasonml-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-reasonml <del>cd with-reasonml <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <del>Build and run: <del> <del>```bash <del>npm run build <del>npm run start <del># or <del>yarn build <del>yarn start <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> ### Recommendation: <ide><path>examples/with-rebass/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-rebass with-rebass-app <ide> yarn create next-app --example with-rebass with-rebass-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-rebass <del>cd with-rebass <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>ln -f -s ../node_modules/react-md/dist/react-md.light_blue-yellow.min.css static/react-md.light_blue-yellow.min.css <del>npm run dev <del># or <del>yarn <del>ln -f -s ../node_modules/react-md/dist/react-md.light_blue-yellow.min.css static/react-md.light_blue-yellow.min.css <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-recoil/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/zeit/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-recoil with-recoil-app <ide> yarn create next-app --example with-recoil with-recoil-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-recoil <del>cd with-recoil <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-redux-code-splitting/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-redux-code-splitting with-redux-code-splittin <ide> yarn create next-app --example with-redux-code-splitting with-redux-code-splitting-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-redux-code-splitting <del>cd with-redux-code-splitting <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-redux-observable/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-redux-observable with-redux-observable-app <ide> yarn create next-app --example with-redux-observable with-redux-observable-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-redux-observable <del>cd with-redux-observable <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> Note: we are not using `AjaxObservable` from the `rxjs` library; as of rxjs <ide><path>examples/with-redux-persist/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-redux-persist with-redux-persist-app <ide> yarn create next-app --example with-redux-persist with-redux-persist-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-redux-persist <del>cd with-redux-persist <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> ## Notes <ide><path>examples/with-redux-saga/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-redux-saga with-redux-saga-app <ide> yarn create next-app --example with-redux-saga with-redux-saga-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-redux-saga <del>cd with-redux-saga <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> ## Notes <ide><path>examples/with-redux-thunk/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-redux-thunk with-redux-thunk-app <ide> yarn create next-app --example with-redux-thunk with-redux-thunk-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-redux-thunk <del>cd with-redux-thunk <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> ## Notes <ide><path>examples/with-redux-toolkit/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-redux-toolkit with-redux-toolkit-app <ide> yarn create next-app --example with-redux-toolkit with-redux-toolkit-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-redux-toolkit <del>cd with-redux-toolkit <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-redux-wrapper/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-redux-wrapper with-redux-wrapper-app <ide> yarn create next-app --example with-redux-wrapper with-redux-wrapper-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-redux-wrapper <del>cd with-redux-wrapper <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> ## Notes <ide><path>examples/with-redux/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide><path>examples/with-reflux/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-reflux with-reflux-app <ide> yarn create next-app --example with-reflux with-reflux-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-reflux <del>cd with-reflux <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-relay-modern/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-relay-modern with-relay-modern-app <ide> yarn create next-app --example with-relay-modern with-relay-modern-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-relay-modern <del>cd with-relay-modern <del>``` <del> <del>Install it: <del> <del>```bash <del>npm install <del># or <del>yarn <del>``` <del> <ide> Download schema introspection data from configured Relay endpoint <ide> <ide> ```bash <ide><path>examples/with-rematch/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:: <ide> <ide> ```bash <ide> npx create-next-app --example with-rematch with-rematch-app <ide> yarn create next-app --example with-rematch with-rematch-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-rematch <del>cd with-rematch <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> ## Directory structure <ide><path>examples/with-route-as-modal/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-route-as-modal with-route-as-modal-app <ide> yarn create next-app --example with-route-as-modal with-route-as-modal-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-route-as-modal <del>cd with-route-as-modal <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-segment-analytics/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-segment-analytics with-segment-analytics-app <ide> yarn create next-app --example with-segment-analytics with-segment-analytics-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-segment-analytics <del>cd with-segment-analytics <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-semantic-ui/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-semantic-ui with-semantic-ui-app <ide> yarn create next-app --example with-semantic-ui with-semantic-ui-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-semantic-ui <del>cd with-semantic-ui <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-sentry/README.md <ide> Once you have access to your [Sentry DSN](#step-1-enable-error-tracking), deploy <ide> <ide> ## How To Use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide><path>examples/with-shallow-routing/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-shallow-routing with-shallow-routing-app <ide> yarn create next-app --example with-shallow-routing with-shallow-routing-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-shallow-routing <del>cd with-shallow-routing <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-sitemap/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-sitemap with-sitemap-app <ide> yarn create next-app --example with-sitemap with-sitemap-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-sitemap <del>cd with-sitemap <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Your app should be up and running on [http://localhost:3000](http://localhost:3000) and the sitemap should now be available in [http://localhost:3000/sitemap.xml](http://localhost:3000/sitemap.xml)! If it doesn't work, post on [GitHub discussions](https://github.com/vercel/next.js/discussions). <ide> <ide> To change the website URL used by `sitemap.xml`, open the file `.env` and change the `WEBSITE_URL` environment variable: <ide><path>examples/with-slate/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:: <ide> <ide> ```bash <ide> npx create-next-app --example with-slate with-slate-app <ide> yarn create next-app --example with-slate with-slate-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example [or clone the repo](https://github.com/vercel/next.js): <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-slate <del>cd with-slate <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-static-export/README.md <ide> When trying to run `npm start` it will build and export your pages into the `out <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-static-export with-static-export-app <ide> # or <ide> yarn create next-app --example with-static-export with-static-export-app <ide> ``` <del> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-static-export <del>cd with-static-export <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <ide><path>examples/with-stencil/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) or [npx](https://github.com/zkat/npx#readme) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-stencil with-stencil-app <ide> yarn create next-app --example with-stencil with-stencil-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-stencil <del>cd with-stencil <del>``` <del> <del>Build stencil component: <del> <del>```bash <del>cd packages/test-component <del>yarn build <del>``` <del> <del>Install it and run: <del> <del>```bash <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> > Choose `packages/web-app` as root directory when deploying. <ide><path>examples/with-stomp/README.md <ide> Read more about [STOMP](http://jmesnil.net/stomp-websocket/doc/) protocol. <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-stomp with-stomp-app <ide> # or <ide> yarn create next-app --example with-stomp with-stomp-app <ide> ``` <del> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-stomp <del>cd with-stomp <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>STOMP_SERVER=wss://some.stomp.server npm run dev <del># or <del>yarn <del>STOMP_SERVER=wss://some.stomp.server yarn dev <del>``` <del> <del>You'll need to provide the STOMP url of your server in `STOMP_SERVER` <del> <del>> If you're on Windows you may want to use [cross-env](https://www.npmjs.com/package/cross-env) <ide><path>examples/with-storybook/README.md <ide> As of v6.0, Storybook has built-in TypeScript support, so no configuration is ne <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-storybook with-storybook-app <ide> yarn create next-app --example with-storybook with-storybook-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-storybook <del>cd with-storybook <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> ## Run Storybook <ide> <ide> ```bash <ide><path>examples/with-strict-csp/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-strict-csp-hash with-strict-csp-hash-app <ide> yarn create next-app --example with-strict-csp-hash with-strict-csp-hash-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-strict-csp <del>cd with-strict-csp <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-stripe-typescript/README.md <ide> Once you have access to [the environment variables you'll need](#required-config <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-stripe-typescript with-stripe-typescript-app <ide> yarn create next-app --example with-stripe-typescript with-stripe-typescript-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-stripe-typescript <del>cd with-stripe-typescript <del>``` <del> <ide> ### Required configuration <ide> <ide> Copy the `.env.local.example` file into a file named `.env.local` in the root directory of this project: <ide><path>examples/with-style-sheet/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-style-sheet with-style-sheet-app <ide> yarn create next-app --example with-style-sheet with-style-sheet-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-style-sheet <del>cd with-style-sheet <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-styled-components-rtl/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-styled-components-rtl with-styled-components- <ide> yarn create next-app --example with-styled-components-rtl with-styled-components-rtl-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-styled-components-rtl <del>cd with-styled-components-rtl <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> ## Notes <ide><path>examples/with-styled-components/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-styled-components with-styled-components-app <ide> yarn create next-app --example with-styled-components with-styled-components-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-styled-components <del>cd with-styled-components <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> ### Try it on CodeSandbox <ide><path>examples/with-styled-jsx-plugins/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-styled-jsx-plugins with-styled-jsx-plugins-ap <ide> yarn create next-app --example with-styled-jsx-plugins with-styled-jsx-plugins-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-styled-jsx-plugins <del>cd with-styled-jsx-plugins <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-styled-jsx-scss/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-styled-jsx-scss with-styled-jsx-scss-app <ide> yarn create next-app --example with-styled-jsx-scss with-styled-jsx-scss-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-styled-jsx-scss <del>cd with-styled-jsx-scss <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-styletron/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-styletron with-styletron-app <ide> yarn create next-app --example with-styletron with-styletron-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-styletron <del>cd with-styletron <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-tailwindcss-emotion/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-tailwindcss-emotion with-tailwindcss-emotion- <ide> yarn create next-app --example with-tailwindcss-emotion with-tailwindcss-emotion-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-tailwindcss-emotion <del>cd with-tailwindcss-emotion <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> ## Notes <ide><path>examples/with-tailwindcss/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-tailwindcss with-tailwindcss-app <ide> yarn create next-app --example with-tailwindcss with-tailwindcss-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-tailwindcss <del>cd with-tailwindcss <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> ## Notes <ide><path>examples/with-tesfy/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-tesfy with-tesfy-app <ide> yarn create next-app --example with-tesfy with-tesfy-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-tesfy <del>cd with-tesfy <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-three-js/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-three-js <ide> yarn create next-app --example with-three-js <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-three-js <del>cd with-three-js <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-typescript-eslint-jest/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-typescript-eslint-jest with-typescript-eslint <ide> yarn create next-app --example with-typescript-eslint-jest with-typescript-eslint-jest-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-typescript-eslint-jest <del>cd with-typescript-eslint-jest <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-typescript-graphql/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-typescript-graphql with-typescript-graphql-ap <ide> yarn create next-app --example with-typescript-graphql with-typescript-graphql-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-typescript-graphql <del>cd with-typescript-graphql <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-typescript-styled-components/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use it? <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-typescript-styled-components with-typescript- <ide> yarn create next-app --example with-typescript-styled-components with-typescript-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-typescript-styled-components <del>cd with-typescript-styled-components <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> ## Notes <ide><path>examples/with-typescript/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use it? <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-typescript with-typescript-app <ide> yarn create next-app --example with-typescript with-typescript-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-typescript <del>cd with-typescript <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> ## Notes <ide><path>examples/with-typestyle/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-typestyle with-typestyle-app <ide> yarn create next-app --example with-typestyle with-typestyle-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-typestyle <del>cd with-typestyle <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-unsplash/README.md <ide> Once you have access to [the environment variables you'll need](#step-2-set-up-e <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide><path>examples/with-unstated/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-unstated with-unstated-app <ide> yarn create next-app --example with-unstated with-unstated-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-unstated <del>cd with-unstated <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-urql/README.md <ide> Deploy the example using [Vercel](https://vercel.com/now): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-urql with-urql-app <ide> yarn create next-app --example with-urql with-urql-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-urql <del>cd with-urql <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-userbase/README.md <ide> Once you have access to [the environment variables you'll need](#step-2-setting- <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-userbase next-userbase-app <ide> yarn create next-app --example with-userbase next-userbase-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-userbase <del>cd with-userbase <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> ## Configuration <ide> <ide> ### Step 1. Create an account on Userbase <ide><path>examples/with-videojs/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:: <ide> <ide> ```bash <ide> npx create-next-app --example with-videojs with-videojs-app <ide> yarn create next-app --example with-videojs with-videojs-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-videojs <del>cd with-videojs <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-web-worker/README.md <ide> Deploy the example using [Vercel](https://vercel.com/): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-web-worker with-web-worker-app <ide> yarn create next-app --example with-web-worker with-web-worker-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-web-worker <del>cd with-web-worker <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-webassembly/README.md <ide> This example shows how to import WebAssembly files (`.wasm`) and use them inside <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-webassembly with-webassembly-app <ide> yarn create next-app --example with-webassembly with-webassembly-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-webassembly <del>cd with-webassembly <del>``` <del> <del>Install it and run: <del> <del>This example uses Rust compiled to wasm, the wasm file is included in the example, but to compile your own Rust code you'll have to [install](https://www.rust-lang.org/learn/get-started) Rust. <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <del>To compile `src/add.rs` to `add.wasm` use `npm run build-rust`. <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-webpack-bundle-size-analyzer/README.md <ide> This example shows how to analyze the output bundles using [webpack-bundle-size- <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-webpack-bundle-size-analyzer with-webpack-bun <ide> yarn create next-app --example with-webpack-bundle-size-analyzer with-webpack-bundle-size-analyzer-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-webpack-bundle-size-analyzer <del>cd with-webpack-bundle-size-analyzer <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> ## Notes <ide> <ide> To analyze your webpack output, invoke the following command: <ide><path>examples/with-why-did-you-render/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-why-did-you-render with-why-did-you-render-ap <ide> yarn create next-app --example with-why-did-you-render with-why-did-you-render-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-why-did-you-render <del>cd with-why-did-you-render <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/new?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> [![Deploy To Now](https://deploy.now.sh/static/button.svg)](https://deploy.now.sh/?repo=https://github.com/vercel/next.js/tree/master/examples/with-why-did-you-render) <ide><path>examples/with-xstate/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-xstate with-xstate-app <ide> yarn create next-app --example with-xstate with-xstate-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-xstate <del>cd with-xstate <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-yarn-workspaces/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-yarn-workspaces with-yarn-workspaces-app <ide> yarn create next-app --example with-yarn-workspaces with-yarn-workspaces-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-yarn-workspaces <del>cd with-yarn-workspaces <del>``` <del> <del>Install it and run: <del> <del>```bash <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide> <ide> > Choose `packages/web-app` as root directory when deploying. <ide><path>examples/with-zeit-fetch/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-zeit-fetch with-zeit-fetch-app <ide> yarn create next-app --example with-zeit-fetch with-zeit-fetch-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-zeit-fetch <del>cd with-zeit-fetch <del>``` <del> <del>Install it and run: <del> <del>```bash <del>npm install <del>npm run dev <del># or <del>yarn <del>yarn dev <del>``` <del> <ide> Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). <ide><path>examples/with-zones/README.md <ide> Deploy the example using [Vercel](https://vercel.com): <ide> <ide> ## How to use <ide> <del>### Using `create-next-app` <del> <ide> Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: <ide> <ide> ```bash <ide> npx create-next-app --example with-zones with-zones-app <ide> yarn create next-app --example with-zones with-zones-app <ide> ``` <ide> <del>### Download manually <del> <del>Download the example: <del> <del>```bash <del>curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-zones <del>cd with-zones <del>``` <del> <del>Install the dependencies of every app (`/home` and `/blog`): <del> <del>```bash <del>npm install <del># or <del>yarn <del>``` <del> <ide> Install the [Vercel CLI](https://vercel.com/download) if you don't have it already, and then run [`vercel dev`](https://vercel.com/docs/cli?query=dev#commands/dev) in the main directory to start the development server: <ide> <ide> ```bash
202
Javascript
Javascript
update example to use array annotations
dba8b7e95895cd1991fa057b8c85e8d4012b7beb
<ide><path>src/ng/sce.js <ide> function $SceDelegateProvider() { <ide> * <ide> * <example module="mySceApp" deps="angular-sanitize.js"> <ide> * <file name="index.html"> <del> * <div ng-controller="myAppController as myCtrl"> <add> * <div ng-controller="AppController as myCtrl"> <ide> * <i ng-bind-html="myCtrl.explicitlyTrustedHtml" id="explicitlyTrustedHtml"></i><br><br> <ide> * <b>User comments</b><br> <ide> * By default, HTML that isn't explicitly trusted (e.g. Alice's comment) is sanitized when <ide> function $SceDelegateProvider() { <ide> * </file> <ide> * <ide> * <file name="script.js"> <del> * var mySceApp = angular.module('mySceApp', ['ngSanitize']); <del> * <del> * mySceApp.controller("myAppController", function myAppController($http, $templateCache, $sce) { <del> * var self = this; <del> * $http.get("test_data.json", {cache: $templateCache}).success(function(userComments) { <del> * self.userComments = userComments; <del> * }); <del> * self.explicitlyTrustedHtml = $sce.trustAsHtml( <del> * '<span onmouseover="this.textContent=&quot;Explicitly trusted HTML bypasses ' + <del> * 'sanitization.&quot;">Hover over this text.</span>'); <del> * }); <add> * angular.module('mySceApp', ['ngSanitize']) <add> * .controller('AppController', ['$http', '$templateCache', '$sce', <add> * function($http, $templateCache, $sce) { <add> * var self = this; <add> * $http.get("test_data.json", {cache: $templateCache}).success(function(userComments) { <add> * self.userComments = userComments; <add> * }); <add> * self.explicitlyTrustedHtml = $sce.trustAsHtml( <add> * '<span onmouseover="this.textContent=&quot;Explicitly trusted HTML bypasses ' + <add> * 'sanitization.&quot;">Hover over this text.</span>'); <add> * }]); <ide> * </file> <ide> * <ide> * <file name="test_data.json">
1
Python
Python
write animations at the root
8ee9c980007eca2ff0cd8bdd6c06a59236ad3f64
<ide><path>utils/exporters/blender/addons/io_three/exporter/api/mesh.py <ide> def blend_shapes(mesh, options): <ide> return manifest <ide> <ide> @_mesh <del>def animated_blend_shapes(mesh, options): <add>def animated_blend_shapes(mesh, name, options): <ide> """ <ide> <ide> :param mesh: <ide> def animated_blend_shapes(mesh, options): <ide> animCurves = animCurves.action.fcurves <ide> <ide> for key in shp.key_blocks.keys()[1:]: # skip "Basis" <del> key_name = ".morphTargetInfluences["+key+"]" <add> key_name = name+".morphTargetInfluences["+key+"]" <ide> found_animation = False <ide> data_path = 'key_blocks["'+key+'"].value' <ide> values = [] <ide> def animated_blend_shapes(mesh, options): <ide> constants.KEYS: values <ide> }); <ide> <del> animation = [{ <del> constants.KEYFRAMES: tracks, <del> constants.FPS: context.scene.render.fps, <del> constants.NAME: "default" <del> }] <del> return animation <add> return tracks <ide> <ide> @_mesh <ide> def materials(mesh, options): <ide><path>utils/exporters/blender/addons/io_three/exporter/api/object.py <ide> def animated_xform(obj, options): <ide> return [] <ide> fcurves = fcurves.action.fcurves <ide> <add> objName = obj.name <add> <ide> tracks = [] <ide> i = 0 <ide> nb_curves = len(fcurves) <ide> def animated_xform(obj, options): <ide> track = [] <ide> track_loc.append(track) <ide> tracks.append({ <del> constants.NAME: field_info[0], <add> constants.NAME: objName+field_info[0], <ide> constants.TYPE: field_info[2], <ide> constants.KEYS: track <ide> }) <ide> def animated_xform(obj, options): <ide> context.scene.frame_set(original_frame, 0.0) # restore to original frame <ide> <ide> # TODO: remove duplicated key frames <del> <del> return [{ <del> constants.KEYFRAMES: tracks, <del> constants.FPS: context.scene.render.fps, <del> constants.NAME: obj.name <del> }] <add> return tracks <ide> <ide> @_object <ide> def mesh(obj, options): <ide><path>utils/exporters/blender/addons/io_three/exporter/geometry.py <ide> def _parse_geometry(self): <ide> logger.info("Parsing %s", constants.BLEND_SHAPES) <ide> mt = api.mesh.blend_shapes(self.node, self.options) or [] <ide> self[constants.MORPH_TARGETS] = mt <del> if len(mt) > 0: # there's blend shapes, let check for animation <del> self[constants.CLIPS] = api.mesh.animated_blend_shapes(self.node, self.options) or [] <del> <add> if len(mt) > 0 and self._scene: # there's blend shapes, let check for animation <add> #self[constants.CLIPS] = api.mesh.animated_blend_shapes(self.node, self.options) or [] <add> tracks = api.mesh.animated_blend_shapes(self.node, self[constants.NAME], self.options) or [] <add> merge = self._scene[constants.ANIMATION][0][constants.KEYFRAMES] <add> for track in tracks: <add> merge.append(track) <ide> <ide> # In the moment there is no way to add extra data to a Geomtry in <ide> # Three.js. In case there is some day, here is the code: <ide><path>utils/exporters/blender/addons/io_three/exporter/object.py <ide> def _node_setup(self): <ide> no_anim = (None, False, constants.OFF) <ide> if self.options.get(constants.KEYFRAMES) not in no_anim: <ide> logger.info("Export Transform Animation for %s", self.node) <del> self[constants.CLIPS] = api.object.animated_xform(self.node, self.options) <add> if self._scene: <add> # only when exporting scene <add> tracks = api.object.animated_xform(self.node, self.options) <add> merge = self._scene[constants.ANIMATION][0][constants.KEYFRAMES] <add> for track in tracks: <add> merge.append(track) <ide> <ide> if self.options.get(constants.HIERARCHY, False): <ide> for child in api.object.children(self.node, self.scene.valid_types): <ide><path>utils/exporters/blender/addons/io_three/exporter/scene.py <ide> io, <ide> api <ide> ) <del> <add>from bpy import context <ide> <ide> class Scene(base_classes.BaseScene): <ide> """Class that handles the contruction of a Three scene""" <ide> def __init__(self, filepath, options=None): <ide> constants.GEOMETRIES: [], <ide> constants.MATERIALS: [], <ide> constants.IMAGES: [], <del> constants.TEXTURES: [] <add> constants.TEXTURES: [], <add> constants.ANIMATION: [] <ide> } <ide> base_classes.BaseScene.__init__(self, filepath, options or {}) <ide> <ide> source_file = api.scene_name() <ide> if source_file: <ide> self[constants.METADATA][constants.SOURCE_FILE] = source_file <add> self.__init_animation() <add> <add> def __init_animation(self): <add> self[constants.ANIMATION].append({ <add> constants.NAME: "default", <add> constants.FPS : context.scene.render.fps, <add> constants.KEYFRAMES: [] <add> }); <add> pass <ide> <ide> @property <ide> def valid_types(self):
5
Ruby
Ruby
prevent state leak in test
20181e4fa94c50c8afe02181a5537e93caafcd2c
<ide><path>activerecord/test/cases/adapters/postgresql/schema_test.rb <ide> def test_dump_indexes_for_schema_multiple_schemas_in_search_path <ide> end <ide> <ide> def test_with_uppercase_index_name <del> ActiveRecord::Base.connection.execute "CREATE INDEX \"things_Index\" ON #{SCHEMA_NAME}.things (name)" <del> assert_nothing_raised { ActiveRecord::Base.connection.remove_index! "things", "#{SCHEMA_NAME}.things_Index"} <add> @connection.execute "CREATE INDEX \"things_Index\" ON #{SCHEMA_NAME}.things (name)" <add> assert_nothing_raised { @connection.remove_index! "things", "#{SCHEMA_NAME}.things_Index"} <add> @connection.execute "CREATE INDEX \"things_Index\" ON #{SCHEMA_NAME}.things (name)" <ide> <del> ActiveRecord::Base.connection.execute "CREATE INDEX \"things_Index\" ON #{SCHEMA_NAME}.things (name)" <del> ActiveRecord::Base.connection.schema_search_path = SCHEMA_NAME <del> assert_nothing_raised { ActiveRecord::Base.connection.remove_index! "things", "things_Index"} <del> ActiveRecord::Base.connection.schema_search_path = "public" <add> with_schema_search_path SCHEMA_NAME do <add> assert_nothing_raised { @connection.remove_index! "things", "things_Index"} <add> end <ide> end <ide> <ide> def test_primary_key_with_schema_specified <ide> def test_current_schema <ide> end <ide> <ide> def test_prepared_statements_with_multiple_schemas <add> [SCHEMA_NAME, SCHEMA2_NAME].each do |schema_name| <add> with_schema_search_path schema_name do <add> Thing5.create(:id => 1, :name => "thing inside #{SCHEMA_NAME}", :email => "thing1@localhost", :moment => Time.now) <add> end <add> end <ide> <del> @connection.schema_search_path = SCHEMA_NAME <del> Thing5.create(:id => 1, :name => "thing inside #{SCHEMA_NAME}", :email => "thing1@localhost", :moment => Time.now) <del> <del> @connection.schema_search_path = SCHEMA2_NAME <del> Thing5.create(:id => 1, :name => "thing inside #{SCHEMA2_NAME}", :email => "thing1@localhost", :moment => Time.now) <del> <del> @connection.schema_search_path = SCHEMA_NAME <del> assert_equal 1, Thing5.count <del> <del> @connection.schema_search_path = SCHEMA2_NAME <del> assert_equal 1, Thing5.count <add> [SCHEMA_NAME, SCHEMA2_NAME].each do |schema_name| <add> with_schema_search_path schema_name do <add> assert_equal 1, Thing5.count <add> end <add> end <ide> end <ide> <ide> def test_schema_exists?
1
Text
Text
remove double spaces in guides
53607be559ec60e3b5bd915f8533550648f7ef8a
<ide><path>guides/source/action_mailer_basics.md <ide> files (environment.rb, production.rb, etc...) <ide> | Configuration | Description | <ide> |---------------|-------------| <ide> |`logger`|Generates information on the mailing run if available. Can be set to `nil` for no logging. Compatible with both Ruby's own `Logger` and `Log4r` loggers.| <del>|`smtp_settings`|Allows detailed configuration for `:smtp` delivery method:<ul><li>`:address` - Allows you to use a remote mail server. Just change it from its default "localhost" setting.</li><li>`:port` - On the off chance that your mail server doesn't run on port 25, you can change it.</li><li>`:domain` - If you need to specify a HELO domain, you can do it here.</li><li>`:user_name` - If your mail server requires authentication, set the username in this setting.</li><li>`:password` - If your mail server requires authentication, set the password in this setting.</li><li>`:authentication` - If your mail server requires authentication, you need to specify the authentication type here. This is a symbol and one of `:plain`, `:login`, `:cram_md5`.</li><li>`:enable_starttls_auto` - Set this to `false` if there is a problem with your server certificate that you cannot resolve.</li></ul>| <add>|`smtp_settings`|Allows detailed configuration for `:smtp` delivery method:<ul><li>`:address` - Allows you to use a remote mail server. Just change it from its default "localhost" setting.</li><li>`:port` - On the off chance that your mail server doesn't run on port 25, you can change it.</li><li>`:domain` - If you need to specify a HELO domain, you can do it here.</li><li>`:user_name` - If your mail server requires authentication, set the username in this setting.</li><li>`:password` - If your mail server requires authentication, set the password in this setting.</li><li>`:authentication` - If your mail server requires authentication, you need to specify the authentication type here. This is a symbol and one of `:plain`, `:login`, `:cram_md5`.</li><li>`:enable_starttls_auto` - Set this to `false` if there is a problem with your server certificate that you cannot resolve.</li></ul>| <ide> |`sendmail_settings`|Allows you to override options for the `:sendmail` delivery method.<ul><li>`:location` - The location of the sendmail executable. Defaults to `/usr/sbin/sendmail`.</li><li>`:arguments` - The command line arguments to be passed to sendmail. Defaults to `-i -t`.</li></ul>| <ide> |`raise_delivery_errors`|Whether or not errors should be raised if the email fails to be delivered. This only works if the external email server is configured for immediate delivery.| <ide> |`delivery_method`|Defines a delivery method. Possible values are `:smtp` (default), `:sendmail`, `:file` and `:test`.| <ide><path>guides/source/active_record_validations.md <ide> line of code you can add the same kind of validation to several attributes. <ide> All of them accept the `:on` and `:message` options, which define when the <ide> validation should be run and what message should be added to the `errors` <ide> collection if it fails, respectively. The `:on` option takes one of the values <del>`:save` (the default), `:create` or `:update`. There is a default error <add>`:save` (the default), `:create` or `:update`. There is a default error <ide> message for each one of the validation helpers. These messages are used when <ide> the `:message` option isn't specified. Let's take a look at each one of the <ide> available helpers. <ide><path>guides/source/api_documentation_guidelines.md <ide> class Array <ide> end <ide> ``` <ide> <del>WARNING: Using a pair of `+...+` for fixed-width font only works with **words**; that is: anything matching `\A\w+\z`. For anything else use `<tt>...</tt>`, notably symbols, setters, inline snippets, etc. <add>WARNING: Using a pair of `+...+` for fixed-width font only works with **words**; that is: anything matching `\A\w+\z`. For anything else use `<tt>...</tt>`, notably symbols, setters, inline snippets, etc. <ide> <ide> ### Regular Font <ide> <ide><path>guides/source/caching_with_rails.md <ide> config.cache_store = :ehcache_store <ide> <ide> When initializing the cache, you may use the `:ehcache_config` option to specify the Ehcache config file to use (where the default is "ehcache.xml" in your Rails config directory), and the :cache_name option to provide a custom name for your cache (the default is rails_cache). <ide> <del>In addition to the standard `:expires_in` option, the `write` method on this cache can also accept the additional `:unless_exist` option, which will cause the cache store to use Ehcache's `putIfAbsent` method instead of `put`, and therefore will not overwrite an existing entry. Additionally, the `write` method supports all of the properties exposed by the [Ehcache Element class](http://ehcache.org/apidocs/net/sf/ehcache/Element.html) , including: <add>In addition to the standard `:expires_in` option, the `write` method on this cache can also accept the additional `:unless_exist` option, which will cause the cache store to use Ehcache's `putIfAbsent` method instead of `put`, and therefore will not overwrite an existing entry. Additionally, the `write` method supports all of the properties exposed by the [Ehcache Element class](http://ehcache.org/apidocs/net/sf/ehcache/Element.html) , including: <ide> <ide> | Property | Argument Type | Description | <ide> | --------------------------- | ------------------- | ----------------------------------------------------------- | <ide><path>guides/source/form_helpers.md <ide> NOTE: In many cases the built-in date pickers are clumsy as they do not aid the <ide> <ide> ### Individual Components <ide> <del>Occasionally you need to display just a single date component such as a year or a month. Rails provides a series of helpers for this, one for each component `select_year`, `select_month`, `select_day`, `select_hour`, `select_minute`, `select_second`. These helpers are fairly straightforward. By default they will generate an input field named after the time component (for example "year" for `select_year`, "month" for `select_month` etc.) although this can be overridden with the `:field_name` option. The `:prefix` option works in the same way that it does for `select_date` and `select_time` and has the same default value. <add>Occasionally you need to display just a single date component such as a year or a month. Rails provides a series of helpers for this, one for each component `select_year`, `select_month`, `select_day`, `select_hour`, `select_minute`, `select_second`. These helpers are fairly straightforward. By default they will generate an input field named after the time component (for example "year" for `select_year`, "month" for `select_month` etc.) although this can be overridden with the `:field_name` option. The `:prefix` option works in the same way that it does for `select_date` and `select_time` and has the same default value. <ide> <ide> The first parameter specifies which value should be selected and can either be an instance of a Date, Time or DateTime, in which case the relevant component will be extracted, or a numerical value. For example <ide> <ide> Many apps grow beyond simple forms editing a single object. For example when cre <ide> <ide> ### Configuring the Model <ide> <del>Active Record provides model level support via the `accepts_nested_attributes_for` method: <add>Active Record provides model level support via the `accepts_nested_attributes_for` method: <ide> <ide> ```ruby <ide> class Person < ActiveRecord::Base <ide><path>guides/source/migrations.md <ide> definitions: <ide> * `create_table` <ide> * `create_join_table` <ide> * `drop_table` (must supply a block) <del>* `drop_join_table` (must supply a block) <add>* `drop_join_table` (must supply a block) <ide> * `remove_timestamps` <ide> * `rename_column` <ide> * `rename_index` <ide><path>guides/source/security.md <ide> Intranet and administration interfaces are popular attack targets, because they <ide> <ide> In 2007 there was the first tailor-made trojan which stole information from an Intranet, namely the "Monster for employers" web site of Monster.com, an online recruitment web application. Tailor-made Trojans are very rare, so far, and the risk is quite low, but it is certainly a possibility and an example of how the security of the client host is important, too. However, the highest threat to Intranet and Admin applications are XSS and CSRF. <ide> <del>**XSS** If your application re-displays malicious user input from the extranet, the application will be vulnerable to XSS. User names, comments, spam reports, order addresses are just a few uncommon examples, where there can be XSS. <add>**XSS** If your application re-displays malicious user input from the extranet, the application will be vulnerable to XSS. User names, comments, spam reports, order addresses are just a few uncommon examples, where there can be XSS. <ide> <ide> Having one single place in the admin interface or Intranet, where the input has not been sanitized, makes the entire application vulnerable. Possible exploits include stealing the privileged administrator's cookie, injecting an iframe to steal the administrator's password or installing malicious software through browser security holes to take over the administrator's computer. <ide> <ide> Refer to the Injection section for countermeasures against XSS. It is _recommended to use the SafeErb plugin_ also in an Intranet or administration interface. <ide> <del>**CSRF** Cross-Site Reference Forgery (CSRF) is a gigantic attack method, it allows the attacker to do everything the administrator or Intranet user may do. As you have already seen above how CSRF works, here are a few examples of what attackers can do in the Intranet or admin interface. <add>**CSRF** Cross-Site Reference Forgery (CSRF) is a gigantic attack method, it allows the attacker to do everything the administrator or Intranet user may do. As you have already seen above how CSRF works, here are a few examples of what attackers can do in the Intranet or admin interface. <ide> <ide> A real-world example is a [router reconfiguration by CSRF](http://www.h-online.com/security/Symantec-reports-first-active-attack-on-a-DSL-router--/news/102352). The attackers sent a malicious e-mail, with CSRF in it, to Mexican users. The e-mail claimed there was an e-card waiting for them, but it also contained an image tag that resulted in a HTTP-GET request to reconfigure the user's router (which is a popular model in Mexico). The request changed the DNS-settings so that requests to a Mexico-based banking site would be mapped to the attacker's site. Everyone who accessed the banking site through that router saw the attacker's fake web site and had his credentials stolen. <ide> <ide><path>guides/source/testing.md <ide> The `assert_select` assertion is quite powerful. For more advanced usage, refer <ide> <ide> There are more assertions that are primarily used in testing views: <ide> <del>| Assertion | Purpose | <del>| ---------------------------------------------------------- | ------- | <del>| `assert_select_email` | Allows you to make assertions on the body of an e-mail. | <del>| `assert_select_encoded` | Allows you to make assertions on encoded HTML. It does this by un-encoding the contents of each element and then calling the block with all the un-encoded elements.| <del>| `css_select(selector)` or `css_select(element, selector)` | Returns an array of all the elements selected by the _selector_. In the second variant it first matches the base _element_ and tries to match the _selector_ expression on any of its children. If there are no matches both variants return an empty array.| <add>| Assertion | Purpose | <add>| --------------------------------------------------------- | ------- | <add>| `assert_select_email` | Allows you to make assertions on the body of an e-mail. | <add>| `assert_select_encoded` | Allows you to make assertions on encoded HTML. It does this by un-encoding the contents of each element and then calling the block with all the un-encoded elements.| <add>| `css_select(selector)` or `css_select(element, selector)` | Returns an array of all the elements selected by the _selector_. In the second variant it first matches the base _element_ and tries to match the _selector_ expression on any of its children. If there are no matches both variants return an empty array.| <ide> <ide> Here's an example of using `assert_select_email`: <ide>
8
Ruby
Ruby
reimplement softwarespec on top of resource
df537528c7730e9a6d791b86ed529547fdf48496
<ide><path>Library/Homebrew/compat/md5.rb <ide> class Formula <ide> def self.md5(val) <del> @stable ||= SoftwareSpec.new <add> @stable ||= create_spec(SoftwareSpec) <ide> @stable.md5(val) <ide> end <ide> end <ide> <ide> class SoftwareSpec <add> def md5(val) <add> @resource.md5(val) <add> end <add>end <add> <add>class Resource <ide> def md5(val) <ide> @checksum = Checksum.new(:md5, val) <ide> end <ide><path>Library/Homebrew/formula.rb <ide> require 'resource' <del>require 'download_strategy' <ide> require 'dependency_collector' <ide> require 'formula_support' <ide> require 'formula_lock' <ide> def initialize name='__UNKNOWN__', path=nil <ide> <ide> @active_spec = determine_active_spec <ide> validate_attributes :url, :name, :version <del> @downloader = active_spec.download_strategy.new(name, active_spec) <add> @downloader = active_spec.downloader <ide> <ide> # Combine DSL `option` and `def options` <ide> options.each do |opt, desc| <ide> def initialize name='__UNKNOWN__', path=nil <ide> @pin = FormulaPin.new(self) <ide> <ide> @resources = self.class.resources <del> @resources.each_value do |r| <del> r.set_owner name <del> end <add> @resources.each_value { |r| r.owner = self } <ide> end <ide> <ide> def set_spec(name) <ide> spec = self.class.send(name) <ide> return if spec.nil? <ide> if block_given? && yield(spec) || !spec.url.nil? <add> spec.owner = self <ide> instance_variable_set("@#{name}", spec) <ide> end <ide> end <ide> def to_hash <ide> <ide> # For brew-fetch and others. <ide> def fetch <del> # Ensure the cache exists <del> HOMEBREW_CACHE.mkpath <del> downloader.fetch <del> cached_download <add> active_spec.fetch <ide> end <ide> <ide> # For FormulaInstaller. <ide> def system cmd, *args <ide> private <ide> <ide> def stage <del> fetched = fetch <del> verify_download_integrity(fetched) if fetched.respond_to?(:file?) and fetched.file? <del> mktemp do <del> downloader.stage <del> # Set path after the downloader changes the working folder. <add> active_spec.stage do <ide> @buildpath = Pathname.pwd <ide> yield <ide> @buildpath = nil <ide><path>Library/Homebrew/resource.rb <ide> require 'checksum' <ide> require 'version' <ide> <del># A Resource describes a tarball that a formula needs in addition <del># to the formula's own download. <add># Resource is the fundamental representation of an external resource. The <add># primary formula download, along with other declared resources, are instances <add># of this class. <ide> class Resource <ide> include FileUtils <ide> <del> # The mktmp mixin expects a name property <del> # This is the resource name <ide> attr_reader :name <del> <ide> attr_reader :checksum, :mirrors, :specs, :using <ide> <del> def initialize name <add> # Formula name must be set after the DSL, as we have no access to the <add> # formula name before initialization of the formula <add> attr_accessor :owner <add> <add> # XXX: for bottles, address this later <add> attr_writer :url, :checksum <add> <add> def initialize name, url=nil, version=nil <ide> @name = name <del> @url = nil <del> @version = nil <add> @url = url <add> @version = version <ide> @mirrors = [] <ide> @specs = {} <ide> @checksum = nil <ide> @using = nil <ide> end <ide> <del> # Formula name must be set after the DSL, as we have no access to the <del> # formula name before initialization of the formula <del> def set_owner owner <del> @owner = owner <del> @downloader = download_strategy.new("#{owner}--#{name}", self) <add> def downloader <add> download_name = name == :default ? owner.name : "#{owner.name}--#{name}" <add> @downloader ||= download_strategy.new(download_name, self) <ide> end <ide> <ide> # Download the resource <ide> def stage(target=nil) <ide> fetched = fetch <ide> verify_download_integrity(fetched) if fetched.respond_to?(:file?) and fetched.file? <ide> mktemp do <del> @downloader.stage <add> downloader.stage <ide> if block_given? <ide> yield self <ide> else <ide> def download_strategy <ide> end <ide> <ide> def cached_download <del> @downloader.cached_location <add> downloader.cached_location <ide> end <ide> <ide> # For brew-fetch and others. <ide> def fetch <ide> # Ensure the cache exists <ide> HOMEBREW_CACHE.mkpath <del> @downloader.fetch <add> downloader.fetch <ide> cached_download <ide> end <ide> <ide> def verify_download_integrity fn <ide> fn.verify_checksum(checksum) <ide> rescue ChecksumMissingError <del> opoo "Cannot verify package integrity" <del> puts "The formula did not provide a download checksum" <add> opoo "Cannot verify download integrity" <add> puts "A checksum was not provided for this resource" <ide> puts "For your reference the SHA1 is: #{fn.sha1}" <ide> rescue ChecksumMismatchError => e <ide> e.advice = <<-EOS.undent <ide><path>Library/Homebrew/software_spec.rb <del>require 'download_strategy' <add>require 'forwardable' <add>require 'resource' <ide> require 'checksum' <ide> require 'version' <ide> <ide> class SoftwareSpec <del> attr_reader :checksum, :mirrors, :specs, :using <add> extend Forwardable <ide> <del> def initialize url=nil, version=nil <del> @url = url <del> @version = version <del> @mirrors = [] <del> @specs = {} <del> @checksum = nil <del> @using = nil <del> end <del> <del> def download_strategy <del> @download_strategy ||= DownloadStrategyDetector.detect(url, using) <del> end <del> <del> def verify_download_integrity fn <del> fn.verify_checksum(checksum) <del> rescue ChecksumMissingError <del> opoo "Cannot verify package integrity" <del> puts "The formula did not provide a download checksum" <del> puts "For your reference the SHA1 is: #{fn.sha1}" <del> rescue ChecksumMismatchError => e <del> e.advice = <<-EOS.undent <del> Archive: #{fn} <del> (To retry an incomplete download, remove the file above.) <del> EOS <del> raise e <del> end <del> <del> def detect_version(val) <del> case val <del> when nil then Version.detect(url, specs) <del> when String then Version.new(val) <del> when Hash then Version.new_with_scheme(*val.shift) <del> else <del> raise TypeError, "version '#{val.inspect}' should be a string" <del> end <del> end <del> <del> # The methods that follow are used in the block-form DSL spec methods <del> Checksum::TYPES.each do |cksum| <del> class_eval <<-EOS, __FILE__, __LINE__ + 1 <del> def #{cksum}(val) <del> @checksum = Checksum.new(:#{cksum}, val) <del> end <del> EOS <del> end <add> def_delegators :@resource, :owner= <add> def_delegators :@resource, :stage, :fetch <add> def_delegators :@resource, :download_strategy, :verify_download_integrity <add> def_delegators :@resource, :checksum, :mirrors, :specs, :using, :downloader <add> def_delegators :@resource, :url, :version, :mirror, *Checksum::TYPES <ide> <del> def url val=nil, specs={} <del> return @url if val.nil? <del> @url = val <del> @using = specs.delete(:using) <del> @specs.merge!(specs) <del> end <del> <del> def version val=nil <del> @version ||= detect_version(val) <del> end <del> <del> def mirror val <del> mirrors << val <add> def initialize url=nil, version=nil <add> @resource = Resource.new(:default, url, version) <ide> end <ide> end <ide> <ide> def verify_download_integrity fn <ide> end <ide> <ide> class Bottle < SoftwareSpec <del> attr_writer :url <ide> attr_rw :root_url, :prefix, :cellar, :revision <ide> <add> def_delegators :@resource, :url= <add> <ide> def initialize <ide> super <ide> @revision = 0 <ide> def #{cksum}(val=nil) <ide> end <ide> <ide> if @#{cksum}.has_key? bottle_tag <del> @checksum = @#{cksum}[bottle_tag] <add> @resource.checksum = @#{cksum}[bottle_tag] <ide> end <ide> end <ide> EOS
4
PHP
PHP
add property to route service provider
9cbc3819f7b1c268447996d347a1733aa68e16d7
<ide><path>app/Providers/RouteServiceProvider.php <ide> class RouteServiceProvider extends ServiceProvider <ide> */ <ide> public const HOME = '/home'; <ide> <add> /** <add> * If specified, this namespace is automatically applied to your controller routes. <add> * <add> * In addition, it is set as the URL generator's root namespace. <add> * <add> * @var string <add> */ <add> protected $namespace = null; <add> <ide> /** <ide> * Define your route model bindings, pattern filters, etc. <ide> *
1
Python
Python
fix tolerance for a bloom slow test
d453ea61205882eb4210f8c4d2fb001e2c96872b
<ide><path>tests/models/bloom/test_modeling_bloom.py <ide> def test_hidden_states_transformers(self): <ide> } <ide> <ide> if cuda_available: <del> self.assertEqual(MEAN_VALUE_LAST_LM, logits.last_hidden_state.mean().item()) <add> self.assertAlmostEqual(MEAN_VALUE_LAST_LM, logits.last_hidden_state.mean().item(), places=4) <ide> else: <ide> self.assertAlmostEqual(MEAN_VALUE_LAST_LM, logits.last_hidden_state.mean().item(), places=3) <ide>
1
Python
Python
remove unused import from test_basic
5909e26fba86351063bd622cedf6a4c25eba2e79
<ide><path>tests/test_basic.py <ide> :license: BSD, see LICENSE for more details. <ide> """ <ide> <del>import pickle <ide> import re <ide> import time <ide> import uuid
1
Javascript
Javascript
increase coverage for histogram
434b369ef60c4599a4bac374a15add608dd09ae7
<ide><path>test/parallel/test-perf-hooks-histogram.js <ide> const { <ide> createHistogram, <ide> monitorEventLoopDelay, <ide> } = require('perf_hooks'); <add>const { inspect } = require('util'); <ide> <ide> { <ide> const h = createHistogram(); <ide> const { <ide> }); <ide> setTimeout(() => mc.port2.postMessage(e), 100); <ide> } <add> <add>{ <add> const h = createHistogram(); <add> assert(inspect(h, { depth: null }).startsWith('Histogram')); <add> assert.strictEqual(inspect(h, { depth: -1 }), '[RecordableHistogram]'); <add>} <add> <add>{ <add> // Tests that RecordableHistogram is impossible to construct manually <add> const h = createHistogram(); <add> assert.throws( <add> () => new h.constructor(), <add> /^TypeError: illegal constructor$/ <add> ); <add>}
1
Ruby
Ruby
prevent race condition when resetting time stubs
6122d2bfdf09fb4a3e70d619556ef471be274169
<ide><path>activesupport/lib/active_support/testing/time_helpers.rb <ide> # frozen_string_literal: true <ide> <add>require "active_support/core_ext/module/redefine_method" <ide> require "active_support/core_ext/string/strip" # for strip_heredoc <ide> require "active_support/core_ext/time/calculations" <ide> require "concurrent/map" <ide> def stubbing(object, method_name) <ide> <ide> def unstub_object(stub) <ide> singleton_class = stub.object.singleton_class <del> singleton_class.send :undef_method, stub.method_name <add> singleton_class.send :silence_redefinition_of_method, stub.method_name <ide> singleton_class.send :alias_method, stub.method_name, stub.original_method <ide> singleton_class.send :undef_method, stub.original_method <ide> end
1
PHP
PHP
fix doc block
98271e29dc7ef6ea808c2b5786204b93b20aa7bd
<ide><path>src/Illuminate/Foundation/Auth/ResetsPasswords.php <ide> protected function resetPassword($user, $password) <ide> } <ide> <ide> /** <del> * Get the post register / login redirect path. <add> * Get the post password reset redirect path. <ide> * <ide> * @return string <ide> */
1
Java
Java
introduce tests for gh-28083
af14eea1ef76576acd07ba90cd0a656bd6b31969
<ide><path>spring-context/src/test/java/org/springframework/context/annotation/Spr3775InitDestroyLifecycleTests.java <ide> public void testJsr250AnnotationsWithShadowedMethods() { <ide> bean.destroyMethods); <ide> } <ide> <add> @Test <add> public void testJsr250AnnotationsWithCustomPrivateInitDestroyMethods() { <add> Class<?> beanClass = CustomAnnotatedPrivateInitDestroyBean.class; <add> DefaultListableBeanFactory beanFactory = createBeanFactoryAndRegisterBean(beanClass, "customInit1", "customDestroy1"); <add> CustomAnnotatedPrivateInitDestroyBean bean = <add> (CustomAnnotatedPrivateInitDestroyBean) beanFactory.getBean(LIFECYCLE_TEST_BEAN); <add> assertMethodOrdering("init-methods", Arrays.asList("privateCustomInit1","afterPropertiesSet"), bean.initMethods); <add> beanFactory.destroySingletons(); <add> assertMethodOrdering("destroy-methods", Arrays.asList("privateCustomDestroy1","destroy"), bean.destroyMethods); <add> } <add> <add> @Test <add> public void testJsr250AnnotationsWithCustomSameMethodNames() { <add> Class<?> beanClass = CustomAnnotatedPrivateSameNameInitDestroyBean.class; <add> DefaultListableBeanFactory beanFactory = createBeanFactoryAndRegisterBean(beanClass, "customInit1", "customDestroy1"); <add> CustomAnnotatedPrivateSameNameInitDestroyBean bean = <add> (CustomAnnotatedPrivateSameNameInitDestroyBean) beanFactory.getBean(LIFECYCLE_TEST_BEAN); <add> assertMethodOrdering("init-methods", <add> Arrays.asList("privateCustomInit1","afterPropertiesSet","sameNameCustomInit1"), bean.initMethods); <add> beanFactory.destroySingletons(); <add> assertMethodOrdering("destroy-methods", <add> Arrays.asList("privateCustomDestroy1","destroy","sameNameCustomDestroy1"), bean.destroyMethods); <add> } <add> <ide> @Test <ide> public void testAllLifecycleMechanismsAtOnce() { <ide> final Class<?> beanClass = AllInOneBean.class; <ide> public void customDestroy() throws Exception { <ide> } <ide> } <ide> <add> public static class CustomAnnotatedPrivateInitDestroyBean extends CustomInitializingDisposableBean{ <add> <add> @PostConstruct <add> private void customInit1() throws Exception { <add> this.initMethods.add("privateCustomInit1"); <add> } <add> <add> @PreDestroy <add> private void customDestroy1() throws Exception { <add> this.destroyMethods.add("privateCustomDestroy1"); <add> } <add> <add> } <add> <add> public static class CustomAnnotatedPrivateSameNameInitDestroyBean extends CustomAnnotatedPrivateInitDestroyBean { <add> <add> private void customInit1() throws Exception { <add> this.initMethods.add("sameNameCustomInit1"); <add> } <add> <add> private void customDestroy1() throws Exception { <add> this.destroyMethods.add("sameNameCustomDestroy1"); <add> } <add> <add> } <ide> <ide> public static class CustomInitializingDisposableBean extends CustomInitDestroyBean <ide> implements InitializingBean, DisposableBean {
1
Python
Python
improve log messages
9c3a6b41290928f8097faace54fb9acfd0b9f77a
<ide><path>airflow/www/app.py <ide> def log(self): <ide> log += "*** Fetching here: {url}\n".format(**locals()) <ide> try: <ide> import requests <del> log += requests.get(url).text <add> log += '\n' + requests.get(url).text <ide> log_loaded = True <ide> except: <ide> log += "*** Failed to fetch log file from worker.\n".format( <ide> def log(self): <ide> # try to load log backup from S3 <ide> s3_log_folder = conf.get('core', 'S3_LOG_FOLDER') <ide> if not log_loaded and s3_log_folder.startswith('s3:'): <del> log += '*** Fetching log from S3.\n' <del> log += ('*** Note: S3 logs are only available once ' <del> 'tasks have completed.\n') <ide> import boto <ide> s3 = boto.connect_s3() <ide> s3_log_loc = os.path.join( <ide> conf.get('core', 'S3_LOG_FOLDER'), log_relative) <add> log += '*** Fetching log from S3: {}\n'.format(s3_log_loc) <add> log += ('*** Note: S3 logs are only available once ' <add> 'tasks have completed.\n') <ide> bucket, key = s3_log_loc.lstrip('s3:/').split('/', 1) <ide> s3_key = boto.s3.key.Key(s3.get_bucket(bucket), key) <ide> if s3_key.exists():
1
Text
Text
release notes for the 0.9.14 key-maker iteration
f1096043157a4e80c78b2bfa692c9f5680e82e7c
<ide><path>CHANGELOG.md <ide> <a name="0.9.14"><a/> <del># <angular/> 0.9.14 key-maker (in-progress) # <add># <angular/> 0.9.14 key-maker (2011-04-01) # <add> <add>### Performance <add>- [ng:repeat] grows (adds children) significantly faster. (commit 15ec78f5) <add>- [$xhr.cache] optionally executes callbacks synchronously. (commit c06c5a36) <add>- [ng:view] and [ng:include] use sync [$xhr.cache] <add> <add> <add>### Bug Fixes <add>- Fixed [$resource] encoding of query params. (commits e1d122a4, 78a0f410) <ide> <ide> <add>### House cleaning <add>- code cleanup <add>- better minification (min is now 2.5% or almost 1kb smaller) <add>- minor documentation fixes <add>- JsTestDriver 1.3.2 upgrade with fixed coverage support <ide> <ide> <ide> <ide> with the `$route` service <ide> [compile]: http://docs.angularjs.org/#!angular.compile <ide> [element]: http://docs.angularjs.org/#!angular.element <ide> [widget]: http://docs.angularjs.org/#!angular.widget <add>[ng:repeat]: http://docs.angularjs.org/#!angular.widget.@ng:repeat <add>[ng:view]: http://docs.angularjs.org/#!angular.widget.ng:view <add>[ng:include]: http://docs.angularjs.org/#!angular.widget.ng:include <ide> [$defer]: http://docs.angularjs.org/#!angular.service.$defer <ide> [$cookies]: http://docs.angularjs.org/#!angular.service.$cookies <ide> [$xhr]: http://docs.angularjs.org/#!angular.service.$xhr <add>[$xhr.cache]: http://docs.angularjs.org/#!angular.service.$xhr.cache <ide> [$resource]: http://docs.angularjs.org/#!angular.service.$resource <ide> [directive]: http://docs.angularjs.org/#!angular.directive <ide> [ng:autobind]: http://docs.angularjs.org/#!angular.directive.ng:autobind
1
Text
Text
update changelog for 2.14.0
7cb51f65c2234d2692cca5383689648503cfa575
<ide><path>CHANGELOG.md <ide> Changelog <ide> ========= <ide> <add>### 2.14.0 [See full changelog](https://gist.github.com/ichernev/812e79ac36a7829a22598fe964bfc18a) <add> <add>## New Features <add>* [#3233](http://github.com/moment/moment/pull/3233) Introduce month.isFormat for format/standalone discovery <add>* [#2848](http://github.com/moment/moment/pull/2848) Allow user to get/set the rounding method used when calculating relative time <add>* [#3112](http://github.com/moment/moment/pull/3112) optimize configFromStringAndFormat <add>* [#3147](http://github.com/moment/moment/pull/3147) Call calendar format function with moment context <add>* [#3160](http://github.com/moment/moment/pull/3160) deprecate isDSTShifted <add>* [#3175](http://github.com/moment/moment/pull/3175) make moment calendar extensible with ad-hoc options <add>* [#3191](http://github.com/moment/moment/pull/3191) toDate returns a copy of the internal date object <add>* [#3192](http://github.com/moment/moment/pull/3192) Adding support for rollup import. <add>* [#3238](http://github.com/moment/moment/pull/3238) Handle empty object and empty array for creation as now <add>* [#3082](http://github.com/moment/moment/pull/3082) Use relative AMD moment dependency <add> <add>## Bugfixes <add>* [#3241](http://github.com/moment/moment/pull/3241) Escape all 24 mixed pieces, not only first 12 in computeMonthsParse <add>* [#3008](http://github.com/moment/moment/pull/3008) Object setter orders sets based on size of unit <add>* [#3177](http://github.com/moment/moment/pull/3177) Bug Fix [#2704](http://github.com/moment/moment/pull/2704) - isoWeekday(String) inconsistent with isoWeekday(Number) <add>* [#3230](http://github.com/moment/moment/pull/3230) fix passing date with format string to ignore format string <add>* [#3232](http://github.com/moment/moment/pull/3232) Fix negative 0 in certain diff cases <add>* [#3235](http://github.com/moment/moment/pull/3235) Use proper locale inheritance for the base locale, fixes [#3137](http://github.com/moment/moment/pull/3137) <add> <add>Plus es-do locale and locale bugfixes <add> <ide> ### 2.13.0 [See full changelog](https://gist.github.com/ichernev/0132fcf5b61f7fc140b0bb0090480d49) <ide> <ide> ## Enhancements:
1
Javascript
Javascript
add patreon client key validation
7f769cdaf8cba40198fdc9d5c3d3c774854b1316
<ide><path>tools/scripts/build/ensure-env.js <ide> if (FREECODECAMP_NODE_ENV !== 'development') { <ide> 'showUpcomingChanges' <ide> ]; <ide> const searchKeys = ['algoliaAppId', 'algoliaAPIKey']; <del> const donationKeys = ['stripePublicKey', 'paypalClientId']; <add> const donationKeys = ['stripePublicKey', 'paypalClientId', 'patreonClientId']; <ide> <ide> const expectedVariables = locationKeys.concat( <ide> deploymentKeys,
1
PHP
PHP
move plugin to the root of the new app directory
735b6c2b808e885dc897c020934a9becb3230e6b
<ide><path>lib/Cake/Test/TestCase/Core/AppTest.php <ide> public function testListObjects() { <ide> <ide> $result = App::objects('NonExistingType'); <ide> $this->assertSame(array(), $result); <add> } <ide> <add> function testMe() { <ide> App::build(array( <ide> 'Plugin' => array( <ide> CAKE . 'Test/TestApp/Plugin/'
1
Ruby
Ruby
pass explicit sort to handle apfs
ccecdab4cd069a82820e239c1821076396314826
<ide><path>Library/Homebrew/cmd/list.rb <ide> def filtered_list <ide> puts d.basename.to_s.concat(ARGV.include?("--versions") ? " #{version}" : "") <ide> end <ide> else # --versions without --pinned <del> names.each do |d| <add> names.sort.each do |d| <ide> versions = d.subdirs.map { |pn| pn.basename.to_s } <ide> next if ARGV.include?("--multiple") && versions.length < 2 <ide> puts "#{d.basename} #{versions * " "}"
1
Javascript
Javascript
fix typo in internal/modules/esm/module_job.js
b079960b18444adf0c45318473b80c833fe5a40b
<ide><path>lib/internal/modules/esm/module_job.js <ide> class ModuleJob { <ide> const importStatement = splitStack[1]; <ide> // TODO(@ctavan): The original error stack only provides the single <ide> // line which causes the error. For multi-line import statements we <del> // cannot generate an equivalent object descructuring assignment by <add> // cannot generate an equivalent object destructuring assignment by <ide> // just parsing the error stack. <ide> const oneLineNamedImports = StringPrototypeMatch(importStatement, /{.*}/); <ide> const destructuringAssignment = oneLineNamedImports &&
1
PHP
PHP
return the array from array_set
e929c3bef598e242997c61f8e893a2a7f8ecb286
<ide><path>src/Illuminate/Support/helpers.php <ide> function array_pull(&$array, $key) <ide> * @param array $array <ide> * @param string $key <ide> * @param mixed $value <del> * @return void <add> * @return array <ide> */ <ide> function array_set(&$array, $key, $value) <ide> { <ide> function array_set(&$array, $key, $value) <ide> } <ide> <ide> $array[array_shift($keys)] = $value; <add> <add> return $array; <ide> } <ide> } <ide>
1
Python
Python
remove unused import
0bb4e0fad5b4bb3743c8a7d03c260b62a35e7045
<ide><path>keras/applications/inception_v3.py <ide> from ..layers import GlobalAveragePooling2D <ide> from ..layers import GlobalMaxPooling2D <ide> from ..engine.topology import get_source_inputs <del>from ..utils.layer_utils import convert_all_kernels_in_model <ide> from ..utils.data_utils import get_file <ide> from .. import backend as K <ide> from .imagenet_utils import decode_predictions
1
Text
Text
add missing quotation marks
aa7c58f7e58cc2391d47af92624449595fb0ae08
<ide><path>curriculum/challenges/english/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/everything-be-true.md <ide> assert.strictEqual(truthCheck( <ide> "users"), true); <ide> ``` <ide> <del>`truthCheck([{id: 1, data: {url: "https://freecodecamp.org", name: "freeCodeCamp}}, {id: 2, data: {url: "https://coderadio.freecodecamp.org/", name: "CodeRadio"}}, {id: null, data: {}}], "data")` should return `true`. <add>`truthCheck([{id: 1, data: {url: "https://freecodecamp.org", name: "freeCodeCamp"}}, {id: 2, data: {url: "https://coderadio.freecodecamp.org/", name: "CodeRadio"}}, {id: null, data: {}}], "data")` should return `true`. <ide> <ide> ```js <ide> assert.strictEqual(truthCheck( <ide> assert.strictEqual(truthCheck( <ide> "data"), true); <ide> ``` <ide> <del>`truthCheck([{id: 1, data: {url: "https://freecodecamp.org", name: "freeCodeCamp}}, {id: 2, data: {url: "https://coderadio.freecodecamp.org/", name: "CodeRadio"}}, {id: null, data: {}}], "id")` should return `false`. <add>`truthCheck([{id: 1, data: {url: "https://freecodecamp.org", name: "freeCodeCamp"}}, {id: 2, data: {url: "https://coderadio.freecodecamp.org/", name: "CodeRadio"}}, {id: null, data: {}}], "id")` should return `false`. <ide> <ide> ```js <ide> assert.strictEqual(truthCheck(
1
Javascript
Javascript
remove misc console.logs
f3b1b5ca0de01653d51ecad5dbf4f3578e7ad1df
<ide><path>public/js/main_0.0.2.js <ide> profileValidation.directive('uniqueEmail', ['$http', function($http) { <ide> .success(function (exists) { <ide> if (email === scope.storedEmail) { <ide> ngModel.$setValidity('unique', true); <del> console.log('scoped.storedEmail', scoped.storedEmail); <ide> } else if (exists.exists) { <del> console.log('setValid to false'); <ide> ngModel.$setValidity('unique', false); <ide> } <ide> });
1
Text
Text
clarify behavior of napi_get_typedarray_info
2681cba62e5e08338036c968c93ae467dda3e800
<ide><path>doc/api/n-api.md <ide> napi_status napi_get_arraybuffer_info(napi_env env, <ide> <ide> * `[in] env`: The environment that the API is invoked under. <ide> * `[in] arraybuffer`: `napi_value` representing the `ArrayBuffer` being queried. <del>* `[out] data`: The underlying data buffer of the `ArrayBuffer`. <add>* `[out] data`: The underlying data buffer of the `ArrayBuffer`. If byte_length <add> is `0`, this may be `NULL` or any other pointer value. <ide> * `[out] byte_length`: Length in bytes of the underlying data buffer. <ide> <ide> Returns `napi_ok` if the API succeeded. <ide> napi_status napi_get_buffer_info(napi_env env, <ide> * `[in] env`: The environment that the API is invoked under. <ide> * `[in] value`: `napi_value` representing the `node::Buffer` being queried. <ide> * `[out] data`: The underlying data buffer of the `node::Buffer`. <add> If length is `0`, this may be `NULL` or any other pointer value. <ide> * `[out] length`: Length in bytes of the underlying data buffer. <ide> <ide> Returns `napi_ok` if the API succeeded. <ide> napi_status napi_get_typedarray_info(napi_env env, <ide> * `[out] length`: The number of elements in the `TypedArray`. <ide> * `[out] data`: The data buffer underlying the `TypedArray` adjusted by <ide> the `byte_offset` value so that it points to the first element in the <del> `TypedArray`. <add> `TypedArray`. If the length of the array is `0`, this may be `NULL` or <add> any other pointer value. <ide> * `[out] arraybuffer`: The `ArrayBuffer` underlying the `TypedArray`. <ide> * `[out] byte_offset`: The byte offset within the underlying native array <ide> at which the first element of the arrays is located. The value for the data <ide> napi_status napi_get_dataview_info(napi_env env, <ide> properties to query. <ide> * `[out] byte_length`: `Number` of bytes in the `DataView`. <ide> * `[out] data`: The data buffer underlying the `DataView`. <add> If byte_length is `0`, this may be `NULL` or any other pointer value. <ide> * `[out] arraybuffer`: `ArrayBuffer` underlying the `DataView`. <ide> * `[out] byte_offset`: The byte offset within the data buffer from which <ide> to start projecting the `DataView`.
1
Java
Java
update copyright year of changed file
31b8587ce61b2a37268eeaf2c83bd57b65ccd141
<ide><path>spring-aop/src/main/java/org/springframework/aop/framework/adapter/ThrowsAdviceAdapter.java <ide> /* <del> * Copyright 2002-2012 the original author or authors. <add> * Copyright 2002-2021 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License.
1
Text
Text
add missing changelog links
174b191f70b5587c8e9005bca063a193a36a1352
<ide><path>CHANGELOG.md <ide> release. <ide> </tr> <ide> <tr> <ide> <td valign="top"> <del><b><a href="doc/changelogs/CHANGELOG_V16.md#16.2.0">16.2.0</a></b><br/> <add><b><a href="doc/changelogs/CHANGELOG_V16.md#16.3.0">16.3.0</a></b><br/> <add><a href="doc/changelogs/CHANGELOG_V16.md#16.2.0">16.2.0</a><br/> <ide> <a href="doc/changelogs/CHANGELOG_V16.md#16.1.0">16.1.0</a><br/> <ide> <a href="doc/changelogs/CHANGELOG_V16.md#16.0.0">16.0.0</a><br/> <ide> </td> <ide> <td valign="top"> <del><b><a href="doc/changelogs/CHANGELOG_V14.md#14.16.1">14.16.1</a></b><br/> <add><b><a href="doc/changelogs/CHANGELOG_V14.md#14.17.0">14.17.0</a></b><br/> <add><a href="doc/changelogs/CHANGELOG_V14.md#14.16.1">14.16.1</a><br/> <ide> <a href="doc/changelogs/CHANGELOG_V14.md#14.16.0">14.16.0</a><br/> <ide> <a href="doc/changelogs/CHANGELOG_V14.md#14.15.5">14.15.5</a><br/> <ide> <a href="doc/changelogs/CHANGELOG_V14.md#14.15.4">14.15.4</a><br/>
1
Text
Text
fix typos in active support docs
a94d843d121f74133624bc9d740c997b8f5566ec
<ide><path>guides/source/active_support_core_extensions.md <ide> NOTE: Defined in `active_support/core_ext/array/wrap.rb`. <ide> ### Duplicating <ide> <ide> The method `Array#deep_dup` duplicates itself and all objects inside <del>recursively with Active Support method `Object#deep_dup`. It works like `Array#map` with sending `deep_dup` method to each object inside. <add>recursively with the Active Support method `Object#deep_dup`. It works like `Array#map`, sending `deep_dup` method to each object inside. <ide> <ide> ```ruby <ide> array = [1, [2, 3]] <ide> or yields them in turn if a block is passed: <ide> <% end %> <ide> ``` <ide> <del>The first example shows `in_groups_of` fills the last group with as many `nil` elements as needed to have the requested size. You can change this padding value using the second optional argument: <add>The first example shows how `in_groups_of` fills the last group with as many `nil` elements as needed to have the requested size. You can change this padding value using the second optional argument: <ide> <ide> ```ruby <ide> [1, 2, 3].in_groups_of(2, 0) # => [[1, 2], [3, 0]] <ide> ``` <ide> <del>And you can tell the method not to fill the last group passing `false`: <add>And you can tell the method not to fill the last group by passing `false`: <ide> <ide> ```ruby <ide> [1, 2, 3].in_groups_of(2, false) # => [[1, 2], [3]] <ide> ``` <ide> <del>As a consequence `false` can't be a used as a padding value. <add>As a consequence `false` can't be used as a padding value. <ide> <ide> NOTE: Defined in `active_support/core_ext/array/grouping.rb`. <ide> <ide> You can change this padding value using the second optional argument: <ide> # => [["1", "2", "3"], ["4", "5", "0"], ["6", "7", "0"]] <ide> ``` <ide> <del>And you can tell the method not to fill the smaller groups passing `false`: <add>And you can tell the method not to fill the smaller groups by passing `false`: <ide> <ide> ```ruby <ide> %w(1 2 3 4 5 6 7).in_groups(3, false) <ide> # => [["1", "2", "3"], ["4", "5"], ["6", "7"]] <ide> ``` <ide> <del>As a consequence `false` can't be a used as a padding value. <add>As a consequence `false` can't be used as a padding value. <ide> <ide> NOTE: Defined in `active_support/core_ext/array/grouping.rb`. <ide> <ide> If the receiver responds to `convert_key`, the method is called on each of the a <ide> {a: 1}.with_indifferent_access.except("a") # => {} <ide> ``` <ide> <del>There's also the bang variant `except!` that removes keys in the very receiver. <add>There's also the bang variant `except!` that removes keys in place. <ide> <ide> NOTE: Defined in `active_support/core_ext/hash/except.rb`. <ide> <ide> end <ide> <ide> The second line can safely access the "type" key, and let the user to pass either `:type` or "type". <ide> <del>There's also the bang variant `stringify_keys!` that stringifies keys in the very receiver. <add>There's also the bang variant `stringify_keys!` that stringifies keys in place. <ide> <del>Besides that, one can use `deep_stringify_keys` and `deep_stringify_keys!` to stringify all the keys in the given hash and all the hashes nested into it. An example of the result is: <add>Besides that, one can use `deep_stringify_keys` and `deep_stringify_keys!` to stringify all the keys in the given hash and all the hashes nested in it. An example of the result is: <ide> <ide> ```ruby <ide> {nil => nil, 1 => 1, nested: {a: 3, 5 => 5}}.deep_stringify_keys <ide> end <ide> <ide> The third line can safely access the `:input` key, and let the user to pass either `:input` or "input". <ide> <del>There's also the bang variant `symbolize_keys!` that symbolizes keys in the very receiver. <add>There's also the bang variant `symbolize_keys!` that symbolizes keys in place. <ide> <del>Besides that, one can use `deep_symbolize_keys` and `deep_symbolize_keys!` to symbolize all the keys in the given hash and all the hashes nested into it. An example of the result is: <add>Besides that, one can use `deep_symbolize_keys` and `deep_symbolize_keys!` to symbolize all the keys in the given hash and all the hashes nested in it. An example of the result is: <ide> <ide> ```ruby <ide> {nil => nil, 1 => 1, "nested" => {"a" => 3, 5 => 5}}.deep_symbolize_keys <ide> rest = hash.extract!(:a) # => {:a=>1} <ide> hash # => {:b=>2} <ide> ``` <ide> <del>The method `extract!` returns the same subclass of Hash, that the receiver is. <add>The method `extract!` returns the same subclass of Hash that the receiver is. <ide> <ide> ```ruby <ide> hash = {a: 1, b: 2}.with_indifferent_access
1
PHP
PHP
add missed typehint
31614341e2ce9ca22ec1fcd44ca3a08751aaf916
<ide><path>src/Form/Form.php <ide> protected function _execute(array $data): bool <ide> * all fields. <ide> * @return mixed <ide> */ <del> public function getData($field = null) <add> public function getData(?string $field = null) <ide> { <ide> if ($field === null) { <ide> return $this->_data;
1
Python
Python
simplify apiclient implementation
ab799ccc3ee473de61ec35c6f745c6952752c522
<ide><path>rest_framework/authentication.py <ide> def authenticate(self, request): <ide> """ <ide> <ide> # Get the underlying HttpRequest object <del> http_request = request._request <del> user = getattr(http_request, 'user', None) <add> request = request._request <add> user = getattr(request, 'user', None) <ide> <ide> # Unauthenticated, CSRF validation not required <ide> if not user or not user.is_active: <ide> return None <ide> <del> self.enforce_csrf(http_request) <add> self.enforce_csrf(request) <ide> <ide> # CSRF passed with authenticated user <ide> return (user, None) <ide><path>rest_framework/test.py <ide> def __init__(self, *args, **kwargs): <ide> self._force_auth_token = None <ide> super(ForceAuthClientHandler, self).__init__(*args, **kwargs) <ide> <del> def force_authenticate(self, user=None, token=None): <del> self._force_auth_user = user <del> self._force_auth_token = token <del> <ide> def get_response(self, request): <ide> # This is the simplest place we can hook into to patch the <ide> # request object. <ide> def __init__(self, enforce_csrf_checks=False, **defaults): <ide> self._credentials = {} <ide> <ide> def credentials(self, **kwargs): <add> """ <add> Sets headers that will be used on every outgoing request. <add> """ <ide> self._credentials = kwargs <ide> <ide> def authenticate(self, user=None, token=None): <del> self.handler.force_authenticate(user, token) <del> <del> def get(self, path, data={}, follow=False, **extra): <del> extra.update(self._credentials) <del> response = super(APIClient, self).get(path, data=data, **extra) <del> if follow: <del> response = self._handle_redirects(response, **extra) <del> return response <del> <del> def head(self, path, data={}, follow=False, **extra): <del> extra.update(self._credentials) <del> response = super(APIClient, self).head(path, data=data, **extra) <del> if follow: <del> response = self._handle_redirects(response, **extra) <del> return response <del> <del> def post(self, path, data=None, format=None, content_type=None, follow=False, **extra): <del> extra.update(self._credentials) <del> response = super(APIClient, self).post(path, data=data, format=format, content_type=content_type, **extra) <del> if follow: <del> response = self._handle_redirects(response, **extra) <del> return response <del> <del> def put(self, path, data=None, format=None, content_type=None, follow=False, **extra): <del> extra.update(self._credentials) <del> response = super(APIClient, self).post(path, data=data, format=format, content_type=content_type, **extra) <del> if follow: <del> response = self._handle_redirects(response, **extra) <del> return response <del> <del> def patch(self, path, data=None, format=None, content_type=None, follow=False, **extra): <del> extra.update(self._credentials) <del> response = super(APIClient, self).post(path, data=data, format=format, content_type=content_type, **extra) <del> if follow: <del> response = self._handle_redirects(response, **extra) <del> return response <del> <del> def delete(self, path, data=None, format=None, content_type=None, follow=False, **extra): <del> extra.update(self._credentials) <del> response = super(APIClient, self).post(path, data=data, format=format, content_type=content_type, **extra) <del> if follow: <del> response = self._handle_redirects(response, **extra) <del> return response <del> <del> def options(self, path, data=None, format=None, content_type=None, follow=False, **extra): <del> extra.update(self._credentials) <del> response = super(APIClient, self).post(path, data=data, format=format, content_type=content_type, **extra) <del> if follow: <del> response = self._handle_redirects(response, **extra) <del> return response <add> """ <add> Forcibly authenticates outgoing requests with the given <add> user and/or token. <add> """ <add> self.handler._force_auth_user = user <add> self.handler._force_auth_token = token <add> <add> def request(self, **request): <add> # Ensure that any credentials set get added to every request. <add> request.update(self._credentials) <add> return super(APIClient, self).request(**request)
2
Ruby
Ruby
add ldflags parameter to std_go_args
86beda7f19eb2acb0b6fbcf4baa8a86e91a336be
<ide><path>Library/Homebrew/formula.rb <ide> def std_cmake_args <ide> end <ide> <ide> # Standard parameters for Go builds. <del> sig { returns(T::Array[T.any(String, Pathname)]) } <del> def std_go_args <del> ["-trimpath", "-o", bin/name] <add> sig { params(ldflags: T.nilable(String)).returns(T::Array[String]) } <add> def std_go_args(ldflags: nil) <add> args = ["-trimpath", "-o=#{bin/name}"] <add> args += ["-ldflags=#{ldflags}"] if ldflags <add> args <ide> end <ide> <ide> # Standard parameters for cabal-v2 builds.
1
Text
Text
decapitalize primitive types
d955645e4bd6528bfb1f2dace63e57f06ef798c5
<ide><path>doc/api/dgram.md <ide> added: v0.11.14 <ide> --> <ide> <ide> * `options` {Object} Required. Supports the following properties: <del> * `port` {Integer} <add> * `port` {integer} <ide> * `address` {string} <ide> * `exclusive` {boolean} <ide> * `callback` {Function} <ide> packets may be sent to a local interface's broadcast address. <ide> added: v8.6.0 <ide> --> <ide> <del>* `multicastInterface` {String} <add>* `multicastInterface` {string} <ide> <ide> *Note: All references to scope in this section are referring to <ide> [IPv6 Zone Indices][], which are defined by [RFC 4007][]. In string form, an IP <ide><path>doc/api/fs.md <ide> deprecated: v1.0.0 <ide> <ide> * `path` {string|Buffer|URL} <ide> * `callback` {Function} <del> * `exists` {Boolean} <add> * `exists` {boolean} <ide> <ide> Test whether or not the given path exists by checking with the file system. <ide> Then call the `callback` argument with either true or false. Example: <ide><path>doc/api/net.md <ide> server.listen({ <ide> added: v0.1.90 <ide> --> <ide> <del>* `path` {String} Path the server should listen to. See <add>* `path` {string} Path the server should listen to. See <ide> [Identifying paths for IPC connections][]. <ide> * `backlog` {number} Common parameter of [`server.listen()`][] functions. <ide> * `callback` {Function} Common parameter of [`server.listen()`][] functions. <ide><path>doc/guides/using-internal-errors.md <ide> likely be required. <ide> <ide> ### Class: errors.Error(key[, args...]) <ide> <del>* `key` {String} The static error identifier <del>* `args...` {Any} Zero or more optional arguments <add>* `key` {string} The static error identifier <add>* `args...` {any} Zero or more optional arguments <ide> <ide> ```js <ide> const errors = require('internal/errors'); <ide> The `myError` object will have a `code` property equal to the `key` and a <ide> <ide> ### Class: errors.TypeError(key[, args...]) <ide> <del>* `key` {String} The static error identifier <del>* `args...` {Any} Zero or more optional arguments <add>* `key` {string} The static error identifier <add>* `args...` {any} Zero or more optional arguments <ide> <ide> ```js <ide> const errors = require('internal/errors'); <ide> The `myError` object will have a `code` property equal to the `key` and a <ide> <ide> ### Class: errors.RangeError(key[, args...]) <ide> <del>* `key` {String} The static error identifier <del>* `args...` {Any} Zero or more optional arguments <add>* `key` {string} The static error identifier <add>* `args...` {any} Zero or more optional arguments <ide> <ide> ```js <ide> const errors = require('internal/errors'); <ide> The `myError` object will have a `code` property equal to the `key` and a <ide> <ide> ### Method: errors.message(key, args) <ide> <del>* `key` {String} The static error identifier <add>* `key` {string} The static error identifier <ide> * `args` {Array} Zero or more optional arguments passed as an Array <del>* Returns: {String} <add>* Returns: {string} <ide> <ide> Returns the formatted error message string for the given `key`.
4
Java
Java
fix simplekey equality with array argument
6d8f3a0a20fe3f0f75dc98eccd7080248238f567
<ide><path>spring-context/src/main/java/org/springframework/cache/interceptor/SimpleKey.java <ide> public SimpleKey(Object... elements) { <ide> <ide> @Override <ide> public boolean equals(Object obj) { <del> return (this == obj || (obj instanceof SimpleKey && Arrays.equals(this.params, ((SimpleKey) obj).params))); <add> return (this == obj || (obj instanceof SimpleKey <add> && Arrays.deepEquals(this.params, ((SimpleKey) obj).params))); <ide> } <ide> <ide> @Override <ide> public int hashCode() { <del> return Arrays.hashCode(this.params); <add> return Arrays.deepHashCode(this.params); <ide> } <ide> <ide> @Override <ide><path>spring-context/src/test/java/org/springframework/cache/interceptor/SimpleKeyGeneratorTests.java <ide> * Tests for {@link SimpleKeyGenerator} and {@link SimpleKey}. <ide> * <ide> * @author Phillip Webb <add> * @author Stephane Nicoll <ide> */ <ide> public class SimpleKeyGeneratorTests { <ide> <ide> private SimpleKeyGenerator generator = new SimpleKeyGenerator(); <ide> <ide> @Test <del> public void noValues() throws Exception { <del> Object k1 = generator.generate(null, null, new Object[] {}); <del> Object k2 = generator.generate(null, null, new Object[] {}); <del> Object k3 = generator.generate(null, null, new Object[] { "different" }); <add> public void noValues() { <add> Object k1 = generateKey(new Object[] {}); <add> Object k2 = generateKey(new Object[] {}); <add> Object k3 = generateKey(new Object[] { "different" }); <ide> assertThat(k1.hashCode(), equalTo(k2.hashCode())); <ide> assertThat(k1.hashCode(), not(equalTo(k3.hashCode()))); <ide> assertThat(k1, equalTo(k2)); <ide> assertThat(k1, not(equalTo(k3))); <ide> } <ide> <ide> @Test <del> public void singleValue() throws Exception { <del> Object k1 = generator.generate(null, null, new Object[] { "a" }); <del> Object k2 = generator.generate(null, null, new Object[] { "a" }); <del> Object k3 = generator.generate(null, null, new Object[] { "different" }); <add> public void singleValue(){ <add> Object k1 = generateKey(new Object[] { "a" }); <add> Object k2 = generateKey(new Object[] { "a" }); <add> Object k3 = generateKey(new Object[] { "different" }); <ide> assertThat(k1.hashCode(), equalTo(k2.hashCode())); <ide> assertThat(k1.hashCode(), not(equalTo(k3.hashCode()))); <ide> assertThat(k1, equalTo(k2)); <ide> public void singleValue() throws Exception { <ide> } <ide> <ide> @Test <del> public void multipleValues() throws Exception { <del> Object k1 = generator.generate(null, null, new Object[] { "a", 1, "b" }); <del> Object k2 = generator.generate(null, null, new Object[] { "a", 1, "b" }); <del> Object k3 = generator.generate(null, null, new Object[] { "b", 1, "a" }); <add> public void multipleValues() { <add> Object k1 = generateKey(new Object[] { "a", 1, "b" }); <add> Object k2 = generateKey(new Object[] { "a", 1, "b" }); <add> Object k3 = generateKey(new Object[] { "b", 1, "a" }); <ide> assertThat(k1.hashCode(), equalTo(k2.hashCode())); <ide> assertThat(k1.hashCode(), not(equalTo(k3.hashCode()))); <ide> assertThat(k1, equalTo(k2)); <ide> assertThat(k1, not(equalTo(k3))); <ide> } <ide> <ide> @Test <del> public void singleNullValue() throws Exception { <del> Object k1 = generator.generate(null, null, new Object[] { null }); <del> Object k2 = generator.generate(null, null, new Object[] { null }); <del> Object k3 = generator.generate(null, null, new Object[] { "different" }); <add> public void singleNullValue() { <add> Object k1 = generateKey(new Object[] { null }); <add> Object k2 = generateKey(new Object[] { null }); <add> Object k3 = generateKey(new Object[] { "different" }); <ide> assertThat(k1.hashCode(), equalTo(k2.hashCode())); <ide> assertThat(k1.hashCode(), not(equalTo(k3.hashCode()))); <ide> assertThat(k1, equalTo(k2)); <ide> public void singleNullValue() throws Exception { <ide> } <ide> <ide> @Test <del> public void multiplNullValues() throws Exception { <del> Object k1 = generator.generate(null, null, new Object[] { "a", null, "b", null }); <del> Object k2 = generator.generate(null, null, new Object[] { "a", null, "b", null }); <del> Object k3 = generator.generate(null, null, new Object[] { "a", null, "b" }); <add> public void multipleNullValues() { <add> Object k1 = generateKey(new Object[] { "a", null, "b", null }); <add> Object k2 = generateKey(new Object[] { "a", null, "b", null }); <add> Object k3 = generateKey(new Object[] { "a", null, "b" }); <ide> assertThat(k1.hashCode(), equalTo(k2.hashCode())); <ide> assertThat(k1.hashCode(), not(equalTo(k3.hashCode()))); <ide> assertThat(k1, equalTo(k2)); <ide> assertThat(k1, not(equalTo(k3))); <ide> } <add> <add> @Test <add> public void arrays() { <add> Object k1 = generateKey(new Object[] { new String[]{"a", "b"}, "c" }); <add> Object k2 = generateKey(new Object[] { new String[]{"a", "b"}, "c" }); <add> Object k3 = generateKey(new Object[] { new String[]{"b", "a"}, "c" }); <add> assertThat(k1.hashCode(), equalTo(k2.hashCode())); <add> assertThat(k1.hashCode(), not(equalTo(k3.hashCode()))); <add> assertThat(k1, equalTo(k2)); <add> assertThat(k1, not(equalTo(k3))); <add> } <add> <add> private Object generateKey(Object[] arguments) { <add> return generator.generate(null, null, arguments); <add> } <ide> }
2
Python
Python
show time spent in the warning of slow progress
6e004306dfe70ab499afc04c31808fdac594ae08
<ide><path>keras/callbacks.py <ide> def on_batch_end(self, batch, logs=None): <ide> delta_t_median = np.median(self._delta_ts_batch_end) <ide> if (self._delta_t_batch > 0. and <ide> (delta_t_median > 0.95 * self._delta_t_batch and delta_t_median > 0.1)): <del> warnings.warn('Method on_batch_end() is slow compared ' <del> 'to the batch update (%f). Check your callbacks.' <del> % delta_t_median) <add> warnings.warn('In your callbacks, method `on_batch_end()` ' <add> 'is slow compared to a model step ' <add> '(%f vs %f). Check your callbacks.' <add> % (delta_t_median, self._delta_t_batch)) <ide> <ide> def on_train_begin(self, logs=None): <ide> """Called at the beginning of training.
1
Text
Text
remove experimental from rmdir recursive
35b17d9abd123853a8e035ca7bc185f7e942d73b
<ide><path>doc/api/fs.md <ide> changes: <ide> it will emit a deprecation warning with id DEP0013. <ide> --> <ide> <del>> Stability: 1 - Recursive removal is experimental. <del> <ide> * `path` {string|Buffer|URL} <ide> * `options` {Object} <ide> * `maxRetries` {integer} If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or <ide> to the completion callback. <ide> Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on <ide> Windows and an `ENOTDIR` error on POSIX. <ide> <add>Setting `recursive` to `true` results in behavior similar to the Unix command <add>`rm -rf`: an error will not be raised for paths that do not exist, and paths <add>that represent files will be deleted. The permissive behavior of the <add>`recursive` option is deprecated, `ENOTDIR` and `ENOENT` will be thrown in <add>the future. <add> <ide> ## `fs.rmdirSync(path[, options])` <ide> <!-- YAML <ide> added: v0.1.21 <ide> changes: <ide> `file:` protocol. Support is currently still *experimental*. <ide> --> <ide> <del>> Stability: 1 - Recursive removal is experimental. <del> <ide> * `path` {string|Buffer|URL} <ide> * `options` {Object} <ide> * `maxRetries` {integer} If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or <ide> Synchronous rmdir(2). Returns `undefined`. <ide> Using `fs.rmdirSync()` on a file (not a directory) results in an `ENOENT` error <ide> on Windows and an `ENOTDIR` error on POSIX. <ide> <add>Setting `recursive` to `true` results in behavior similar to the Unix command <add>`rm -rf`: an error will not be raised for paths that do not exist, and paths <add>that represent files will be deleted. The permissive behavior of the <add>`recursive` option is deprecated, `ENOTDIR` and `ENOENT` will be thrown in <add>the future. <add> <ide> ## `fs.stat(path[, options], callback)` <ide> <!-- YAML <ide> added: v0.0.2 <ide> Using `fsPromises.rmdir()` on a file (not a directory) results in the <ide> `Promise` being rejected with an `ENOENT` error on Windows and an `ENOTDIR` <ide> error on POSIX. <ide> <add>Setting `recursive` to `true` results in behavior similar to the Unix command <add>`rm -rf`: an error will not be raised for paths that do not exist, and paths <add>that represent files will be deleted. The permissive behavior of the <add>`recursive` option is deprecated, `ENOTDIR` and `ENOENT` will be thrown in <add>the future. <add> <ide> ### `fsPromises.stat(path[, options])` <ide> <!-- YAML <ide> added: v10.0.0
1
Ruby
Ruby
fix typo in comment
3c917dd1ec84299460657237f2f4771086ba1106
<ide><path>activerecord/lib/active_record/relation/calculations.rb <ide> module Calculations <ide> # # => counts the number of different age values <ide> # <ide> # Note: not all valid +select+ expressions are valid +count+ expressions. The specifics differ <del> # between databases. In invalid cases, an error from the databsae is thrown. <add> # between databases. In invalid cases, an error from the database is thrown. <ide> def count(column_name = nil, options = {}) <ide> # TODO: Remove options argument as soon we remove support to <ide> # activerecord-deprecated_finders.
1
Ruby
Ruby
freeze columns just before using them as hash keys
2068d300917ed95a82e7377ee77b397fc4084a61
<ide><path>activerecord/lib/active_record/result.rb <ide> class Result <ide> attr_reader :columns, :rows, :column_types <ide> <ide> def initialize(columns, rows, column_types = {}) <del> @columns = columns.map{|c| c.freeze} <add> @columns = columns <ide> @rows = rows <ide> @hash_rows = nil <ide> @column_types = column_types <ide> def initialize_copy(other) <ide> private <ide> def hash_rows <ide> @hash_rows ||= @rows.map { |row| <del> Hash[@columns.zip(row)] <add> # We freeze the strings to prevent them getting duped when <add> # used as keys in ActiveRecord::Model's @attributes hash <add> columns = @columns.map { |c| c.freeze } <add> Hash[columns.zip(row)] <ide> } <ide> end <ide> end
1
Javascript
Javascript
add small doc for `unwatch`
97ed5c28a1d4fe4dbeee6cb2de3931f725dfbdd2
<ide><path>packages/ember-metal/lib/observer.js <ide> export function changeEvent(keyName) { <ide> @static <ide> @for @ember/object/observers <ide> @param obj <del> @param {String} _path <add> @param {String} path <ide> @param {Object|Function} target <ide> @param {Function|String} [method] <ide> @public <ide> */ <del>export function addObserver(obj, _path, target, method) { <del> addListener(obj, changeEvent(_path), target, method); <del> watch(obj, _path); <add>export function addObserver(obj, path, target, method) { <add> addListener(obj, changeEvent(path), target, method); <add> watch(obj, path); <ide> } <ide> <ide> /** <ide><path>packages/ember-metal/lib/watching.js <ide> import { <ide> @method watch <ide> @for Ember <ide> @param obj <del> @param {String} _keyPath <add> @param {String} keyPath <add> @param {Object} meta <ide> */ <del>export function watch(obj, _keyPath, m) { <del> if (isPath(_keyPath)) { <del> watchPath(obj, _keyPath, m); <add>export function watch(obj, keyPath, meta) { <add> if (isPath(keyPath)) { <add> watchPath(obj, keyPath, meta); <ide> } else { <del> watchKey(obj, _keyPath, m); <add> watchKey(obj, keyPath, meta); <ide> } <ide> } <ide> <ide> export function watcherCount(obj, key) { <ide> return (meta !== undefined && meta.peekWatching(key)) || 0; <ide> } <ide> <del>export function unwatch(obj, _keyPath, m) { <del> if (isPath(_keyPath)) { <del> unwatchPath(obj, _keyPath, m); <add>/** <add> Stops watching a property on an object. Usually you will never call this method directly but instead <add> use higher level methods like `removeObserver()`. <add> <add> @private <add> @method unwatch <add> @for Ember <add> @param obj <add> @param {String} keyPath <add> @param {Object} meta <add>*/ <add> <add>export function unwatch(obj, keyPath, meta) { <add> if (isPath(keyPath)) { <add> unwatchPath(obj, keyPath, meta); <ide> } else { <del> unwatchKey(obj, _keyPath, m); <add> unwatchKey(obj, keyPath, meta); <ide> } <ide> }
2
Text
Text
add basic install guide
43b166ad5115fb72a6edd3e416988b9fb75f5ee3
<ide><path>README.md <del># activetext <add># Active Text <add> <add>🤸‍♂️💰📝 <add> <add>## Installing <add> <add>Assumes a Rails 5.2+ application with Active Storage and Webpacker installed. <add> <add>1. Install the gem: <add> <add> ```ruby <add> # Gemfile <add> gem "activetext", github: "basecamp/activetext", require: "active_text" <add> gem "mini_magick" # for Active Storage variants <add> ``` <add> <add>1. Install the npm package: <add> <add> ```js <add> // package.json <add> "dependencies": { <add> "activetext": "basecamp/activetext" <add> } <add> ``` <add> <add> ```sh <add> $ yarn install <add> ``` <add> <add> ```js <add> // app/javascript/packs/application.js <add> import "activetext" <add> ``` <add> <add>1. Declare text columns as Active Text attributes: <add> <add> ```ruby <add> # app/models/message.rb <add> class Message < ActiveRecord::Base <add> active_text_attribute :content <add> end <add> ``` <add> <add>1. Replace form `text_area`s with `active_text_field`s: <add> <add> ```erb <add> <%# app/views/messages/_form.html.erb %> <add> <%= form_with(model: message) do |form| %> <add> … <add> <div class="field"> <add> <%= form.label :content %> <add> <%= form.active_text_field :content %> <add> </div> <add> … <add> <% end %> <add> ```
1
Go
Go
fix duplicate display of dangling images
c680dd9e5adfe7255ac4499bff26bbb6edf7fe78
<ide><path>api/client/commands.go <ide> func (cli *DockerCli) CmdImages(args ...string) error { <ide> outID = common.TruncateID(outID) <ide> } <ide> <del> // Tags referring to this image ID. <del> for _, repotag := range out.GetList("RepoTags") { <del> repo, tag := parsers.ParseRepositoryTag(repotag) <add> repoTags := out.GetList("RepoTags") <add> repoDigests := out.GetList("RepoDigests") <ide> <del> if !*quiet { <del> if *showDigests { <del> fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s ago\t%s\n", repo, tag, "<none>", outID, units.HumanDuration(time.Now().UTC().Sub(time.Unix(out.GetInt64("Created"), 0))), units.HumanSize(float64(out.GetInt64("VirtualSize")))) <del> } else { <del> fmt.Fprintf(w, "%s\t%s\t%s\t%s ago\t%s\n", repo, tag, outID, units.HumanDuration(time.Now().UTC().Sub(time.Unix(out.GetInt64("Created"), 0))), units.HumanSize(float64(out.GetInt64("VirtualSize")))) <del> } <add> if len(repoTags) == 1 && repoTags[0] == "<none>:<none>" && len(repoDigests) == 1 && repoDigests[0] == "<none>@<none>" { <add> // dangling image - clear out either repoTags or repoDigsts so we only show it once below <add> repoDigests = []string{} <add> } <add> <add> // combine the tags and digests lists <add> tagsAndDigests := append(repoTags, repoDigests...) <add> for _, repoAndRef := range tagsAndDigests { <add> repo, ref := parsers.ParseRepositoryTag(repoAndRef) <add> // default tag and digest to none - if there's a value, it'll be set below <add> tag := "<none>" <add> digest := "<none>" <add> if utils.DigestReference(ref) { <add> digest = ref <ide> } else { <del> fmt.Fprintln(w, outID) <add> tag = ref <ide> } <del> } <ide> <del> // Digests referring to this image ID. <del> for _, repoDigest := range out.GetList("RepoDigests") { <del> repo, digest := parsers.ParseRepositoryTag(repoDigest) <ide> if !*quiet { <ide> if *showDigests { <del> fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s ago\t%s\n", repo, "<none>", digest, outID, units.HumanDuration(time.Now().UTC().Sub(time.Unix(out.GetInt64("Created"), 0))), units.HumanSize(float64(out.GetInt64("VirtualSize")))) <add> fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s ago\t%s\n", repo, tag, digest, outID, units.HumanDuration(time.Now().UTC().Sub(time.Unix(out.GetInt64("Created"), 0))), units.HumanSize(float64(out.GetInt64("VirtualSize")))) <ide> } else { <del> fmt.Fprintf(w, "%s\t%s\t%s\t%s ago\t%s\n", repo, "<none>", outID, units.HumanDuration(time.Now().UTC().Sub(time.Unix(out.GetInt64("Created"), 0))), units.HumanSize(float64(out.GetInt64("VirtualSize")))) <add> fmt.Fprintf(w, "%s\t%s\t%s\t%s ago\t%s\n", repo, tag, outID, units.HumanDuration(time.Now().UTC().Sub(time.Unix(out.GetInt64("Created"), 0))), units.HumanSize(float64(out.GetInt64("VirtualSize")))) <ide> } <ide> } else { <ide> fmt.Fprintln(w, outID) <ide><path>integration-cli/docker_cli_images_test.go <ide> import ( <ide> "strings" <ide> "testing" <ide> "time" <add> <add> "github.com/docker/docker/pkg/common" <ide> ) <ide> <ide> func TestImagesEnsureImageIsListed(t *testing.T) { <ide> func TestImagesFilterWhiteSpaceTrimmingAndLowerCasingWorking(t *testing.T) { <ide> <ide> logDone("images - white space trimming and lower casing") <ide> } <add> <add>func TestImagesEnsureDanglingImageOnlyListedOnce(t *testing.T) { <add> defer deleteAllContainers() <add> <add> // create container 1 <add> c := exec.Command(dockerBinary, "run", "-d", "busybox", "true") <add> out, _, err := runCommandWithOutput(c) <add> if err != nil { <add> t.Fatalf("error running busybox: %s, %v", out, err) <add> } <add> containerId1 := strings.TrimSpace(out) <add> <add> // tag as foobox <add> c = exec.Command(dockerBinary, "commit", containerId1, "foobox") <add> out, _, err = runCommandWithOutput(c) <add> if err != nil { <add> t.Fatalf("error tagging foobox: %s", err) <add> } <add> imageId := common.TruncateID(strings.TrimSpace(out)) <add> defer deleteImages(imageId) <add> <add> // overwrite the tag, making the previous image dangling <add> c = exec.Command(dockerBinary, "tag", "-f", "busybox", "foobox") <add> out, _, err = runCommandWithOutput(c) <add> if err != nil { <add> t.Fatalf("error tagging foobox: %s", err) <add> } <add> defer deleteImages("foobox") <add> <add> c = exec.Command(dockerBinary, "images", "-q", "-f", "dangling=true") <add> out, _, err = runCommandWithOutput(c) <add> if err != nil { <add> t.Fatalf("listing images failed with errors: %s, %v", out, err) <add> } <add> <add> if e, a := 1, strings.Count(out, imageId); e != a { <add> t.Fatalf("expected 1 dangling image, got %d: %s", a, out) <add> } <add> <add> logDone("images - dangling image only listed once") <add>}
2
Javascript
Javascript
move logic from viewer.js to chromecom.js
bfcc8af6edcd40933f5e996279a7c9519201e19c
<ide><path>web/chromecom.js <ide> * limitations under the License. <ide> */ <ide> <del>/* globals chrome */ <add>/* globals chrome, PDFJS, PDFView */ <ide> 'use strict'; <ide> <ide> var ChromeCom = (function ChromeComClosure() { <del> return { <del> /** <del> * Creates an event that the extension is listening for and will <del> * asynchronously respond by calling the callback. <del> * @param {String} action The action to trigger. <del> * @param {String} data Optional data to send. <del> * @param {Function} callback Optional response callback that will be called <del> * with one data argument. When the request cannot be handled, the callback <del> * is immediately invoked with no arguments. <del> */ <del> request: function(action, data, callback) { <del> var message = { <del> action: action, <del> data: data <del> }; <del> if (!chrome.runtime) { <del> console.error('chrome.runtime is undefined.'); <del> if (callback) { <del> callback(); <del> } <del> } else if (callback) { <del> chrome.runtime.sendMessage(message, callback); <del> } else { <del> chrome.runtime.sendMessage(message); <add> var ChromeCom = {}; <add> /** <add> * Creates an event that the extension is listening for and will <add> * asynchronously respond by calling the callback. <add> * <add> * @param {String} action The action to trigger. <add> * @param {String} data Optional data to send. <add> * @param {Function} callback Optional response callback that will be called <add> * with one data argument. When the request cannot be handled, the callback <add> * is immediately invoked with no arguments. <add> */ <add> ChromeCom.request = function ChromeCom_request(action, data, callback) { <add> var message = { <add> action: action, <add> data: data <add> }; <add> if (!chrome.runtime) { <add> console.error('chrome.runtime is undefined.'); <add> if (callback) { <add> callback(); <ide> } <add> } else if (callback) { <add> chrome.runtime.sendMessage(message, callback); <add> } else { <add> chrome.runtime.sendMessage(message); <ide> } <ide> }; <add> <add> /** <add> * Opens a PDF file with the PDF viewer. <add> * <add> * @param {String} file Absolute URL of PDF file. <add> */ <add> ChromeCom.openPDFFile = function ChromeCom_openPDFFile(file) { <add> // Expand drive:-URLs to filesystem URLs (Chrome OS) <add> file = file.replace(/^drive:/i, <add> 'filesystem:' + location.origin + '/external/'); <add> <add> ChromeCom.request('getPDFStream', file, function(response) { <add> if (response) { <add> // We will only get a response when the streamsPrivate API is available. <add> <add> var isFTPFile = /^ftp:/i.test(file); <add> var streamUrl = response.streamUrl; <add> if (streamUrl) { <add> console.log('Found data stream for ' + file); <add> PDFView.open(streamUrl, 0, undefined, undefined, { <add> length: response.contentLength <add> }); <add> PDFView.setTitleUsingUrl(file); <add> return; <add> } <add> if (isFTPFile && !response.extensionSupportsFTP) { <add> // Stream not found, and it's loaded from FTP. <add> // When the browser does not support loading ftp resources over <add> // XMLHttpRequest, just reload the page. <add> // NOTE: This will not lead to an infinite redirect loop, because <add> // if the file exists, then the streamsPrivate API will capture the <add> // stream and send back the response. If the stream does not exist, <add> // a "Webpage not available" error will be shown (not the PDF Viewer). <add> location.replace(file); <add> return; <add> } <add> } <add> if (/^filesystem:/.test(file) && !PDFJS.disableWorker) { <add> // The security origin of filesystem:-URLs are not preserved when the <add> // URL is passed to a Web worker, (http://crbug.com/362061), so we have <add> // to create an intermediate blob:-URL as a work-around. <add> var resolveLocalFileSystemURL = window.resolveLocalFileSystemURL || <add> window.webkitResolveLocalFileSystemURL; <add> resolveLocalFileSystemURL(file, function onResolvedFSURL(fileEntry) { <add> fileEntry.file(function(fileObject) { <add> var blobUrl = URL.createObjectURL(fileObject); <add> PDFView.open(blobUrl, 0, undefined, undefined, { <add> length: fileObject.size <add> }); <add> }); <add> }, function onFileSystemError(error) { <add> // This should not happen. When it happens, just fall back to the <add> // usual way of getting the File's data (via the Web worker). <add> console.warn('Cannot resolve file ' + file + ', ' + error.name + ' ' + <add> error.message); <add> PDFView.open(file, 0); <add> }); <add> return; <add> } <add> PDFView.open(file, 0); <add> }); <add> }; <add> return ChromeCom; <ide> })(); <ide><path>web/viewer.js <ide> var DocumentOutlineView = function documentOutlineView(outline) { <ide> // // Run this code outside DOMContentLoaded to make sure that the URL <ide> // // is rewritten as soon as possible. <ide> // var params = PDFView.parseQueryString(document.location.search.slice(1)); <del>// DEFAULT_URL = params.file || DEFAULT_URL; <add>// DEFAULT_URL = params.file || ''; <ide> // <ide> // // Example: chrome-extension://.../http://example.com/file.pdf <ide> // var humanReadableUrl = '/' + DEFAULT_URL + location.hash; <ide> function webViewerInitialized() { <ide> //#endif <ide> //#if CHROME <ide> //var file = DEFAULT_URL; <del>//// XHR cannot get data from drive:-URLs, so expand to filesystem: (Chrome OS) <del>//file = file.replace(/^drive:/i, <del>// 'filesystem:' + location.origin + '/external/'); <ide> //#endif <ide> <ide> //#if !(FIREFOX || MOZCENTRAL || CHROME || B2G) <ide> function webViewerInitialized() { <ide> PDFView.open(file, 0); <ide> } <ide> //#endif <del> <ide> //#if CHROME <del>//ChromeCom.request('getPDFStream', file, function(response) { <del>// if (response) { <del>// // We will only get a response when the streamsPrivate API is available. <del>// <del>// var isFTPFile = /^ftp:/i.test(file); <del>// var streamUrl = response.streamUrl; <del>// if (streamUrl) { <del>// console.log('Found data stream for ' + file); <del>// PDFView.open(streamUrl, 0, undefined, undefined, { <del>// length: response.contentLength <del>// }); <del>// PDFView.setTitleUsingUrl(file); <del>// return; <del>// } <del>// if (isFTPFile && !response.extensionSupportsFTP) { <del>// // Stream not found, and it's loaded from FTP. <del>// // When the browser does not support loading ftp resources over <del>// // XMLHttpRequest, just reload the page. <del>// // NOTE: This will not lead to an infinite redirect loop, because <del>// // if the file exists, then the streamsPrivate API will capture the <del>// // stream and send back the response. If the stream does not exist, then <del>// // a "Webpage not available" error will be shown (not the PDF Viewer). <del>// location.replace(file); <del>// return; <del>// } <del>// } <del>// if (/^filesystem:/.test(file) && !PDFJS.disableWorker) { <del>// // The security origin of filesystem:-URLs are not preserved when the URL <del>// // is passed to a Web worker, (http://crbug.com/362061), so we have to <del>// // create an intermediate blob:-URL as a work-around. <del>// var resolveLocalFileSystemURL = window.resolveLocalFileSystemURL || <del>// window.webkitResolveLocalFileSystemURL; <del>// resolveLocalFileSystemURL(file, function onFileSystemSuccess(fileEntry) { <del>// fileEntry.file(function(fileObject) { <del>// var blobUrl = URL.createObjectURL(fileObject); <del>// PDFView.open(blobUrl, 0, undefined, undefined, { <del>// length: fileObject.size <del>// }); <del>// }); <del>// }, function onFileSystemError(error) { <del>// // This should not happen. When it happens, just fall back to the normal <del>// // way of getting the File's data (via the Web worker). <del>// console.warn('Cannot resolve file ' + file + ', ' + error.name + ' ' + <del>// error.message); <del>// PDFView.open(file, 0); <del>// }); <del>// return; <del>// } <del>// PDFView.open(file, 0); <del>//}); <add>//if (file) { <add>// ChromeCom.openPDFFile(file); <add>//} <ide> //#endif <ide> } <ide>
2
PHP
PHP
add deprecation warning
401870e6a0bf210a6711d28af6ee9c033423450d
<ide><path>src/View/ViewVarsTrait.php <ide> public function createView($viewClass = null) <ide> $builder->setClassName($viewClass); <ide> } <ide> <del> $validViewOptions = $this->viewOptions(); <add> $validViewOptions = isset($this->_validViewOptions) ? $this->_validViewOptions : []; <ide> $viewOptions = []; <ide> foreach ($validViewOptions as $option) { <ide> if (property_exists($this, $option)) { <ide> public function set($name, $value = null) <ide> */ <ide> public function viewOptions($options = null, $merge = true) <ide> { <add> deprecationWarning( <add> 'ViewVarsTrait::viewOptions() is deprecated, used ViewBuilder::setOptions() instead.' <add> ); <add> <ide> if (!isset($this->_validViewOptions)) { <ide> $this->_validViewOptions = []; <ide> } <ide><path>tests/TestCase/View/ViewVarsTraitTest.php <ide> public function testSetTwoParamCombined() <ide> */ <ide> public function testAddOneViewOption() <ide> { <del> $option = 'newOption'; <del> $this->subject->viewOptions($option); <add> $this->deprecated(function () { <add> $option = 'newOption'; <add> $this->subject->viewOptions($option); <ide> <del> $this->assertContains($option, $this->subject->viewOptions()); <add> $this->assertContains($option, $this->subject->viewOptions()); <add> }); <ide> } <ide> <ide> /** <ide> public function testAddOneViewOption() <ide> */ <ide> public function testAddTwoViewOption() <ide> { <del> $this->subject->viewOptions(['oldOption'], false); <del> $option = ['newOption', 'anotherOption']; <del> $result = $this->subject->viewOptions($option); <del> $expects = ['oldOption', 'newOption', 'anotherOption']; <add> $this->deprecated(function () { <add> $this->subject->viewOptions(['oldOption'], false); <add> $option = ['newOption', 'anotherOption']; <add> $result = $this->subject->viewOptions($option); <add> $expects = ['oldOption', 'newOption', 'anotherOption']; <ide> <del> $this->assertContainsOnly('string', $result); <del> $this->assertEquals($expects, $result); <add> $this->assertContainsOnly('string', $result); <add> $this->assertEquals($expects, $result); <add> }); <ide> } <ide> <ide> /** <ide> public function testAddTwoViewOption() <ide> */ <ide> public function testReadingViewOptions() <ide> { <del> $expected = $this->subject->viewOptions(['one', 'two', 'three'], false); <del> $result = $this->subject->viewOptions(); <add> $this->deprecated(function () { <add> $expected = $this->subject->viewOptions(['one', 'two', 'three'], false); <add> $result = $this->subject->viewOptions(); <ide> <del> $this->assertEquals($expected, $result); <add> $this->assertEquals($expected, $result); <add> }); <ide> } <ide> <ide> /** <ide> public function testReadingViewOptions() <ide> */ <ide> public function testMergeFalseViewOptions() <ide> { <del> $this->subject->viewOptions(['one', 'two', 'three'], false); <del> $expected = ['four', 'five', 'six']; <del> $result = $this->subject->viewOptions($expected, false); <add> $this->deprecated(function () { <add> $this->subject->viewOptions(['one', 'two', 'three'], false); <add> $expected = ['four', 'five', 'six']; <add> $result = $this->subject->viewOptions($expected, false); <ide> <del> $this->assertEquals($expected, $result); <add> $this->assertEquals($expected, $result); <add> }); <ide> } <ide> <ide> /** <ide> public function testMergeFalseViewOptions() <ide> */ <ide> public function testUndefinedValidViewOptions() <ide> { <del> $result = $this->subject->viewOptions([], false); <del> <del> $this->assertInternalType('array', $result); <del> $this->assertEmpty($result); <add> $this->deprecated(function () { <add> $result = $this->subject->viewOptions([], false); <add> $this->assertInternalType('array', $result); <add> $this->assertEmpty($result); <add> }); <ide> } <ide> <ide> /**
2
PHP
PHP
add keymap method to collection
c5acf79cc86275f45018056cb3c1e95f32619af1
<ide><path>src/Illuminate/Support/Collection.php <ide> public function map(callable $callback) <ide> return new static(array_combine($keys, $items)); <ide> } <ide> <add> /** <add> * Run a map over each key of the items. <add> * <add> * @param callable $callback <add> * @return static <add> */ <add> public function keyMap(callable $callback) <add> { <add> $values = array_values($this->items); <add> <add> $keys = array_map($callback, array_keys($this->items), $this->items); <add> <add> return new static(array_combine($keys, $values)); <add> } <add> <ide> /** <ide> * Map a collection and flatten the result by a single level. <ide> * <ide><path>tests/Support/SupportCollectionTest.php <ide> public function testWithMultipleModeValues() <ide> $collection = new Collection([1, 2, 2, 1]); <ide> $this->assertEquals([1, 2], $collection->mode()); <ide> } <add> <add> public function testKeyMapUsingKeysOnly() <add> { <add> $data = new Collection(['foo' => 'something', 'bar' => 'else']); <add> $data = $data->keyMap(function ($key) { <add> return '-'.$key.'-'; <add> }); <add> $this->assertEquals(['-foo-' => 'something', '-bar-' => 'else'], $data->all()); <add> } <add> <add> public function testKeyMapUsingKeysAndValues() <add> { <add> $data = new Collection(['foo' => 'something', 'bar' => 'else']); <add> $data = $data->keyMap(function ($key, $item) { <add> return $key.'-'.$item; <add> }); <add> $this->assertEquals(['foo-something' => 'something', 'bar-else' => 'else'], $data->all()); <add> } <ide> } <ide> <ide> class TestAccessorEloquentTestStub
2
Javascript
Javascript
add js changes
a9bed8e75d9b9613c5fcb69436a2d3af763f456d
<ide><path>Libraries/Core/setUpReactDevTools.js <ide> if (__DEV__) { <ide> }); <ide> <ide> const ReactNativeStyleAttributes = require('../Components/View/ReactNativeStyleAttributes'); <add> const devToolsSettingsManager = require('../DevToolsSettings/DevToolsSettingsManager'); <ide> <ide> reactDevTools.connectToDevTools({ <ide> isAppActive, <ide> if (__DEV__) { <ide> ReactNativeStyleAttributes, <ide> ), <ide> websocket: ws, <add> devToolsSettingsManager, <ide> }); <ide> } <ide> };
1
Python
Python
update serialization tests for tokenizer
3152ee5ca2f21708e428faac5eaadbb403d0a1dc
<ide><path>spacy/tests/serialize/test_serialize_tokenizer.py <ide> # coding: utf-8 <ide> from __future__ import unicode_literals <ide> <del>from ..util import make_tempdir <add>from ...util import get_lang_class <add>from ..util import make_tempdir, assert_packed_msg_equal <ide> <ide> import pytest <ide> <ide> <del>@pytest.mark.parametrize('text', ["I can't do this"]) <add>def load_tokenizer(b): <add> tok = get_lang_class('en').Defaults.create_tokenizer() <add> tok.from_bytes(b) <add> return tok <add> <add> <add>@pytest.mark.parametrize('text', ["I💜you", "they’re", "“hello”"]) <ide> def test_serialize_tokenizer_roundtrip_bytes(en_tokenizer, text): <del> tokenizer_b = en_tokenizer.to_bytes() <del> new_tokenizer = en_tokenizer.from_bytes(tokenizer_b) <del> assert new_tokenizer.to_bytes() == tokenizer_b <del> doc1 = en_tokenizer(text) <add> tokenizer = en_tokenizer <add> new_tokenizer = load_tokenizer(tokenizer.to_bytes()) <add> assert_packed_msg_equal(new_tokenizer.to_bytes(), tokenizer.to_bytes()) <add> # assert new_tokenizer.to_bytes() == tokenizer.to_bytes() <add> doc1 = tokenizer(text) <ide> doc2 = new_tokenizer(text) <ide> assert [token.text for token in doc1] == [token.text for token in doc2] <ide>
1
Text
Text
fix readme links in the main readme.md
c02675b649fe5c27477a6d053b8500be9f2b422d
<ide><path>README.md <ide> database rows as objects and embellish these data objects with business logic <ide> methods. Although most Rails models are backed by a database, models can also <ide> be ordinary Ruby classes, or Ruby classes that implement a set of interfaces <ide> as provided by the Active Model module. You can read more about Active Record <del>in its [README](link:/activerecord/README.rdoc). <add>in its [README](activerecord/README.rdoc). <ide> <ide> The _Controller layer_ is responsible for handling incoming HTTP requests and <ide> providing a suitable response. Usually this means returning HTML, but Rails <ide> In Rails, the Controller and View layers are handled together by Action Pack. <ide> These two layers are bundled in a single package due to their heavy interdependence. <ide> This is unlike the relationship between Active Record and Action Pack, which are <ide> independent. Each of these packages can be used independently outside of Rails. You <del>can read more about Action Pack in its [README](link:/actionpack/README.rdoc). <add>can read more about Action Pack in its [README](actionpack/README.rdoc). <ide> <ide> ## Getting Started <ide>
1
Python
Python
add new algorithm for armstrong numbers
f37d415227a21017398144a090a66f1c690705eb
<ide><path>maths/armstrong_numbers.py <ide> """ <del>An Armstrong number is equal to the sum of its own digits each raised <del>to the power of the number of digits. <add>An Armstrong number is equal to the sum of its own digits each raised to the <add>power of the number of digits. <add> <ide> For example, 370 is an Armstrong number because 3*3*3 + 7*7*7 + 0*0*0 = 370. <del>An Armstrong number is often called Narcissistic number. <add> <add>Armstrong numbers are also called Narcissistic numbers and Pluperfect numbers. <add> <add>On-Line Encyclopedia of Integer Sequences entry: https://oeis.org/A005188 <ide> """ <add>PASSING = (1, 153, 370, 371, 1634, 24678051, 115132219018763992565095597973971522401) <add>FAILING = (-153, -1, 0, 1.2, 200, "A", [], {}, None) <ide> <ide> <ide> def armstrong_number(n: int) -> bool: <ide> """ <ide> Return True if n is an Armstrong number or False if it is not. <ide> <del> >>> armstrong_number(153) <add> >>> all(armstrong_number(n) for n in PASSING) <ide> True <del> >>> armstrong_number(200) <del> False <del> >>> armstrong_number(1634) <del> True <del> >>> armstrong_number(0) <del> False <del> >>> armstrong_number(-1) <del> False <del> >>> armstrong_number(1.2) <add> >>> any(armstrong_number(n) for n in FAILING) <ide> False <ide> """ <ide> if not isinstance(n, int) or n < 1: <ide> def armstrong_number(n: int) -> bool: <ide> return n == sum <ide> <ide> <del>def narcissistic_number(n: int) -> bool: <del> """Return True if n is a narcissistic number or False if it is not""" <add>def pluperfect_number(n: int) -> bool: <add> """Return True if n is a pluperfect number or False if it is not <add> <add> >>> all(armstrong_number(n) for n in PASSING) <add> True <add> >>> any(armstrong_number(n) for n in FAILING) <add> False <add> """ <add> if not isinstance(n, int) or n < 1: <add> return False <add> <add> # Init a "histogram" of the digits <add> digit_histogram = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] <add> digit_total = 0 <add> sum = 0 <add> temp = n <add> while temp > 0: <add> temp, rem = divmod(temp, 10) <add> digit_histogram[rem] += 1 <add> digit_total += 1 <add> <add> for (cnt, i) in zip(digit_histogram, range(len(digit_histogram))): <add> sum += cnt * i ** digit_total <add> <add> return n == sum <ide> <del> expo = len(str(n)) # power, all number will be raised to <del> # each digit will be multiplied expo times <del> temp = [(int(i) ** expo) for i in str(n)] <ide> <del> # check if sum of cube of each digit is equal to number <del> return n == sum(temp) <add>def narcissistic_number(n: int) -> bool: <add> """Return True if n is a narcissistic number or False if it is not. <add> <add> >>> all(armstrong_number(n) for n in PASSING) <add> True <add> >>> any(armstrong_number(n) for n in FAILING) <add> False <add> """ <add> if not isinstance(n, int) or n < 1: <add> return False <add> expo = len(str(n)) # the power that all digits will be raised to <add> # check if sum of each digit multiplied expo times is equal to number <add> return n == sum(int(i) ** expo for i in str(n)) <ide> <ide> <ide> def main(): <ide> def main(): <ide> num = int(input("Enter an integer to see if it is an Armstrong number: ").strip()) <ide> print(f"{num} is {'' if armstrong_number(num) else 'not '}an Armstrong number.") <ide> print(f"{num} is {'' if narcissistic_number(num) else 'not '}an Armstrong number.") <add> print(f"{num} is {'' if pluperfect_number(num) else 'not '}an Armstrong number.") <ide> <ide> <ide> if __name__ == "__main__":
1
Go
Go
skip privileged tests when non-root
c7e74267965f9b03e64128de6951ee25fed66afc
<ide><path>pkg/chrootarchive/archive_unix_test.go <ide> import ( <ide> "github.com/docker/docker/pkg/archive" <ide> "golang.org/x/sys/unix" <ide> "gotest.tools/v3/assert" <add> "gotest.tools/v3/skip" <ide> ) <ide> <ide> // Test for CVE-2018-15664 <ide> // Assures that in the case where an "attacker" controlled path is a symlink to <ide> // some path outside of a container's rootfs that we do not copy data to a <ide> // container path that will actually overwrite data on the host <ide> func TestUntarWithMaliciousSymlinks(t *testing.T) { <add> skip.If(t, os.Getuid() != 0, "skipping test that requires root") <ide> dir, err := ioutil.TempDir("", t.Name()) <ide> assert.NilError(t, err) <ide> defer os.RemoveAll(dir) <ide> func TestUntarWithMaliciousSymlinks(t *testing.T) { <ide> // some path outside of a container's rootfs that we do not unwittingly leak <ide> // host data into the archive. <ide> func TestTarWithMaliciousSymlinks(t *testing.T) { <add> skip.If(t, os.Getuid() != 0, "skipping test that requires root") <ide> dir, err := ioutil.TempDir("", t.Name()) <ide> assert.NilError(t, err) <ide> // defer os.RemoveAll(dir)
1
Javascript
Javascript
move nodes around by reference instead of by index
27926572f6bd468d8dc4e7e855ea9ce87fc4b406
<ide><path>src/renderers/dom/client/utils/DOMChildrenOperations.js <ide> var ReactPerf = require('ReactPerf'); <ide> <ide> var setInnerHTML = require('setInnerHTML'); <ide> var setTextContent = require('setTextContent'); <del>var invariant = require('invariant'); <add> <add>function getNodeAfter(parentNode, node) { <add> return node ? node.nextSibling : parentNode.firstChild; <add>} <ide> <ide> /** <ide> * Inserts `childNode` as a child of `parentNode` at the `index`. <ide> var invariant = require('invariant'); <ide> * @param {number} index Index at which to insert the child. <ide> * @internal <ide> */ <del>function insertChildAt(parentNode, childNode, index) { <del> // We can rely exclusively on `insertBefore(node, null)` instead of also using <add>function insertChildAt(parentNode, childNode, referenceNode) { <add> // We rely exclusively on `insertBefore(node, null)` instead of also using <ide> // `appendChild(node)`. (Using `undefined` is not allowed by all browsers so <ide> // we are careful to use `null`.) <del> <del> // In Safari, .childNodes[index] can return a DOM node with id={index} so we <del> // use .item() instead which is immune to this bug. (See #3560.) In contrast <del> // to the spec, IE8 throws an error if index is larger than the list size. <del> var referenceNode = <del> index < parentNode.childNodes.length ? <del> parentNode.childNodes.item(index) : null; <del> <ide> parentNode.insertBefore(childNode, referenceNode); <ide> } <ide> <del>function insertLazyTreeChildAt(parentNode, childTree, index) { <del> // See above. <del> var referenceNode = <del> index < parentNode.childNodes.length ? <del> parentNode.childNodes.item(index) : null; <del> <add>function insertLazyTreeChildAt(parentNode, childTree, referenceNode) { <ide> DOMLazyTree.insertTreeBefore(parentNode, childTree, referenceNode); <ide> } <ide> <ide> var DOMChildrenOperations = { <ide> * @internal <ide> */ <ide> processUpdates: function(parentNode, updates) { <del> var update; <del> // Mapping from parent IDs to initial child orderings. <del> var initialChildren = null; <del> // List of children that will be moved or removed. <del> var updatedChildren = null; <del> <del> var markupList = null; <del> <del> for (var i = 0; i < updates.length; i++) { <del> update = updates[i]; <del> if (update.type === ReactMultiChildUpdateTypes.MOVE_EXISTING || <del> update.type === ReactMultiChildUpdateTypes.REMOVE_NODE) { <del> var updatedIndex = update.fromIndex; <del> var updatedChild = parentNode.childNodes[updatedIndex]; <del> <del> invariant( <del> updatedChild, <del> 'processUpdates(): Unable to find child %s of element %s. This ' + <del> 'probably means the DOM was unexpectedly mutated (e.g., by the ' + <del> 'browser), usually due to forgetting a <tbody> when using tables, ' + <del> 'nesting tags like <form>, <p>, or <a>, or using non-SVG elements ' + <del> 'in an <svg> parent.', <del> updatedIndex, <del> parentNode, <del> ); <del> <del> initialChildren = initialChildren || {}; <del> initialChildren[updatedIndex] = updatedChild; <del> <del> updatedChildren = updatedChildren || []; <del> updatedChildren.push(updatedChild); <del> } else if (update.type === ReactMultiChildUpdateTypes.INSERT_MARKUP) { <del> // Replace each HTML string with an index into the markup list <del> if (typeof update.content === 'string') { <del> markupList = markupList || []; <del> update.content = markupList.push(update.markup); <del> } <del> } <del> } <del> <del> var renderedMarkup; <del> if (markupList) { <del> renderedMarkup = Danger.dangerouslyRenderMarkup(markupList); <del> } <del> <del> // Remove updated children first so that `toIndex` is consistent. <del> if (updatedChildren) { <del> for (var j = 0; j < updatedChildren.length; j++) { <del> parentNode.removeChild(updatedChildren[j]); <del> } <del> } <del> <ide> for (var k = 0; k < updates.length; k++) { <del> update = updates[k]; <add> var update = updates[k]; <ide> switch (update.type) { <ide> case ReactMultiChildUpdateTypes.INSERT_MARKUP: <del> if (renderedMarkup) { <del> insertChildAt( <del> parentNode, <del> renderedMarkup[update.content], <del> update.toIndex <del> ); <del> } else { <del> insertLazyTreeChildAt( <del> parentNode, <del> update.content, <del> update.toIndex <del> ); <del> } <add> insertLazyTreeChildAt( <add> parentNode, <add> update.content, <add> getNodeAfter(parentNode, update.afterNode) <add> ); <ide> break; <ide> case ReactMultiChildUpdateTypes.MOVE_EXISTING: <ide> insertChildAt( <ide> parentNode, <del> initialChildren[update.fromIndex], <del> update.toIndex <add> update.fromNode, <add> getNodeAfter(parentNode, update.afterNode) <ide> ); <ide> break; <ide> case ReactMultiChildUpdateTypes.SET_MARKUP: <ide> var DOMChildrenOperations = { <ide> ); <ide> break; <ide> case ReactMultiChildUpdateTypes.REMOVE_NODE: <del> // Already removed by the for-loop above. <add> parentNode.removeChild(update.fromNode); <ide> break; <ide> } <ide> } <ide><path>src/renderers/shared/reconciler/ReactChildReconciler.js <ide> var ReactChildReconciler = { <ide> updateChildren: function( <ide> prevChildren, <ide> nextChildren, <add> removedNodes, <ide> transaction, <ide> context) { <ide> // We currently don't have a way to track moves here but if we use iterators <ide> var ReactChildReconciler = { <ide> // TODO: If nothing has changed, return the prevChildren object so that we <ide> // can quickly bailout if nothing has changed. <ide> if (!nextChildren && !prevChildren) { <del> return null; <add> return; <ide> } <ide> var name; <add> var prevChild; <ide> for (name in nextChildren) { <ide> if (!nextChildren.hasOwnProperty(name)) { <ide> continue; <ide> } <del> var prevChild = prevChildren && prevChildren[name]; <add> prevChild = prevChildren && prevChildren[name]; <ide> var prevElement = prevChild && prevChild._currentElement; <ide> var nextElement = nextChildren[name]; <ide> if (prevChild != null && <ide> var ReactChildReconciler = { <ide> nextChildren[name] = prevChild; <ide> } else { <ide> if (prevChild) { <del> ReactReconciler.unmountComponent(prevChild, name); <add> removedNodes[name] = ReactReconciler.getNativeNode(prevChild); <add> ReactReconciler.unmountComponent(prevChild); <ide> } <ide> // The child must be instantiated before it's mounted. <ide> var nextChildInstance = instantiateReactComponent(nextElement); <ide> var ReactChildReconciler = { <ide> for (name in prevChildren) { <ide> if (prevChildren.hasOwnProperty(name) && <ide> !(nextChildren && nextChildren.hasOwnProperty(name))) { <del> ReactReconciler.unmountComponent(prevChildren[name]); <add> prevChild = prevChildren[name]; <add> removedNodes[name] = ReactReconciler.getNativeNode(prevChild); <add> ReactReconciler.unmountComponent(prevChild); <ide> } <ide> } <del> return nextChildren; <ide> }, <ide> <ide> /** <ide><path>src/renderers/shared/reconciler/ReactMultiChild.js <ide> var ReactReconciler = require('ReactReconciler'); <ide> var ReactChildReconciler = require('ReactChildReconciler'); <ide> <ide> var flattenChildren = require('flattenChildren'); <add>var invariant = require('invariant'); <ide> <ide> /** <ide> * Make an update for markup to be rendered and inserted at a supplied index. <ide> var flattenChildren = require('flattenChildren'); <ide> * @param {number} toIndex Destination index. <ide> * @private <ide> */ <del>function makeInsertMarkup(markup, toIndex) { <add>function makeInsertMarkup(markup, afterNode, toIndex) { <ide> // NOTE: Null values reduce hidden classes. <ide> return { <ide> type: ReactMultiChildUpdateTypes.INSERT_MARKUP, <ide> content: markup, <ide> fromIndex: null, <add> fromNode: null, <ide> toIndex: toIndex, <add> afterNode: afterNode, <ide> }; <ide> } <ide> <ide> function makeInsertMarkup(markup, toIndex) { <ide> * @param {number} toIndex Destination index of the element. <ide> * @private <ide> */ <del>function makeMove(fromIndex, toIndex) { <add>function makeMove(child, afterNode, toIndex) { <ide> // NOTE: Null values reduce hidden classes. <ide> return { <ide> type: ReactMultiChildUpdateTypes.MOVE_EXISTING, <ide> content: null, <del> fromIndex: fromIndex, <add> fromIndex: child._mountIndex, <add> fromNode: ReactReconciler.getNativeNode(child), <ide> toIndex: toIndex, <add> afterNode: afterNode, <ide> }; <ide> } <ide> <ide> function makeMove(fromIndex, toIndex) { <ide> * @param {number} fromIndex Index of the element to remove. <ide> * @private <ide> */ <del>function makeRemove(fromIndex) { <add>function makeRemove(child, node) { <ide> // NOTE: Null values reduce hidden classes. <ide> return { <ide> type: ReactMultiChildUpdateTypes.REMOVE_NODE, <ide> content: null, <del> fromIndex: fromIndex, <add> fromIndex: child._mountIndex, <add> fromNode: node, <ide> toIndex: null, <add> afterNode: null, <ide> }; <ide> } <ide> <ide> function makeSetMarkup(markup) { <ide> type: ReactMultiChildUpdateTypes.SET_MARKUP, <ide> content: markup, <ide> fromIndex: null, <add> fromNode: null, <ide> toIndex: null, <add> afterNode: null, <ide> }; <ide> } <ide> <ide> function makeTextContent(textContent) { <ide> type: ReactMultiChildUpdateTypes.TEXT_CONTENT, <ide> content: textContent, <ide> fromIndex: null, <add> fromNode: null, <ide> toIndex: null, <add> afterNode: null, <ide> }; <ide> } <ide> <ide> var ReactMultiChild = { <ide> ); <ide> }, <ide> <del> _reconcilerUpdateChildren: function(prevChildren, nextNestedChildrenElements, transaction, context) { <add> _reconcilerUpdateChildren: function( <add> prevChildren, <add> nextNestedChildrenElements, <add> removedNodes, <add> transaction, <add> context <add> ) { <ide> var nextChildren; <ide> if (__DEV__) { <ide> if (this._currentElement) { <ide> var ReactMultiChild = { <ide> } finally { <ide> ReactCurrentOwner.current = null; <ide> } <del> return ReactChildReconciler.updateChildren( <del> prevChildren, nextChildren, transaction, context <add> ReactChildReconciler.updateChildren( <add> prevChildren, nextChildren, removedNodes, transaction, context <ide> ); <add> return nextChildren; <ide> } <ide> } <ide> nextChildren = flattenChildren(nextNestedChildrenElements); <del> return ReactChildReconciler.updateChildren( <del> prevChildren, nextChildren, transaction, context <add> ReactChildReconciler.updateChildren( <add> prevChildren, nextChildren, removedNodes, transaction, context <ide> ); <add> return nextChildren; <ide> }, <ide> <ide> /** <ide> var ReactMultiChild = { <ide> var prevChildren = this._renderedChildren; <ide> // Remove any rendered children. <ide> ReactChildReconciler.unmountChildren(prevChildren); <del> // TODO: The setTextContent operation should be enough <del> var updates = []; <ide> for (var name in prevChildren) { <ide> if (prevChildren.hasOwnProperty(name)) { <del> updates.push(this._unmountChild(prevChildren[name])); <add> invariant(false, 'updateTextContent called on non-empty component.'); <ide> } <ide> } <ide> // Set new text content. <del> updates.push(makeTextContent(nextContent)); <add> var updates = [makeTextContent(nextContent)]; <ide> processQueue(this, updates); <ide> }, <ide> <ide> var ReactMultiChild = { <ide> var prevChildren = this._renderedChildren; <ide> // Remove any rendered children. <ide> ReactChildReconciler.unmountChildren(prevChildren); <del> var updates = []; <ide> for (var name in prevChildren) { <ide> if (prevChildren.hasOwnProperty(name)) { <del> updates.push(this._unmountChild(prevChildren[name])); <add> invariant(false, 'updateTextContent called on non-empty component.'); <ide> } <ide> } <del> updates.push(makeSetMarkup(nextMarkup)); <add> var updates = [makeSetMarkup(nextMarkup)]; <ide> processQueue(this, updates); <ide> }, <ide> <ide> var ReactMultiChild = { <ide> */ <ide> _updateChildren: function(nextNestedChildrenElements, transaction, context) { <ide> var prevChildren = this._renderedChildren; <add> var removedNodes = {}; <ide> var nextChildren = this._reconcilerUpdateChildren( <del> prevChildren, nextNestedChildrenElements, transaction, context <add> prevChildren, <add> nextNestedChildrenElements, <add> removedNodes, <add> transaction, <add> context <ide> ); <ide> if (!nextChildren && !prevChildren) { <ide> return; <ide> var ReactMultiChild = { <ide> // `lastIndex` will be the last index visited in `prevChildren`. <ide> var lastIndex = 0; <ide> var nextIndex = 0; <add> var lastPlacedNode = null; <ide> for (name in nextChildren) { <ide> if (!nextChildren.hasOwnProperty(name)) { <ide> continue; <ide> var ReactMultiChild = { <ide> if (prevChild === nextChild) { <ide> updates = enqueue( <ide> updates, <del> this.moveChild(prevChild, nextIndex, lastIndex) <add> this.moveChild(prevChild, lastPlacedNode, nextIndex, lastIndex) <ide> ); <ide> lastIndex = Math.max(prevChild._mountIndex, lastIndex); <ide> prevChild._mountIndex = nextIndex; <ide> } else { <ide> if (prevChild) { <ide> // Update `lastIndex` before `_mountIndex` gets unset by unmounting. <ide> lastIndex = Math.max(prevChild._mountIndex, lastIndex); <del> updates = enqueue(updates, this._unmountChild(prevChild)); <add> // The `removedNodes` loop below will actually remove the child. <ide> } <ide> // The child must be instantiated before it's mounted. <ide> updates = enqueue( <ide> updates, <del> this._mountChildAtIndex(nextChild, nextIndex, transaction, context) <add> this._mountChildAtIndex( <add> nextChild, <add> lastPlacedNode, <add> nextIndex, <add> transaction, <add> context <add> ) <ide> ); <ide> } <ide> nextIndex++; <add> lastPlacedNode = ReactReconciler.getNativeNode(nextChild); <ide> } <ide> // Remove children that are no longer present. <del> for (name in prevChildren) { <del> if (prevChildren.hasOwnProperty(name) && <del> !(nextChildren && nextChildren.hasOwnProperty(name))) { <add> for (name in removedNodes) { <add> if (removedNodes.hasOwnProperty(name)) { <ide> updates = enqueue( <ide> updates, <del> this._unmountChild(prevChildren[name]) <add> this._unmountChild(prevChildren[name], removedNodes[name]) <ide> ); <ide> } <ide> } <ide> var ReactMultiChild = { <ide> <ide> /** <ide> * Unmounts all rendered children. This should be used to clean up children <del> * when this component is unmounted. <add> * when this component is unmounted. It does not actually perform any <add> * backend operations. <ide> * <ide> * @internal <ide> */ <ide> var ReactMultiChild = { <ide> * @param {number} lastIndex Last index visited of the siblings of `child`. <ide> * @protected <ide> */ <del> moveChild: function(child, toIndex, lastIndex) { <add> moveChild: function(child, afterNode, toIndex, lastIndex) { <ide> // If the index of `child` is less than `lastIndex`, then it needs to <ide> // be moved. Otherwise, we do not need to move it because a child will be <ide> // inserted or moved before `child`. <ide> if (child._mountIndex < lastIndex) { <del> return makeMove(child._mountIndex, toIndex); <add> return makeMove(child, afterNode, toIndex); <ide> } <ide> }, <ide> <ide> var ReactMultiChild = { <ide> * @param {string} mountImage Markup to insert. <ide> * @protected <ide> */ <del> createChild: function(child, mountImage) { <del> return makeInsertMarkup(mountImage, child._mountIndex); <add> createChild: function(child, afterNode, mountImage) { <add> return makeInsertMarkup(mountImage, afterNode, child._mountIndex); <ide> }, <ide> <ide> /** <ide> var ReactMultiChild = { <ide> * @param {ReactComponent} child Child to remove. <ide> * @protected <ide> */ <del> removeChild: function(child) { <del> return makeRemove(child._mountIndex); <add> removeChild: function(child, node) { <add> return makeRemove(child, node); <ide> }, <ide> <ide> /** <ide> var ReactMultiChild = { <ide> */ <ide> _mountChildAtIndex: function( <ide> child, <add> afterNode, <ide> index, <ide> transaction, <ide> context) { <ide> var ReactMultiChild = { <ide> context <ide> ); <ide> child._mountIndex = index; <del> return this.createChild(child, mountImage); <add> return this.createChild(child, afterNode, mountImage); <ide> }, <ide> <ide> /** <ide> var ReactMultiChild = { <ide> * @param {ReactComponent} child Component to unmount. <ide> * @private <ide> */ <del> _unmountChild: function(child) { <del> var update = this.removeChild(child); <add> _unmountChild: function(child, node) { <add> var update = this.removeChild(child, node); <ide> child._mountIndex = null; <ide> return update; <ide> },
3
Ruby
Ruby
remove duplicated parameter check on #where!
1a4d13b8f429afe218eb98d8dbf82780e4f191e6
<ide><path>activerecord/lib/active_record/relation/query_methods.rb <ide> def where(opts = :chain, *rest) <ide> end <ide> end <ide> <del> def where!(opts = :chain, *rest) # :nodoc: <del> if opts == :chain <del> WhereChain.new(self) <del> else <del> references!(PredicateBuilder.references(opts)) if Hash === opts <add> def where!(opts, *rest) # :nodoc: <add> references!(PredicateBuilder.references(opts)) if Hash === opts <ide> <del> self.where_values += build_where(opts, rest) <del> self <del> end <add> self.where_values += build_where(opts, rest) <add> self <ide> end <ide> <ide> # Allows you to change a previously set where condition for a given attribute, instead of appending to that condition. <ide><path>activerecord/test/cases/relation/where_chain_test.rb <ide> def test_chaining_multiple <ide> assert_bound_ast value, Post.arel_table[@name], Arel::Nodes::NotEqual <ide> assert_equal 'ruby on rails', bind.last <ide> end <del> <add> <ide> def test_rewhere_with_one_condition <ide> relation = Post.where(title: 'hello').where(title: 'world').rewhere(title: 'alone') <ide>
2
Javascript
Javascript
remove console in euler
24f427a54b5dd312978c1e75cdd4262e076159c4
<ide><path>test/unit/math/Euler.js <ide> module( "Euler" ); <ide> var eulerZero = new THREE.Euler( 0, 0, 0, "XYZ" ); <ide> var eulerAxyz = new THREE.Euler( 1, 0, 0, "XYZ" ); <ide> var eulerAzyx = new THREE.Euler( 0, 1, 0, "ZYX" ); <del> <add> <ide> var matrixEquals4 = function( a, b, tolerance ) { <ide> tolerance = tolerance || 0.0001; <ide> if( a.elements.length != b.elements.length ) { <ide> var matrixEquals4 = function( a, b, tolerance ) { <ide> <ide> var eulerEquals = function( a, b, tolerance ) { <ide> tolerance = tolerance || 0.0001; <del> var diff = Math.abs( a.x - b.x ) + Math.abs( a.y - b.y ) + Math.abs( a.z - b.z ); <add> var diff = Math.abs( a.x - b.x ) + Math.abs( a.y - b.y ) + Math.abs( a.z - b.z ); <ide> return ( diff < tolerance ); <ide> }; <ide> <ide> <ide> var quatEquals = function( a, b, tolerance ) { <ide> tolerance = tolerance || 0.0001; <del> var diff = Math.abs( a.x - b.x ) + Math.abs( a.y - b.y ) + Math.abs( a.z - b.z ) + Math.abs( a.w - b.w ); <add> var diff = Math.abs( a.x - b.x ) + Math.abs( a.y - b.y ) + Math.abs( a.z - b.z ) + Math.abs( a.w - b.w ); <ide> return ( diff < tolerance ); <ide> }; <ide> <ide> test( "set/setFromVector3/toVector3", function() { <ide> var vec = new THREE.Vector3( 0, 1, 0 ); <ide> <ide> var b = new THREE.Euler().setFromVector3( vec, "ZYX" ); <del> console.log( a, b ); <ide> ok( a.equals( b ), "Passed!" ); <ide> <ide> var c = b.toVector3(); <del> console.log( c, vec ); <ide> ok( c.equals( vec ), "Passed!" ); <ide> }); <ide> <ide> test( "Quaternion.setFromEuler/Euler.fromQuaternion", function() { <ide> <ide> var v2 = new THREE.Euler().setFromQuaternion( q, v.order ); <ide> var q2 = new THREE.Quaternion().setFromEuler( v2 ); <del> ok( eulerEquals( q, q2 ), "Passed!" ); <add> ok( eulerEquals( q, q2 ), "Passed!" ); <ide> } <ide> }); <ide> <ide> test( "Matrix4.setFromEuler/Euler.fromRotationMatrix", function() { <ide> <ide> var v2 = new THREE.Euler().setFromRotationMatrix( m, v.order ); <ide> var m2 = new THREE.Matrix4().makeRotationFromEuler( v2 ); <del> ok( matrixEquals4( m, m2, 0.0001 ), "Passed!" ); <add> ok( matrixEquals4( m, m2, 0.0001 ), "Passed!" ); <ide> } <ide> }); <ide> <ide> test( "reorder", function() { <ide> var v = testValues[i]; <ide> var q = new THREE.Quaternion().setFromEuler( v ); <ide> <del> v.reorder( 'YZX' ); <add> v.reorder( 'YZX' ); <ide> var q2 = new THREE.Quaternion().setFromEuler( v ); <del> ok( quatEquals( q, q2 ), "Passed!" ); <add> ok( quatEquals( q, q2 ), "Passed!" ); <ide> <ide> v.reorder( 'ZXY' ); <ide> var q3 = new THREE.Quaternion().setFromEuler( v ); <del> ok( quatEquals( q, q3 ), "Passed!" ); <add> ok( quatEquals( q, q3 ), "Passed!" ); <ide> } <ide> }); <ide> <ide> test( "gimbalLocalQuat", function() { <ide> // the results here are different <ide> ok( eulerEquals( eViaQ1, eViaMViaQ1 ), "Passed!" ); // this result is correct <ide> <del>}); <ide>\ No newline at end of file <add>});
1
Text
Text
add example docs for a rexray plugin
5f713cecc5f65ea61db5b5362f26f96de9427eb0
<ide><path>docs/extend/EBS_volume.md <add>--- <add>description: Volume plugin for Amazon EBS <add>keywords: "API, Usage, plugins, documentation, developer, amazon, ebs, rexray, volume" <add>title: Volume plugin for Amazon EBS <add>--- <add> <add><!-- This file is maintained within the docker/docker Github <add> repository at https://github.com/docker/docker/. Make all <add> pull requests against that repo. If you see this file in <add> another repository, consider it read-only there, as it will <add> periodically be overwritten by the definitive file. Pull <add> requests which include edits to this file in other repositories <add> will be rejected. <add>--> <add> <add># A proof-of-concept Rexray plugin <add> <add>In this example, a simple Rexray plugin will be created for the purposes of using <add>it on an Amazon EC2 instance with EBS. It is not meant to be a complete Rexray plugin. <add> <add>The example source is available at [https://github.com/tiborvass/rexray-plugin](https://github.com/tiborvass/rexray-plugin). <add> <add>To learn more about Rexray: [https://github.com/codedellemc/rexray](https://github.com/codedellemc/rexray) <add> <add>## 1. Make a Docker image <add> <add>The following is the Dockerfile used to containerize rexray. <add> <add>```Dockerfile <add>FROM debian:jessie <add>RUN apt-get update && apt-get install -y --no-install-recommends wget ca-certificates <add>RUN wget https://dl.bintray.com/emccode/rexray/stable/0.6.4/rexray-Linux-x86_64-0.6.4.tar.gz -O rexray.tar.gz && tar -xvzf rexray.tar.gz -C /usr/bin && rm rexray.tar.gz <add>RUN mkdir -p /run/docker/plugins /var/lib/libstorage/volumes <add>ENTRYPOINT ["rexray"] <add>CMD ["--help"] <add>``` <add> <add>To build it you can run `image=$(cat Dockerfile | docker build -q -)` and `$image` <add>will reference the containerized rexray image. <add> <add>## 2. Extract rootfs <add> <add>```sh <add>$ TMPDIR=/tmp/rexray # for the purpose of this example <add>$ # create container without running it, to extract the rootfs from image <add>$ docker create --name rexray "$image" <add>$ # save the rootfs to a tar archive <add>$ docker export -o $TMPDIR/rexray.tar rexray <add>$ # extract rootfs from tar archive to a rootfs folder <add>$ ( mkdir -p $TMPDIR/rootfs; cd $TMPDIR/rootfs; tar xf ../rexray.tar ) <add>``` <add> <add>## 3. Add plugin configuration <add> <add>We have to put the following JSON to `$TMPDIR/config.json`: <add> <add>```json <add>{ <add> "Args": { <add> "Description": "", <add> "Name": "", <add> "Settable": null, <add> "Value": null <add> }, <add> "Description": "A proof-of-concept EBS plugin (using rexray) for Docker", <add> "Documentation": "https://github.com/tiborvass/rexray-plugin", <add> "Entrypoint": [ <add> "/usr/bin/rexray", "service", "start", "-f" <add> ], <add> "Env": [ <add> { <add> "Description": "", <add> "Name": "REXRAY_SERVICE", <add> "Settable": [ <add> "value" <add> ], <add> "Value": "ebs" <add> }, <add> { <add> "Description": "", <add> "Name": "EBS_ACCESSKEY", <add> "Settable": [ <add> "value" <add> ], <add> "Value": "" <add> }, <add> { <add> "Description": "", <add> "Name": "EBS_SECRETKEY", <add> "Settable": [ <add> "value" <add> ], <add> "Value": "" <add> } <add> ], <add> "Interface": { <add> "Socket": "rexray.sock", <add> "Types": [ <add> "docker.volumedriver/1.0" <add> ] <add> }, <add> "Linux": { <add> "AllowAllDevices": true, <add> "Capabilities": ["CAP_SYS_ADMIN"], <add> "Devices": null <add> }, <add> "Mounts": [ <add> { <add> "Source": "/dev", <add> "Destination": "/dev", <add> "Type": "bind", <add> "Options": ["rbind"] <add> } <add> ], <add> "Network": { <add> "Type": "host" <add> }, <add> "PropagatedMount": "/var/lib/libstorage/volumes", <add> "User": {}, <add> "WorkDir": "" <add>} <add>``` <add> <add>Please note a couple of points: <add>- `PropagatedMount` is needed so that the docker daemon can see mounts done by the <add>rexray plugin from within the container, otherwise the docker daemon is not able <add>to mount a docker volume. <add>- The rexray plugin needs dynamic access to host devices. For that reason, we <add>have to give it access to all devices under `/dev` and set `AllowAllDevices` to <add>true for proper access. <add>- The user of this simple plugin can change only 3 settings: `REXRAY_SERVICE`, <add>`EBS_ACCESSKEY` and `EBS_SECRETKEY`. This is because of the reduced scope of this <add>plugin. Ideally other rexray parameters could also be set. <add> <add>## 4. Create plugin <add> <add>`docker plugin create tiborvass/rexray-plugin "$TMPDIR"` will create the plugin. <add> <add>```sh <add>$ docker plugin ls <add>ID NAME DESCRIPTION ENABLED <add>2475a4bd0ca5 tiborvass/rexray-plugin:latest A rexray volume plugin for Docker false <add>``` <add> <add>## 5. Test plugin <add> <add>```sh <add>$ docker plugin set tiborvass/rexray-plugin EBS_ACCESSKEY=$AWS_ACCESSKEY EBS_SECRETKEY=$AWS_SECRETKEY` <add>$ docker plugin enable tiborvass/rexray-plugin <add>$ docker volume create -d tiborvass/rexray-plugin my-ebs-volume <add>$ docker volume ls <add>DRIVER VOLUME NAME <add>tiborvass/rexray-plugin:latest my-ebs-volume <add>$ docker run --rm -v my-ebs-volume:/volume busybox sh -c 'echo bye > /volume/hi' <add>$ docker run --rm -v my-ebs-volume:/volume busybox cat /volume/hi <add>bye <add>``` <add> <add>## 6. Push plugin <add> <add>First, ensure you are logged in with `docker login`. Then you can run: <add>`docker plugin push tiborvass/rexray-plugin` to push it like a regular docker <add>image to a registry, to make it available for others to install via <add>`docker plugin install tiborvass/rexray-plugin EBS_ACCESSKEY=$AWS_ACCESSKEY EBS_SECRETKEY=$AWS_SECRETKEY`. <ide><path>docs/extend/index.md <ide> This plugin is a volume driver. It requires a `host` network and the <ide> entrypoint and uses the `/run/docker/plugins/sshfs.sock` socket to communicate <ide> with Docker Engine. This plugin has no runtime parameters. <ide> <del>### Creating the plugin <add>#### Creating the plugin <ide> <ide> A new plugin can be created by running <ide> `docker plugin create <plugin-name> ./path/to/plugin/data` where the plugin <ide> in subdirectory `rootfs`. <ide> <ide> After that the plugin `<plugin-name>` will show up in `docker plugin ls`. <ide> Plugins can be pushed to remote registries with <del>`docker plugin push <plugin-name>`. <ide>\ No newline at end of file <add>`docker plugin push <plugin-name>`.
2
Javascript
Javascript
show error on jbig2 images
4616ee0ee8f392c3bdd98eea8835fc5acc966c0d
<ide><path>src/parser.js <ide> var Parser = (function ParserClosure() { <ide> if (name == 'RunLengthDecode') { <ide> return new RunLengthStream(stream); <ide> } <add> if (name == 'JBIG2Decode') { <add> error('JBIG2 image format is not currently supprted.'); <add> } <ide> warn('filter "' + name + '" not supported yet'); <ide> return stream; <ide> }
1
Ruby
Ruby
establish a convention for requirement names
71f85300b4da4a1e3bd161646a7cd91fb1436734
<ide><path>Library/Homebrew/dependency_collector.rb <ide> def parse_symbol_spec spec, tag <ide> Dependency.new(spec.to_s, tag) <ide> when :x11 then X11Dependency.new(spec.to_s, tag) <ide> when :xcode then XcodeDependency.new(tag) <del> when :mysql then MysqlInstalled.new(tag) <del> when :postgresql then PostgresqlInstalled.new(tag) <del> when :tex then TeXInstalled.new(tag) <add> when :mysql then MysqlDependency.new(tag) <add> when :postgresql then PostgresqlDependency.new(tag) <add> when :tex then TeXDependency.new(tag) <ide> when :clt then CLTDependency.new(tag) <ide> else <ide> raise "Unsupported special dependency #{spec}" <ide><path>Library/Homebrew/requirement.rb <ide> class Requirement <ide> def initialize(*tags) <ide> @tags = tags.flatten.compact <ide> @tags << :build if self.class.build <add> @name ||= infer_name <ide> end <ide> <ide> # The message to show when the requirement is not met. <ide> def hash <ide> <ide> private <ide> <add> def infer_name <add> klass = self.class.to_s <add> klass.sub!(/(Dependency|Requirement)$/, '') <add> klass.sub!(/^(\w+::){0,}/, '') <add> klass.downcase <add> end <add> <ide> def infer_env_modification(o) <ide> case o <ide> when Pathname <ide><path>Library/Homebrew/requirements.rb <ide> def message; <<-EOS.undent <ide> end <ide> end <ide> <del>class MysqlInstalled < Requirement <add>class MysqlDependency < Requirement <ide> fatal true <ide> <ide> satisfy { which 'mysql_config' } <ide> def message; <<-EOS.undent <ide> end <ide> end <ide> <del>class PostgresqlInstalled < Requirement <add>class PostgresqlDependency < Requirement <ide> fatal true <ide> <ide> satisfy { which 'pg_config' } <ide> def message <ide> end <ide> end <ide> <del>class TeXInstalled < Requirement <add>class TeXDependency < Requirement <ide> fatal true <ide> <ide> satisfy { which('tex') || which('latex') } <ide><path>Library/Homebrew/test/test_requirement.rb <ide> def test_dsl_build <ide> req = Class.new(Requirement) { build true }.new <ide> assert req.build? <ide> end <add> <add> def test_infer_name_from_class <add> klass, const = self.class, :FooRequirement <add> klass.const_set(const, Class.new(Requirement)) <add> assert_equal "foo", klass.const_get(const).new.name <add> ensure <add> klass.send(:remove_const, const) if klass.const_defined?(const) <add> end <ide> end
4
Ruby
Ruby
remove explicit file.expand_path call
b685095fc957a428fd86514d28a9183dbbdc3ab5
<ide><path>activesupport/lib/active_support/file_evented_update_checker.rb <ide> def base_directories <ide> end <ide> <ide> def existing_parent(dir) <del> dir = Pathname.new(File.expand_path(dir)) <add> dir = Pathname.new(expand_path(dir)) <ide> <ide> loop do <ide> if dir.directory?
1
Go
Go
show active driver in docker info output
062810caedba973e76a3dd7eb9e45b56511eefc6
<ide><path>api_params.go <ide> type APIInfo struct { <ide> Debug bool <ide> Containers int <ide> Images int <add> Driver string `json:",omitempty"` <ide> NFd int `json:",omitempty"` <ide> NGoroutines int `json:",omitempty"` <ide> MemoryLimit bool `json:",omitempty"` <ide><path>commands.go <ide> func (cli *DockerCli) CmdInfo(args ...string) error { <ide> <ide> fmt.Fprintf(cli.out, "Containers: %d\n", out.Containers) <ide> fmt.Fprintf(cli.out, "Images: %d\n", out.Images) <add> fmt.Fprintf(cli.out, "Driver: %s\n", out.Driver) <ide> if out.Debug || os.Getenv("DEBUG") != "" { <ide> fmt.Fprintf(cli.out, "Debug mode (server): %v\n", out.Debug) <ide> fmt.Fprintf(cli.out, "Debug mode (client): %v\n", os.Getenv("DEBUG") != "") <ide><path>graphdriver/driver.go <ide> import ( <ide> type InitFunc func(root string) (Driver, error) <ide> <ide> type Driver interface { <add> String() string <add> <ide> Create(id, parent string) error <ide> Remove(id string) error <ide> <ide><path>server.go <ide> func (srv *Server) DockerInfo() *APIInfo { <ide> return &APIInfo{ <ide> Containers: len(srv.runtime.List()), <ide> Images: imgcount, <add> Driver: srv.runtime.driver.String(), <ide> MemoryLimit: srv.runtime.capabilities.MemoryLimit, <ide> SwapLimit: srv.runtime.capabilities.SwapLimit, <ide> IPv4Forwarding: !srv.runtime.capabilities.IPv4ForwardingDisabled,
4
PHP
PHP
remove exception coercion
dc0da6e015b2f554c2a314a06ae080b5dd4bb308
<ide><path>src/Error/ExceptionRenderer.php <ide> class ExceptionRenderer { <ide> * @param \Exception $exception Exception <ide> */ <ide> public function __construct(\Exception $exception) { <del> if (!Configure::read('debug') && !($exception instanceof Error\HttpException)) { <del> $code = $this->_code($exception); <del> if ($code < 500) { <del> $exception = new Error\NotFoundException(); <del> } else { <del> $exception = new Error\InternalErrorException(); <del> } <del> } <del> <ide> $this->controller = $this->_getController($exception); <ide> $this->error = $exception; <ide> } <ide> public function render() { <ide> $exception = $this->error; <ide> $code = $this->_code($exception); <ide> $template = $this->_template($exception, $code); <del> $message = $this->error->getMessage(); <add> $message = $this->_message($exception, $code); <ide> $url = $this->controller->request->here(); <ide> <ide> $this->controller->response->statusCode($code); <ide> public function render() { <ide> } <ide> <ide> /** <del> * Get template for rendering exception info <add> * Get error message. <add> * <add> * @param Exception $exception Exception <add> * @param int $code Error code <add> * @return string Error message <add> */ <add> protected function _message(\Exception $exception, $code) { <add> $message = $this->error->getMessage(); <add> <add> if (!Configure::read('debug') && <add> !($exception instanceof Error\HttpException) <add> ) { <add> if ($code < 500) { <add> $message = __d('cake', 'Not Found'); <add> } else { <add> $message = __d('cake', 'An Internal Error Has Occurred.'); <add> } <add> } <add> <add> return $message; <add> } <add> <add>/** <add> * Get template for rendering exception info. <add> * <ide> * @param \Exception $exception <ide> * @param int $code Error code <ide> * @return string Template name <ide> */ <ide> protected function _template(\Exception $exception, $code) { <add> if (!Configure::read('debug') && <add> !($exception instanceof Error\HttpException) <add> ) { <add> $template = 'error500'; <add> if ($code < 500) { <add> $template = 'error400'; <add> } <add> return $this->template = $template; <add> } <add> <ide> list(, $baseClass) = namespaceSplit(get_class($exception)); <ide> $baseClass = substr($baseClass, 0, -9); <ide> $template = Inflector::variable($baseClass); <ide><path>tests/TestCase/Error/ExceptionRendererTest.php <ide> public function testConstruction() { <ide> } <ide> <ide> /** <del> * test that exception gets coerced when debug = 0 <add> * test that exception message gets coerced when debug = 0 <ide> * <ide> * @return void <ide> */ <del> public function testExceptionCoercion() { <add> public function testExceptionMessageCoercion() { <ide> Configure::write('debug', false); <del> $exception = new MissingActionException('Page not found'); <add> $exception = new MissingActionException('Secret info not to be leaked'); <ide> $ExceptionRenderer = new ExceptionRenderer($exception); <ide> <ide> $this->assertInstanceOf('Cake\Controller\ErrorController', $ExceptionRenderer->controller); <del> $this->assertTrue($ExceptionRenderer->error instanceof Error\NotFoundException); <add> $this->assertEquals($exception, $ExceptionRenderer->error); <add> <add> ob_start(); <add> $ExceptionRenderer->render(); <add> $result = ob_get_clean(); <add> <add> $this->assertEquals('error400', $ExceptionRenderer->template); <add> $this->assertContains('Not Found', $result); <add> $this->assertNotContains('Secret info not to be leaked', $result); <ide> } <ide> <ide> /**
2
Javascript
Javascript
fix lint error
fe8fe0ff0d4e79066921377fd94f10986918ccc1
<ide><path>server/boot/randomAPIs.js <ide> module.exports = function(app) { <ide> router.get('/stories', showTestimonials); <ide> router.get('/all-stories', showAllTestimonials); <ide> router.get('/links', showLinks); <del> router.get('/the-fastest-web-page-on-the-internet', theFastestWebPageOnTheInternet); <add> router.get( <add> '/the-fastest-web-page-on-the-internet', <add> theFastestWebPageOnTheInternet <add> ); <ide> <ide> app.use(router); <ide>
1
Javascript
Javascript
avoid usage of mixed ipv6 addresses
17883dfaafd9ffa257cefc30f37bdbd7bfa023d0
<ide><path>test/parallel/test-cluster-disconnect-handles.js <ide> if (cluster.isMaster) { <ide> debugger; <ide> }; <ide> if (common.hasIPv6) <del> server.listen(cb); <add> server.listen(0, '::1', cb); <ide> else <ide> server.listen(0, common.localhostIPv4, cb); <ide> process.on('disconnect', process.exit);
1
Text
Text
update dead link
ab19bc641ca2cd6b4dc7d408bbb8df29432c07d4
<ide><path>share/doc/homebrew/El_Capitan_and_Homebrew.md <ide> SIP prevents you from writing to many system directories such as `/usr`, `/Syste <ide> <ide> One of the implications of SIP is that you cannot simply create `/usr/local` if it is removed or doesn't exist for another reason. However, as noted in the keynote, Apple is leaving `/usr/local` open for developers to use, so Homebrew can still be used as expected. <ide> <del>Apple documentation hints that `/usr/local` will be returned to `root:wheel restricted` permissions on [every OS X update](https://developer.apple.com/library/prerelease/mac/releasenotes/General/rn-osx-10.11/); Homebrew will be adding a `brew doctor` check to warn you when this happens in the near future. <add>Apple documentation *hints* that `/usr/local` will be returned to `root:wheel restricted` permissions on [every OS X update](https://developer.apple.com/library/mac/releasenotes/General/rn-osx-10.11/index.html). There is a `brew doctor` check in place to advise if permissions have slipped for whatever reason. <ide> <del>If you haven't installed Homebrew in `/usr/local` or another system-protected directory, none of these concerns apply to you. <add>**If you haven't installed Homebrew in `/usr/local` or another system-protected directory, this document does not apply to you.** <ide> <ide> This is how to fix Homebrew on El Capitan if you see permission issues: <ide>
1
PHP
PHP
add more classes in the rename classes task
c008812c343028f9e05f84a9046ad9cda8129f36
<ide><path>lib/Cake/Console/Command/UpgradeShell.php <ide> protected function _renameClasses($path, $dryRun) { <ide> 'Cake\Network\Http\HttpSocket' => 'Cake\Network\Http\Client', <ide> 'HttpSocket' => 'Client', <ide> 'Cake\Model\ConnectionManager' => 'Cake\Database\ConnectionManager', <add> 'Cake\Configure\ConfigReaderInterface' => 'Cake\Configure\ConfigEngineInterface', <add> 'ConfigReaderInterface' => 'ConfigEngineInterface', <add> 'Cake\Configure\PhpReader' => 'Cake\Configure\Engine\PhpConfig', <add> 'PhpReader' => 'PhpConfig', <add> 'Cake\Configure\IniReader' => 'Cake\Configure\Engine\IniConfig', <add> 'IniReader' => 'IniConfig', <ide> ]; <ide> $contents = file_get_contents($path); <ide> $contents = str_replace(
1
Javascript
Javascript
clarify return value if no cookie exist
8a433f3cc583220da32d5fd3032bfbb52ebde84d
<ide><path>src/ngCookies/cookies.js <ide> angular.module('ngCookies', ['ng']). <ide> * Returns the value of given cookie key <ide> * <ide> * @param {string} key Id to use for lookup. <del> * @returns {Object} Deserialized cookie value. <add> * @returns {Object} Deserialized cookie value, undefined if the cookie does not exist. <ide> */ <ide> get: function(key) { <ide> var value = $cookies[key];
1
Javascript
Javascript
pass request to .createconnection()
53716eb0b5338999761d115fad9d392077836e63
<ide><path>lib/http.js <ide> Agent.prototype.addRequest = function(req, host, port, localAddress) { <ide> } <ide> if (this.sockets[name].length < this.maxSockets) { <ide> // If we are under maxSockets create a new one. <del> req.onSocket(this.createSocket(name, host, port, localAddress)); <add> req.onSocket(this.createSocket(name, host, port, localAddress, req)); <ide> } else { <ide> // We are over limit so we'll add it to the queue. <ide> if (!this.requests[name]) { <ide> Agent.prototype.addRequest = function(req, host, port, localAddress) { <ide> this.requests[name].push(req); <ide> } <ide> }; <del>Agent.prototype.createSocket = function(name, host, port, localAddress) { <add>Agent.prototype.createSocket = function(name, host, port, localAddress, req) { <ide> var self = this; <ide> var options = util._extend({}, self.options); <ide> options.port = port; <ide> options.host = host; <ide> options.localAddress = localAddress; <del> var s = self.createConnection(options); <add> var s = self.createConnection.call(req, options); <ide> if (!self.sockets[name]) { <ide> self.sockets[name] = []; <ide> } <ide> Agent.prototype.removeSocket = function(s, name, host, port, localAddress) { <ide> } <ide> if (this.requests[name] && this.requests[name].length) { <ide> // If we have pending requests and a socket gets closed a new one <del> this.createSocket(name, host, port, localAddress).emit('free'); <add> this.createSocket( <add> name, <add> host, <add> port, <add> localAddress, <add> this.requests[name][0] <add> ).emit('free'); <ide> } <ide> }; <ide> <ide> function ClientRequest(options, cb) { <ide> var self = this; <ide> OutgoingMessage.call(self); <ide> <add> this.options = options; <ide> self.agent = options.agent === undefined ? globalAgent : options.agent; <ide> <ide> var defaultPort = options.defaultPort || 80; <ide> function ClientRequest(options, cb) { <ide> self._last = true; <ide> self.shouldKeepAlive = false; <ide> if (options.createConnection) { <del> self.onSocket(options.createConnection(self.socketPath)); <add> self.onSocket(options.createConnection.call(self, self.socketPath)); <ide> } else { <ide> self.onSocket(net.createConnection(self.socketPath)); <ide> } <ide> function ClientRequest(options, cb) { <ide> if (options.createConnection) { <ide> options.port = port; <ide> options.host = host; <del> var conn = options.createConnection(options); <add> var conn = options.createConnection.call(self, options); <ide> } else { <ide> var conn = net.createConnection({ <ide> port: port, <ide><path>lib/https.js <ide> <ide> var tls = require('tls'); <ide> var http = require('http'); <del>var inherits = require('util').inherits; <add>var util = require('util'); <add>var inherits = util.inherits; <ide> <ide> function Server(opts, requestListener) { <ide> if (!(this instanceof Server)) return new Server(opts, requestListener); <ide> exports.createServer = function(opts, requestListener) { <ide> // HTTPS agents. <ide> <ide> function createConnection(/* [port, host, options] */) { <del> var options = {}; <add> var options = util._extend({}, this.options); <ide> <ide> if (typeof arguments[0] === 'object') { <del> options = arguments[0]; <add> options = util._extend(options, arguments[0]); <ide> } else if (typeof arguments[1] === 'object') { <del> options = arguments[1]; <add> options = util._extend(options, arguments[1]); <ide> options.port = arguments[0]; <ide> } else if (typeof arguments[2] === 'object') { <del> options = arguments[2]; <add> options = util._extend(options, arguments[2]); <ide> options.port = arguments[0]; <ide> options.host = arguments[1]; <ide> } else {
2
Javascript
Javascript
keep challengefile order on update
2952f9399d3cf2601aba4120f14030dccf102391
<ide><path>client/src/templates/Challenges/redux/index.js <ide> export const reducer = handleActions( <ide> ); <ide> return { <ide> ...state, <del> challengeFiles: [ <del> ...state.challengeFiles.filter(x => x.fileKey !== fileKey), <del> { <del> ...state.challengeFiles.find(x => x.fileKey === fileKey), <del> ...updates <del> } <del> ] <add> challengeFiles: state.challengeFiles.map(challengeFile => <add> challengeFile.fileKey === fileKey <add> ? { ...challengeFile, ...updates } <add> : { ...challengeFile } <add> ) <ide> }; <ide> }, <ide> [actionTypes.storedCodeFound]: (state, { payload }) => ({
1
PHP
PHP
use proper method visibility
222800c2658647619ed9cbf608faaae277a1c8a1
<ide><path>tests/Auth/AuthDatabaseTokenRepositoryTest.php <ide> <ide> class AuthDatabaseTokenRepositoryTest extends TestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide> Carbon::setTestNow(Carbon::now()); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> parent::tearDown(); <ide> <ide><path>tests/Auth/AuthDatabaseUserProviderTest.php <ide> <ide> class AuthDatabaseUserProviderTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Auth/AuthEloquentUserProviderTest.php <ide> <ide> class AuthEloquentUserProviderTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Auth/AuthGuardTest.php <ide> <ide> class AuthGuardTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Auth/AuthPasswordBrokerTest.php <ide> <ide> class AuthPasswordBrokerTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Auth/AuthenticateMiddlewareTest.php <ide> class AuthenticateMiddlewareTest extends TestCase <ide> { <ide> protected $auth; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $container = Container::setInstance(new Container); <ide> <ide> public function setUp(): void <ide> }); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Auth/AuthorizeMiddlewareTest.php <ide> class AuthorizeMiddlewareTest extends TestCase <ide> protected $user; <ide> protected $router; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide> public function setUp(): void <ide> }); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Broadcasting/BroadcastEventTest.php <ide> <ide> class BroadcastEventTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Broadcasting/BroadcasterTest.php <ide> class BroadcasterTest extends TestCase <ide> */ <ide> public $broadcaster; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide> $this->broadcaster = new FakeBroadcaster; <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Broadcasting/PusherBroadcasterTest.php <ide> class PusherBroadcasterTest extends TestCase <ide> <ide> public $pusher; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Broadcasting/RedisBroadcasterTest.php <ide> class RedisBroadcasterTest extends TestCase <ide> */ <ide> public $broadcaster; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide> $this->broadcaster = m::mock(RedisBroadcaster::class)->makePartial(); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Broadcasting/UsePusherChannelsNamesTest.php <ide> class UsePusherChannelConventionsTest extends TestCase <ide> */ <ide> public $broadcaster; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide> $this->broadcaster = new FakeBroadcasterUsingPusherChannelsNames(); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Bus/BusDispatcherTest.php <ide> <ide> class BusDispatcherTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Cache/CacheDatabaseStoreTest.php <ide> <ide> class CacheDatabaseStoreTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Cache/CacheEventsTest.php <ide> <ide> class CacheEventsTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Cache/CacheFileStoreTest.php <ide> <ide> class CacheFileStoreTest extends TestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide> Carbon::setTestNow(Carbon::now()); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> parent::tearDown(); <ide> <ide><path>tests/Cache/CacheManagerTest.php <ide> <ide> class CacheManagerTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Cache/CacheMemcachedConnectorTest.php <ide> <ide> class CacheMemcachedConnectorTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Cache/CacheRateLimiterTest.php <ide> <ide> class CacheRateLimiterTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Cache/CacheRedisStoreTest.php <ide> <ide> class CacheRedisStoreTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Cache/CacheTableCommandTest.php <ide> <ide> class CacheTableCommandTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Cache/CacheTaggedCacheTest.php <ide> <ide> class CacheTaggedCacheTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Cache/ClearCommandTest.php <ide> protected function setUp(): void <ide> $this->command->setLaravel($app); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Cache/RedisCacheIntegrationTest.php <ide> class RedisCacheIntegrationTest extends TestCase <ide> { <ide> use InteractsWithRedis; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> $this->setUpRedis(); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> parent::tearDown(); <ide> m::close(); <ide><path>tests/Console/ConsoleApplicationTest.php <ide> <ide> class ConsoleApplicationTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Console/ConsoleEventSchedulerTest.php <ide> class ConsoleEventSchedulerTest extends TestCase <ide> */ <ide> private $schedule; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide> public function setUp(): void <ide> $container->instance(Schedule::class, $this->schedule = new Schedule(m::mock(EventMutex::class))); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Console/ConsoleScheduledEventTest.php <ide> class ConsoleScheduledEventTest extends TestCase <ide> */ <ide> protected $defaultTimezone; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $this->defaultTimezone = date_default_timezone_get(); <ide> date_default_timezone_set('UTC'); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> date_default_timezone_set($this->defaultTimezone); <ide> Carbon::setTestNow(null); <ide><path>tests/Console/Scheduling/CacheEventMutexTest.php <ide> class CacheEventMutexTest extends TestCase <ide> */ <ide> protected $cacheRepository; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Console/Scheduling/CacheSchedulingMutexTest.php <ide> class CacheSchedulingMutexTest extends TestCase <ide> */ <ide> protected $cacheRepository; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Console/Scheduling/EventTest.php <ide> <ide> class EventTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Console/Scheduling/FrequencyTest.php <ide> class FrequencyTest extends TestCase <ide> */ <ide> protected $event; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $this->event = new Event( <ide> m::mock(EventMutex::class), <ide><path>tests/Cookie/CookieTest.php <ide> <ide> class CookieTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Cookie/Middleware/EncryptCookiesTest.php <ide> class EncryptCookiesTest extends TestCase <ide> protected $setCookiePath = 'cookie/set'; <ide> protected $queueCookiePath = 'cookie/queue'; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Database/DatabaseConnectionFactoryTest.php <ide> class DatabaseConnectionFactoryTest extends TestCase <ide> { <ide> protected $db; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $this->db = new DB; <ide> <ide> public function setUp(): void <ide> $this->db->setAsGlobal(); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseConnectionTest.php <ide> <ide> class DatabaseConnectionTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseConnectorTest.php <ide> <ide> class DatabaseConnectorTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseEloquentBelongsToManyChunkByIdTest.php <ide> <ide> class DatabaseEloquentBelongsToManyChunkByIdTest extends TestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $db = new DB; <ide> <ide> public function testBelongsToChunkById() <ide> * <ide> * @return void <ide> */ <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> $this->schema()->drop('users'); <ide> $this->schema()->drop('articles'); <ide><path>tests/Database/DatabaseEloquentBelongsToManySyncReturnValueTypeTest.php <ide> <ide> class DatabaseEloquentBelongsToManySyncReturnValueTypeTest extends TestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $db = new DB; <ide> <ide> public function createSchema() <ide> * <ide> * @return void <ide> */ <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> $this->schema()->drop('users'); <ide> $this->schema()->drop('articles'); <ide><path>tests/Database/DatabaseEloquentBelongsToManyWithDefaultAttributesTest.php <ide> <ide> class DatabaseEloquentBelongsToManyWithDefaultAttributesTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseEloquentBelongsToTest.php <ide> class DatabaseEloquentBelongsToTest extends TestCase <ide> <ide> protected $related; <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseEloquentBuilderTest.php <ide> <ide> class DatabaseEloquentBuilderTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseEloquentCastsDatabaseStringTest.php <ide> <ide> class DatabaseEloquentCastsDatabaseStringTest extends TestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $db = new DB; <ide> <ide> public function createSchema() <ide> * <ide> * @return void <ide> */ <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> $this->schema()->drop('casting_table'); <ide> } <ide><path>tests/Database/DatabaseEloquentCollectionQueueableTest.php <ide> <ide> class DatabaseEloquentCollectionQueueableTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> Mockery::close(); <ide> } <ide><path>tests/Database/DatabaseEloquentCollectionTest.php <ide> <ide> class DatabaseEloquentCollectionTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseEloquentGlobalScopesTest.php <ide> <ide> class DatabaseEloquentGlobalScopesTest extends TestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide> public function setUp(): void <ide> ])->bootEloquent(); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> <ide><path>tests/Database/DatabaseEloquentHasManyTest.php <ide> <ide> class DatabaseEloquentHasManyTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseEloquentHasManyThroughIntegrationTest.php <ide> <ide> class DatabaseEloquentHasManyThroughIntegrationTest extends TestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $db = new DB; <ide> <ide> public function createSchema() <ide> * <ide> * @return void <ide> */ <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> $this->schema()->drop('users'); <ide> $this->schema()->drop('posts'); <ide><path>tests/Database/DatabaseEloquentHasOneTest.php <ide> class DatabaseEloquentHasOneTest extends TestCase <ide> <ide> protected $parent; <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseEloquentHasOneThroughIntegrationTest.php <ide> <ide> class DatabaseEloquentHasOneThroughIntegrationTest extends TestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $db = new DB; <ide> <ide> public function createSchema() <ide> * <ide> * @return void <ide> */ <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> $this->schema()->drop('users'); <ide> $this->schema()->drop('contracts'); <ide><path>tests/Database/DatabaseEloquentIntegrationTest.php <ide> class DatabaseEloquentIntegrationTest extends TestCase <ide> * <ide> * @return void <ide> */ <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $db = new DB; <ide> <ide> protected function createSchema() <ide> * <ide> * @return void <ide> */ <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> foreach (['default', 'second_connection'] as $connection) { <ide> $this->schema($connection)->drop('users'); <ide><path>tests/Database/DatabaseEloquentIntegrationWithTablePrefixTest.php <ide> class DatabaseEloquentIntegrationWithTablePrefixTest extends TestCase <ide> * <ide> * @return void <ide> */ <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $db = new DB; <ide> <ide> protected function createSchema() <ide> * <ide> * @return void <ide> */ <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> foreach (['default'] as $connection) { <ide> $this->schema($connection)->drop('users'); <ide><path>tests/Database/DatabaseEloquentIrregularPluralTest.php <ide> <ide> class DatabaseEloquentIrregularPluralTest extends TestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $db = new DB; <ide> <ide> public function createSchema() <ide> }); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> $this->schema()->drop('irregular_plural_tokens'); <ide> $this->schema()->drop('irregular_plural_humans'); <ide><path>tests/Database/DatabaseEloquentModelTest.php <ide> class DatabaseEloquentModelTest extends TestCase <ide> { <ide> use InteractsWithTime; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide> Carbon::setTestNow(Carbon::now()); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> parent::tearDown(); <ide> <ide><path>tests/Database/DatabaseEloquentMorphTest.php <ide> <ide> class DatabaseEloquentMorphTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> Relation::morphMap([], false); <ide> <ide><path>tests/Database/DatabaseEloquentMorphToManyTest.php <ide> <ide> class DatabaseEloquentMorphToManyTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseEloquentMorphToTest.php <ide> class DatabaseEloquentMorphToTest extends TestCase <ide> <ide> protected $related; <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseEloquentPivotTest.php <ide> <ide> class DatabaseEloquentPivotTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseEloquentPolymorphicIntegrationTest.php <ide> <ide> class DatabaseEloquentPolymorphicIntegrationTest extends TestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $db = new DB; <ide> <ide> public function createSchema() <ide> * <ide> * @return void <ide> */ <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> $this->schema()->drop('users'); <ide> $this->schema()->drop('posts'); <ide><path>tests/Database/DatabaseEloquentPolymorphicRelationsIntegrationTest.php <ide> class DatabaseEloquentPolymorphicRelationsIntegrationTest extends TestCase <ide> * <ide> * @return void <ide> */ <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $db = new DB; <ide> <ide> protected function createSchema() <ide> * <ide> * @return void <ide> */ <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> foreach (['default'] as $connection) { <ide> $this->schema($connection)->drop('posts'); <ide><path>tests/Database/DatabaseEloquentRelationTest.php <ide> <ide> class DatabaseEloquentRelationTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseEloquentSoftDeletesIntegrationTest.php <ide> <ide> class DatabaseEloquentSoftDeletesIntegrationTest extends TestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> Carbon::setTestNow(Carbon::now()); <ide> <ide> public function createSchema() <ide> * <ide> * @return void <ide> */ <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> Carbon::setTestNow(null); <ide> <ide><path>tests/Database/DatabaseEloquentTimestampsTest.php <ide> <ide> class DatabaseEloquentTimestampsTest extends TestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $db = new DB; <ide> <ide> public function createSchema() <ide> * <ide> * @return void <ide> */ <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> $this->schema()->drop('users'); <ide> $this->schema()->drop('users_created_at'); <ide><path>tests/Database/DatabaseMigrationCreatorTest.php <ide> <ide> class DatabaseMigrationCreatorTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseMigrationInstallCommandTest.php <ide> <ide> class DatabaseMigrationInstallCommandTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseMigrationMakeCommandTest.php <ide> <ide> class DatabaseMigrationMakeCommandTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseMigrationMigrateCommandTest.php <ide> <ide> class DatabaseMigrationMigrateCommandTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseMigrationRefreshCommandTest.php <ide> <ide> class DatabaseMigrationRefreshCommandTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseMigrationRepositoryTest.php <ide> <ide> class DatabaseMigrationRepositoryTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseMigrationResetCommandTest.php <ide> <ide> class DatabaseMigrationResetCommandTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseMigrationRollbackCommandTest.php <ide> <ide> class DatabaseMigrationRollbackCommandTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseMigratorIntegrationTest.php <ide> class DatabaseMigratorIntegrationTest extends TestCase <ide> * <ide> * @return void <ide> */ <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $this->db = $db = new DB; <ide> <ide> public function setUp(): void <ide> } <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> Facade::clearResolvedInstances(); <ide> Facade::setFacadeApplication(null); <ide><path>tests/Database/DatabaseMySqlSchemaGrammarTest.php <ide> <ide> class DatabaseMySqlSchemaGrammarTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabasePostgresSchemaGrammarTest.php <ide> <ide> class DatabasePostgresSchemaGrammarTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseProcessorTest.php <ide> <ide> class DatabaseProcessorTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseQueryBuilderTest.php <ide> <ide> class DatabaseQueryBuilderTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseSQLiteSchemaGrammarTest.php <ide> <ide> class DatabaseSQLiteSchemaGrammarTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseSchemaBlueprintIntegrationTest.php <ide> class DatabaseSchemaBlueprintIntegrationTest extends TestCase <ide> * <ide> * @return void <ide> */ <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $this->db = $db = new DB; <ide> <ide> public function setUp(): void <ide> Facade::setFacadeApplication($container); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> Facade::clearResolvedInstances(); <ide> Facade::setFacadeApplication(null); <ide><path>tests/Database/DatabaseSchemaBlueprintTest.php <ide> <ide> class DatabaseSchemaBlueprintTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseSchemaBuilderIntegrationTest.php <ide> class DatabaseSchemaBuilderIntegrationTest extends TestCase <ide> * <ide> * @return void <ide> */ <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $this->db = $db = new DB; <ide> <ide> public function setUp(): void <ide> Facade::setFacadeApplication($container); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> Facade::clearResolvedInstances(); <ide> Facade::setFacadeApplication(null); <ide><path>tests/Database/DatabaseSchemaBuilderTest.php <ide> <ide> class DatabaseSchemaBuilderTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseSeederTest.php <ide> public function run(Mock $someDependency) <ide> <ide> class DatabaseSeederTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseSoftDeletingScopeTest.php <ide> <ide> class DatabaseSoftDeletingScopeTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseSoftDeletingTraitTest.php <ide> <ide> class DatabaseSoftDeletingTraitTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Database/DatabaseSqlServerSchemaGrammarTest.php <ide> <ide> class DatabaseSqlServerSchemaGrammarTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Events/EventsDispatcherTest.php <ide> <ide> class EventsDispatcherTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Filesystem/FilesystemAdapterTest.php <ide> class FilesystemAdapterTest extends TestCase <ide> private $tempDir; <ide> private $filesystem; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $this->tempDir = __DIR__.'/tmp'; <ide> $this->filesystem = new Filesystem(new Local($this->tempDir)); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> $filesystem = new Filesystem(new Local(dirname($this->tempDir))); <ide> $filesystem->deleteDir(basename($this->tempDir)); <ide><path>tests/Filesystem/FilesystemTest.php <ide> class FilesystemTest extends TestCase <ide> { <ide> private $tempDir; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $this->tempDir = __DIR__.'/tmp'; <ide> mkdir($this->tempDir); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> <ide><path>tests/Foundation/Bootstrap/LoadEnvironmentVariablesTest.php <ide> <ide> class LoadEnvironmentVariablesTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Foundation/FoundationApplicationTest.php <ide> <ide> class FoundationApplicationTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Foundation/FoundationAuthenticationTest.php <ide> protected function mockGuard() <ide> return $guard; <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Foundation/FoundationComposerTest.php <ide> <ide> class FoundationComposerTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Foundation/FoundationEnvironmentDetectorTest.php <ide> <ide> class FoundationEnvironmentDetectorTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Foundation/FoundationExceptionsHandlerTest.php <ide> class FoundationExceptionsHandlerTest extends TestCase <ide> <ide> protected $request; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $this->config = m::mock(Config::class); <ide> <ide> public function setUp(): void <ide> $this->handler = new Handler($this->container); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Foundation/FoundationFormRequestTest.php <ide> class FoundationFormRequestTest extends TestCase <ide> { <ide> protected $mocks = []; <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> <ide><path>tests/Foundation/FoundationHelpersTest.php <ide> <ide> class FoundationHelpersTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Foundation/FoundationInteractsWithDatabaseTest.php <ide> class FoundationInteractsWithDatabaseTest extends TestCase <ide> <ide> protected $connection; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $this->connection = m::mock(Connection::class); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Foundation/FoundationProviderRepositoryTest.php <ide> <ide> class FoundationProviderRepositoryTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Foundation/Http/Middleware/CheckForMaintenanceModeTest.php <ide> class CheckForMaintenanceModeTest extends TestCase <ide> */ <ide> protected $files; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> if (is_null($this->files)) { <ide> $this->files = new Filesystem; <ide> public function setUp(): void <ide> $this->files->makeDirectory($this->storagePath.'/framework', 0755, true); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> $this->files->deleteDirectory($this->storagePath); <ide> <ide><path>tests/Http/HttpRedirectResponseTest.php <ide> <ide> class HttpRedirectResponseTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Http/HttpRequestTest.php <ide> <ide> class HttpRequestTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Http/HttpResponseTest.php <ide> <ide> class HttpResponseTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Integration/Auth/AuthenticationTest.php <ide> protected function getEnvironmentSetUp($app) <ide> $app['config']->set('hashing', ['driver' => 'bcrypt']); <ide> } <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Cache/DynamoDbStoreTest.php <ide> */ <ide> class DynamoDbStoreTest extends TestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Cache/MemcachedIntegrationTest.php <ide> */ <ide> abstract class MemcachedIntegrationTest extends TestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Cache/RedisCacheLockTest.php <ide> class RedisCacheLockTest extends TestCase <ide> { <ide> use InteractsWithRedis; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide> $this->setUpRedis(); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> parent::tearDown(); <ide> <ide><path>tests/Integration/Database/EloquentBelongsToManyTest.php <ide> */ <ide> class EloquentBelongsToManyTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentBelongsToTest.php <ide> */ <ide> class EloquentBelongsToTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentCollectionFreshTest.php <ide> */ <ide> class EloquentCollectionFreshTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentCollectionLoadCountTest.php <ide> */ <ide> class EloquentCollectionLoadCountTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentCollectionLoadMissingTest.php <ide> */ <ide> class EloquentCollectionLoadMissingTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentCustomPivotCastTest.php <ide> */ <ide> class EloquentCustomPivotCastTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentDeleteTest.php <ide> protected function getEnvironmentSetUp($app) <ide> ]); <ide> } <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentFactoryBuilderTest.php <ide> protected function getEnvironmentSetUp($app) <ide> }); <ide> } <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentHasManyThroughTest.php <ide> */ <ide> class EloquentHasManyThroughTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentLazyEagerLoadingTest.php <ide> */ <ide> class EloquentLazyEagerLoadingTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentModelConnectionsTest.php <ide> protected function getEnvironmentSetUp($app) <ide> ]); <ide> } <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentModelCustomEventsTest.php <ide> */ <ide> class EloquentModelCustomEventsTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentModelDateCastingTest.php <ide> */ <ide> class EloquentModelDateCastingTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentModelDecimalCastingTest.php <ide> */ <ide> class EloquentModelDecimalCastingTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentModelJsonCastingTest.php <ide> */ <ide> class EloquentModelJsonCastingTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentModelLoadCountTest.php <ide> */ <ide> class EloquentModelLoadCountTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentModelLoadMissingTest.php <ide> */ <ide> class EloquentModelLoadMissingTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentModelRefreshTest.php <ide> */ <ide> class EloquentModelRefreshTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentModelTest.php <ide> */ <ide> class EloquentModelTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentMorphManyTest.php <ide> */ <ide> class EloquentMorphManyTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentMorphToGlobalScopesTest.php <ide> */ <ide> class EloquentMorphToGlobalScopesTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentMorphToLazyEagerLoadingTest.php <ide> */ <ide> class EloquentMorphToLazyEagerLoadingTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentMorphToSelectTest.php <ide> */ <ide> class EloquentMorphToSelectTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentMorphToTouchesTest.php <ide> */ <ide> class EloquentMorphToTouchesTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentPaginateTest.php <ide> */ <ide> class EloquentPaginateTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentPivotSerializationTest.php <ide> */ <ide> class EloquentPivotSerializationTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentPushTest.php <ide> */ <ide> class EloquentPushTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentTouchParentWithGlobalScopeTest.php <ide> */ <ide> class EloquentTouchParentWithGlobalScopeTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentUpdateTest.php <ide> protected function getEnvironmentSetUp($app) <ide> ]); <ide> } <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentWhereHasTest.php <ide> */ <ide> class EloquentWhereHasTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentWhereTest.php <ide> */ <ide> class EloquentWhereTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/EloquentWithCountTest.php <ide> */ <ide> class EloquentWithCountTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Database/QueryBuilderTest.php <ide> */ <ide> class QueryBuilderTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Foundation/Testing/Concerns/InteractsWithAuthenticationTest.php <ide> protected function getEnvironmentSetUp($app) <ide> ]); <ide> } <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Http/Middleware/VerifyCsrfTokenExceptTest.php <ide> class VerifyCsrfTokenExceptTest extends TestCase <ide> private $stub; <ide> private $request; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Http/ThrottleRequestsTest.php <ide> */ <ide> class ThrottleRequestsTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> parent::tearDown(); <ide> Carbon::setTestNow(null); <ide><path>tests/Integration/Http/ThrottleRequestsWithRedisTest.php <ide> class ThrottleRequestsWithRedisTest extends TestCase <ide> { <ide> use InteractsWithRedis; <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> parent::tearDown(); <ide> Carbon::setTestNow(null); <ide><path>tests/Integration/Mail/SendingMailWithLocaleTest.php <ide> */ <ide> class SendingMailWithLocaleTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> parent::tearDown(); <ide> <ide> protected function getEnvironmentSetUp($app) <ide> ]); <ide> } <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> } <ide><path>tests/Integration/Notifications/SendingMailNotificationsTest.php <ide> class SendingMailNotificationsTest extends TestCase <ide> public $mailer; <ide> public $markdown; <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> parent::tearDown(); <ide> <ide> protected function getEnvironmentSetUp($app) <ide> }); <ide> } <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Notifications/SendingNotificationsWithLocaleTest.php <ide> protected function getEnvironmentSetUp($app) <ide> ]); <ide> } <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Queue/CallQueuedHandlerTest.php <ide> */ <ide> class CallQueuedHandlerTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> parent::tearDown(); <ide> <ide><path>tests/Integration/Queue/JobChainingTest.php <ide> protected function getEnvironmentSetUp($app) <ide> ]); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> JobChainingTestFirstJob::$ran = false; <ide> JobChainingTestSecondJob::$ran = false; <ide><path>tests/Integration/Queue/ModelSerializationTest.php <ide> protected function getEnvironmentSetUp($app) <ide> ]); <ide> } <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Integration/Validation/ValidatorTest.php <ide> <ide> class ValidatorTest extends DatabaseTestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Log/LogLoggerTest.php <ide> <ide> class LogLoggerTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Mail/MailMailerTest.php <ide> <ide> class MailMailerTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Mail/MailMarkdownTest.php <ide> <ide> class MailMarkdownTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Mail/MailMessageTest.php <ide> class MailMessageTest extends TestCase <ide> */ <ide> protected $message; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide> $this->swift = m::mock(Swift_Mime_Message::class); <ide> $this->message = new Message($this->swift); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Mail/MailableQueuedTest.php <ide> <ide> class MailableQueuedTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Notifications/NotificationBroadcastChannelTest.php <ide> <ide> class NotificationBroadcastChannelTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Notifications/NotificationChannelManagerTest.php <ide> <ide> class NotificationChannelManagerTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Notifications/NotificationDatabaseChannelTest.php <ide> <ide> class NotificationDatabaseChannelTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Notifications/NotificationRoutesNotificationsTest.php <ide> <ide> class NotificationRoutesNotificationsTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Notifications/NotificationSendQueuedNotificationTest.php <ide> <ide> class NotificationSendQueuedNotificationTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Pagination/LengthAwarePaginatorTest.php <ide> class LengthAwarePaginatorTest extends TestCase <ide> */ <ide> private $options; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $this->options = ['onEachSide' => 5]; <ide> $this->p = new LengthAwarePaginator($array = ['item1', 'item2', 'item3', 'item4'], 4, 2, 2, $this->options); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> unset($this->p); <ide> } <ide><path>tests/Queue/QueueBeanstalkdJobTest.php <ide> <ide> class QueueBeanstalkdJobTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Queue/QueueBeanstalkdQueueTest.php <ide> <ide> class QueueBeanstalkdQueueTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Queue/QueueDatabaseQueueIntegrationTest.php <ide> class QueueDatabaseQueueIntegrationTest extends TestCase <ide> */ <ide> protected $container; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $db = new DB; <ide> <ide> protected function schema() <ide> * <ide> * @return void <ide> */ <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> $this->schema()->drop('jobs'); <ide> } <ide><path>tests/Queue/QueueDatabaseQueueUnitTest.php <ide> <ide> class QueueDatabaseQueueUnitTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Queue/QueueListenerTest.php <ide> <ide> class QueueListenerTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Queue/QueueManagerTest.php <ide> <ide> class QueueManagerTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Queue/QueueRedisJobTest.php <ide> <ide> class QueueRedisJobTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Queue/QueueRedisQueueTest.php <ide> <ide> class QueueRedisQueueTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Queue/QueueSqsJobTest.php <ide> <ide> class QueueSqsJobTest extends TestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $this->key = 'AMAZONSQSKEY'; <ide> $this->secret = 'AmAz0n+SqSsEcReT+aLpHaNuM3R1CsTr1nG'; <ide> public function setUp(): void <ide> ]; <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Queue/QueueSqsQueueTest.php <ide> <ide> class QueueSqsQueueTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> // Use Mockery to mock the SqsClient <ide> $this->sqs = m::mock(SqsClient::class); <ide><path>tests/Queue/QueueSyncQueueTest.php <ide> <ide> class QueueSyncQueueTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Queue/QueueWorkerTest.php <ide> class QueueWorkerTest extends TestCase <ide> public $events; <ide> public $exceptionHandler; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $this->events = m::spy(Dispatcher::class); <ide> $this->exceptionHandler = m::spy(ExceptionHandler::class); <ide> public function setUp(): void <ide> $container->instance(ExceptionHandler::class, $this->exceptionHandler); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> Container::setInstance(); <ide> } <ide><path>tests/Queue/RedisQueueIntegrationTest.php <ide> class RedisQueueIntegrationTest extends TestCase <ide> */ <ide> private $queue; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> Carbon::setTestNow(Carbon::now()); <ide> parent::setUp(); <ide> $this->setUpRedis(); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> Carbon::setTestNow(null); <ide> parent::tearDown(); <ide><path>tests/Redis/ConcurrentLimiterTest.php <ide> class ConcurrentLimiterTest extends TestCase <ide> { <ide> use InteractsWithRedis; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Redis/DurationLimiterTest.php <ide> class DurationLimiterTest extends TestCase <ide> { <ide> use InteractsWithRedis; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Redis/RedisConnectionTest.php <ide> class RedisConnectionTest extends TestCase <ide> { <ide> use InteractsWithRedis; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> $this->setUpRedis(); <ide> public function setUp(): void <ide> } <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> parent::tearDown(); <ide> $this->tearDownRedis(); <ide><path>tests/Routing/RouteCollectionTest.php <ide> class RouteCollectionTest extends TestCase <ide> */ <ide> protected $routeCollection; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide><path>tests/Routing/RouteRegistrarTest.php <ide> class RouteRegistrarTest extends TestCase <ide> */ <ide> protected $router; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide> $this->router = new Router(m::mock(Dispatcher::class), Container::getInstance()); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Routing/RoutingRedirectorTest.php <ide> class RoutingRedirectorTest extends TestCase <ide> protected $session; <ide> protected $redirect; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $this->headers = m::mock(HeaderBag::class); <ide> <ide> public function setUp(): void <ide> $this->redirect->setSession($this->session); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Session/EncryptedSessionStoreTest.php <ide> <ide> class EncryptedSessionStoreTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Session/SessionStoreTest.php <ide> <ide> class SessionStoreTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Session/SessionTableCommandTest.php <ide> <ide> class SessionTableCommandTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Support/SupportCapsuleManagerTraitTest.php <ide> class SupportCapsuleManagerTraitTest extends TestCase <ide> { <ide> use CapsuleManagerTrait; <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Support/SupportCarbonTest.php <ide> class SupportCarbonTest extends TestCase <ide> */ <ide> protected $now; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> parent::setUp(); <ide> <ide> Carbon::setTestNow($this->now = Carbon::create(2017, 6, 27, 13, 14, 15, 'UTC')); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> Carbon::setTestNow(); <ide> Carbon::serializeUsing(null); <ide><path>tests/Support/SupportFacadeTest.php <ide> <ide> class SupportFacadeTest extends TestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> Facade::clearResolvedInstances(); <ide> FacadeStub::setFacadeApplication(null); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Support/SupportFacadesEventTest.php <ide> protected function setUp(): void <ide> Facade::setFacadeApplication($container); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> Event::clearResolvedInstances(); <ide> <ide><path>tests/Support/SupportHelpersTest.php <ide> <ide> class SupportHelpersTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Support/SupportMacroableTest.php <ide> class SupportMacroableTest extends TestCase <ide> { <ide> private $macroable; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $this->macroable = $this->createObjectForTrait(); <ide> } <ide><path>tests/Support/SupportMessageBagTest.php <ide> <ide> class SupportMessageBagTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Support/SupportServiceProviderTest.php <ide> <ide> class SupportServiceProviderTest extends TestCase <ide> { <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> ServiceProvider::$publishes = []; <ide> ServiceProvider::$publishGroups = []; <ide> public function setUp(): void <ide> $two->boot(); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Translation/TranslationFileLoaderTest.php <ide> <ide> class TranslationFileLoaderTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Translation/TranslationTranslatorTest.php <ide> <ide> class TranslationTranslatorTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Validation/ValidationDatabasePresenceVerifierTest.php <ide> <ide> class ValidationDatabasePresenceVerifierTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Validation/ValidationExistsRuleTest.php <ide> class ValidationExistsRuleTest extends TestCase <ide> * <ide> * @return void <ide> */ <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $db = new DB; <ide> <ide> protected function getConnectionResolver() <ide> * <ide> * @return void <ide> */ <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> $this->schema('default')->drop('users'); <ide> } <ide><path>tests/Validation/ValidationFactoryTest.php <ide> <ide> class ValidationFactoryTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/Validation/ValidationValidatorTest.php <ide> <ide> class ValidationValidatorTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> Carbon::setTestNow(); <ide> m::close(); <ide><path>tests/View/Blade/AbstractBladeTestCase.php <ide> abstract class AbstractBladeTestCase extends TestCase <ide> { <ide> protected $compiler; <ide> <del> public function setUp(): void <add> protected function setUp(): void <ide> { <ide> $this->compiler = new BladeCompiler(m::mock(Filesystem::class), __DIR__); <ide> parent::setUp(); <ide> } <ide> <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> <ide><path>tests/View/Blade/BladeElseAuthStatementsTest.php <ide> <ide> class BladeElseAuthStatementsTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/View/Blade/BladeElseGuestStatementsTest.php <ide> <ide> class BladeElseGuestStatementsTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/View/Blade/BladeIfAuthStatementsTest.php <ide> <ide> class BladeIfAuthStatementsTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/View/Blade/BladeIfGuestStatementsTest.php <ide> <ide> class BladeIfGuestStatementsTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/View/ViewBladeCompilerTest.php <ide> <ide> class ViewBladeCompilerTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/View/ViewCompilerEngineTest.php <ide> <ide> class ViewCompilerEngineTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/View/ViewFactoryTest.php <ide> <ide> class ViewFactoryTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/View/ViewFileViewFinderTest.php <ide> <ide> class ViewFileViewFinderTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/View/ViewPhpEngineTest.php <ide> <ide> class ViewPhpEngineTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> } <ide><path>tests/View/ViewTest.php <ide> <ide> class ViewTest extends TestCase <ide> { <del> public function tearDown(): void <add> protected function tearDown(): void <ide> { <ide> m::close(); <ide> }
207
PHP
PHP
fix path for namespaced translation overrides
5d93473b56b7ce481000902ec8f2e3c426be7c03
<ide><path>src/Illuminate/Translation/FileLoader.php <ide> protected function loadNamespaced($locale, $group, $namespace) <ide> */ <ide> protected function loadNamespaceOverrides(array $lines, $locale, $group, $namespace) <ide> { <del> $file = "{$this->path}/packages/{$locale}/{$namespace}/{$group}.php"; <add> $file = "{$this->path}/vendor/{$namespace}/{$locale}/{$group}.php"; <ide> <ide> if ($this->files->exists($file)) <ide> { <ide><path>tests/Translation/TranslationFileLoaderTest.php <ide> public function testLoadMethodWithNamespacesProperlyCallsLoader() <ide> { <ide> $loader = new FileLoader($files = m::mock('Illuminate\Filesystem\Filesystem'), __DIR__); <ide> $files->shouldReceive('exists')->once()->with('bar/en/foo.php')->andReturn(true); <del> $files->shouldReceive('exists')->once()->with(__DIR__.'/packages/en/namespace/foo.php')->andReturn(false); <add> $files->shouldReceive('exists')->once()->with(__DIR__.'/vendor/namespace/en/foo.php')->andReturn(false); <ide> $files->shouldReceive('getRequire')->once()->with('bar/en/foo.php')->andReturn(array('foo' => 'bar')); <ide> $loader->addNamespace('namespace', 'bar'); <ide> <ide> public function testLoadMethodWithNamespacesProperlyCallsLoaderAndLoadsLocalOver <ide> { <ide> $loader = new FileLoader($files = m::mock('Illuminate\Filesystem\Filesystem'), __DIR__); <ide> $files->shouldReceive('exists')->once()->with('bar/en/foo.php')->andReturn(true); <del> $files->shouldReceive('exists')->once()->with(__DIR__.'/packages/en/namespace/foo.php')->andReturn(true); <add> $files->shouldReceive('exists')->once()->with(__DIR__.'/vendor/namespace/en/foo.php')->andReturn(true); <ide> $files->shouldReceive('getRequire')->once()->with('bar/en/foo.php')->andReturn(array('foo' => 'bar')); <del> $files->shouldReceive('getRequire')->once()->with(__DIR__.'/packages/en/namespace/foo.php')->andReturn(array('foo' => 'override', 'baz' => 'boom')); <add> $files->shouldReceive('getRequire')->once()->with(__DIR__.'/vendor/namespace/en/foo.php')->andReturn(array('foo' => 'override', 'baz' => 'boom')); <ide> $loader->addNamespace('namespace', 'bar'); <ide> <ide> $this->assertEquals(array('foo' => 'override', 'baz' => 'boom'), $loader->load('en', 'foo', 'namespace'));
2
Python
Python
add cli.package command to build model packages
bf240132d70b497e6c5c57407e5ca1cfdc9b17e3
<ide><path>spacy/__main__.py <ide> from spacy.cli import download as cli_download <ide> from spacy.cli import link as cli_link <ide> from spacy.cli import info as cli_info <add>from spacy.cli import package as cli_package <ide> <ide> <ide> class CLI(object): <ide> """Command-line interface for spaCy""" <ide> <del> commands = ('download', 'link', 'info') <add> commands = ('download', 'link', 'info', 'package') <ide> <ide> @plac.annotations( <ide> model=("model to download (shortcut or model name)", "positional", None, str), <ide> def info(self, model=None, markdown=False): <ide> cli_info(model, markdown) <ide> <ide> <add> @plac.annotations( <add> input_dir=("directory with model data", "positional", None, str), <add> output_dir=("output directory", "positional", None, str) <add> ) <add> def package(self, input_dir, output_dir): <add> """ <add> Generate Python package for model data, including meta and required <add> installation files. A new directory will be created in the specified <add> output directory. <add> """ <add> <add> cli_package(input_dir, output_dir) <add> <add> <ide> def __missing__(self, name): <ide> print("\n Command %r does not exist\n" % name) <ide> <ide><path>spacy/cli/__init__.py <ide> from .download import download <ide> from .info import info <ide> from .link import link <add>from .package import package <ide><path>spacy/cli/package.py <add># coding: utf8 <add>from __future__ import unicode_literals <add> <add>import json <add>from shutil import copytree <add>from pathlib import Path <add> <add>from .. import about <add>from .. import util <add> <add> <add>def package(input_dir, output_dir): <add> input_path = Path(input_dir) <add> output_path = Path(output_dir) <add> check_dirs(input_path, output_path) <add> <add> meta = generate_meta() <add> model_name = meta['lang'] + '_' + meta['name'] <add> model_name_v = model_name + '-' + meta['version'] <add> main_path = output_path / model_name_v <add> package_path = main_path / model_name <add> <add> Path.mkdir(package_path, parents=True) <add> copytree(input_path, package_path / model_name_v) <add> create_file(main_path / 'meta.json', json.dumps(meta, indent=2)) <add> create_file(main_path / 'setup.py', TEMPLATE_SETUP.strip()) <add> create_file(main_path / 'MANIFEST.in', TEMPLATE_MANIFEST.strip()) <add> create_file(package_path / '__init__.py', TEMPLATE_INIT.strip()) <add> <add> util.print_msg( <add> main_path.as_posix(), <add> "To build the package, run python setup.py sdist in that directory.", <add> title="Successfully reated package {p}".format(p=model_name_v)) <add> <add> <add>def check_dirs(input_path, output_path): <add> if not input_path.exists(): <add> util.sys_exit(input_path.as_poisx(), title="Model directory not found") <add> if not output_path.exists(): <add> util.sys_exit(output_path.as_posix(), title="Output directory not found") <add> <add> <add>def create_file(file_path, contents): <add> file_path.touch() <add> file_path.write_text(contents, encoding='utf-8') <add> <add> <add>def generate_meta(): <add> settings = [('lang', 'Model language', 'en'), <add> ('name', 'Model name', 'model'), <add> ('version', 'Model version', '0.0.0'), <add> ('spacy_version', 'Required spaCy version', '>=2.0.0,<3.0.0'), <add> ('description', 'Model description', False), <add> ('author', 'Author', False), <add> ('email', 'Author email', False), <add> ('url', 'Author website', False), <add> ('license', 'License', 'MIT')] <add> <add> util.print_msg("Enter the package settings for your model.", title="Generating meta.json") <add> <add> meta = {} <add> for setting, desc, default in settings: <add> response = util.get_raw_input(desc, default) <add> meta[setting] = default if response == '' and default else response <add> return meta <add> <add> <add>TEMPLATE_MANIFEST = """ <add>include meta.json <add>""" <add> <add> <add>TEMPLATE_SETUP = """ <add>#!/usr/bin/env python <add># coding: utf8 <add>from __future__ import unicode_literals <add> <add>import io <add>import json <add>from os import path, walk <add>from shutil import copy <add>from setuptools import setup <add> <add> <add>def load_meta(fp): <add> with io.open(fp, encoding='utf8') as f: <add> return json.load(f) <add> <add> <add>def list_files(data_dir): <add> output = [] <add> for root, _, filenames in walk(data_dir): <add> for filename in filenames: <add> if not filename.startswith('.'): <add> output.append(path.join(root, filename)) <add> output = [path.relpath(p, path.dirname(data_dir)) for p in output] <add> output.append('meta.json') <add> return output <add> <add> <add>def setup_package(): <add> root = path.abspath(path.dirname(__file__)) <add> meta_path = path.join(root, 'meta.json') <add> meta = load_meta(meta_path) <add> model_name = str(meta['lang'] + '_' + meta['name']) <add> model_dir = path.join(model_name, model_name + '-' + meta['version']) <add> <add> copy(meta_path, path.join(root, model_name)) <add> copy(meta_path, path.join(root, model_dir)) <add> <add> setup( <add> name=model_name, <add> description=meta['description'], <add> author=meta['author'], <add> author_email=meta['email'], <add> url=meta['url'], <add> version=meta['version'], <add> license=meta['license'], <add> packages=[model_name], <add> package_data={model_name: list_files(model_dir)}, <add> install_requires=['spacy' + meta['spacy_version']], <add> zip_safe=False, <add> ) <add> <add> <add>if __name__ == '__main__': <add> setup_package() <add>""" <add> <add> <add>TEMPLATE_INIT = """ <add>from pathlib import Path <add>from spacy.util import get_lang_class <add>import pkg_resources <add>import json <add> <add> <add>def load_meta(): <add> with (Path(__file__).parent / 'meta.json').open() as f: <add> return json.load(f) <add> <add> <add>def load(**kwargs): <add> meta = load_meta() <add> version = meta['version'] <add> data_dir = pkg_resources.resource_filename(__name__, __name__ + '-' + version) <add> lang = get_lang_class(meta['lang']) <add> return lang(path=Path(data_dir), **kwargs) <add>"""
3
Ruby
Ruby
check has_apple_developer_tools? once
8830e401a9332abd6d75261a7116851a2a9c135b
<ide><path>Library/Homebrew/formula_installer.rb <ide> def install <ide> <ide> unless ignore_deps? <ide> deps = compute_dependencies <del> check_dependencies_bottled(deps) if pour_bottle? <add> check_dependencies_bottled(deps) if pour_bottle? && !MacOS.has_apple_developer_tools? <ide> install_dependencies(deps) <ide> end <ide> <ide> def compute_dependencies <ide> # abnormally with a BuildToolsError if one or more don't. <ide> # Only invoked when the user has no developer tools. <ide> def check_dependencies_bottled(deps) <del> unbottled = deps.select do |dep, _| <del> formula = dep.to_formula <del> !formula.pour_bottle? && !MacOS.has_apple_developer_tools? <del> end <add> unbottled = deps.reject { |dep, _| dep.to_formula.pour_bottle? } <ide> <ide> raise BuildToolsError.new(unbottled) unless unbottled.empty? <ide> end
1
Mixed
Ruby
support endless ranges in where
7110dbea008dd4b80d1764003935a3c97ab10f57
<ide><path>activerecord/CHANGELOG.md <add>* Add support for endless ranges introduces in Ruby 2.6. <add> <add> *Greg Navis* <add> <ide> * Deprecate passing `migrations_paths` to `connection.assume_migrated_upto_version`. <ide> <ide> *Ryuta Kamizono* <ide><path>activerecord/lib/arel/predications.rb <ide> def eq_all(others) <ide> <ide> def between(other) <ide> if infinity?(other.begin) <del> if infinity?(other.end) <add> if other.end.nil? || infinity?(other.end) <ide> not_in([]) <ide> elsif other.exclude_end? <ide> lt(other.end) <ide> else <ide> lteq(other.end) <ide> end <del> elsif infinity?(other.end) <add> elsif other.end.nil? || infinity?(other.end) <ide> gteq(other.begin) <ide> elsif other.exclude_end? <ide> gteq(other.begin).and(lt(other.end)) <ide><path>activerecord/test/cases/arel/attributes/attribute_test.rb <ide> class AttributeTest < Arel::Spec <ide> ) <ide> end <ide> <add> if Gem::Version.new("2.6.0") <= Gem::Version.new(RUBY_VERSION) <add> it "can be constructed with a range implicitly ending at Infinity" do <add> attribute = Attribute.new nil, nil <add> node = attribute.between(eval("0..")) # Use eval for compatibility with Ruby < 2.6 parser <add> <add> node.must_equal Nodes::GreaterThanOrEqual.new( <add> attribute, <add> Nodes::Casted.new(0, attribute) <add> ) <add> end <add> end <add> <ide> it "can be constructed with a quoted range ending at Infinity" do <ide> attribute = Attribute.new nil, nil <ide> node = attribute.between(quoted_range(0, ::Float::INFINITY, false))
3
Python
Python
remove all uses of zope.interface
9292ee9317d8ff15bf020a9488de1915c85d339a
<ide><path>libcloud/base.py <ide> """ <ide> import httplib, urllib <ide> import libcloud <del>from zope import interface <del>from libcloud.interface import IConnectionUserAndKey, IResponse <del>from libcloud.interface import IConnectionKey, IConnectionKeyFactory <del>from libcloud.interface import IConnectionUserAndKeyFactory, IResponseFactory <del>from libcloud.interface import INodeDriverFactory, INodeDriver <del>from libcloud.interface import INodeFactory, INode <del>from libcloud.interface import INodeSizeFactory, INodeSize <del>from libcloud.interface import INodeImageFactory, INodeImage <ide> from libcloud.types import NodeState, DeploymentException <ide> from libcloud.ssh import SSHClient <ide> import time <ide> class Node(object): <ide> A Base Node class to derive from. <ide> """ <ide> <del> interface.implements(INode) <del> interface.classProvides(INodeFactory) <del> <ide> def __init__(self, id, name, state, public_ip, private_ip, <ide> driver, extra=None): <ide> self.id = id <ide> class NodeSize(object): <ide> A Base NodeSize class to derive from. <ide> """ <ide> <del> interface.implements(INodeSize) <del> interface.classProvides(INodeSizeFactory) <del> <ide> def __init__(self, id, name, ram, disk, bandwidth, price, driver): <ide> self.id = id <ide> self.name = name <ide> class NodeImage(object): <ide> A Base NodeImage class to derive from. <ide> """ <ide> <del> interface.implements(INodeImage) <del> interface.classProvides(INodeImageFactory) <del> <ide> def __init__(self, id, name, driver, extra=None): <ide> self.id = id <ide> self.name = name <ide> class NodeLocation(object): <ide> """ <ide> A base NodeLocation class to derive from. <ide> """ <del> interface.implements(INodeImage) <del> interface.classProvides(INodeImageFactory) <add> <ide> def __init__(self, id, name, country, driver): <ide> self.id = id <ide> self.name = name <ide> class Response(object): <ide> """ <ide> A Base Response class to derive from. <ide> """ <del> interface.implements(IResponse) <del> interface.classProvides(IResponseFactory) <del> <ide> NODE_STATE_MAP = {} <ide> <ide> object = None <ide> class ConnectionKey(object): <ide> """ <ide> A Base Connection class to derive from. <ide> """ <del> interface.implementsOnly(IConnectionKey) <del> interface.classProvides(IConnectionKeyFactory) <del> <ide> #conn_classes = (httplib.LoggingHTTPConnection, LoggingHTTPSConnection) <ide> conn_classes = (httplib.HTTPConnection, httplib.HTTPSConnection) <ide> <ide> class ConnectionUserAndKey(ConnectionKey): <ide> """ <ide> Base connection which accepts a user_id and key <ide> """ <del> interface.implementsOnly(IConnectionUserAndKey) <del> interface.classProvides(IConnectionUserAndKeyFactory) <ide> <ide> user_id = None <ide> <ide> class NodeDriver(object): <ide> """ <ide> A base NodeDriver class to derive from <ide> """ <del> interface.implements(INodeDriver) <del> interface.classProvides(INodeDriverFactory) <ide> <ide> connectionCls = ConnectionKey <ide> name = None <ide><path>libcloud/drivers/dummy.py <ide> <ide> @note: This driver is out of date <ide> """ <del>from libcloud.interface import INodeDriver <ide> from libcloud.base import ConnectionKey, NodeDriver, NodeSize, NodeLocation <ide> from libcloud.base import NodeImage, Node <ide> from libcloud.types import Provider,NodeState <del>from zope.interface import implements <ide> <ide> import uuid <ide> <ide> class DummyNodeDriver(NodeDriver): <ide> name = "Dummy Node Provider" <ide> type = Provider.DUMMY <ide> <del> implements(INodeDriver) <del> <ide> def __init__(self, creds): <ide> self.creds = creds <ide> self.nl = [ <ide><path>libcloud/drivers/ecp.py <ide> """ <ide> Enomaly ECP driver <ide> """ <del>from libcloud.interface import INodeDriver <ide> from libcloud.base import NodeDriver, NodeSize, NodeLocation <ide> from libcloud.base import NodeImage, Node <ide> from libcloud.base import Response, ConnectionUserAndKey <ide> from libcloud.types import Provider, NodeState, InvalidCredsException <ide> from libcloud.base import is_private_subnet <del>from zope.interface import implements <ide> <ide> import time <ide> import base64 <ide> class ECPNodeDriver(NodeDriver): <ide> name = "Enomaly Elastic Computing Platform" <ide> type = Provider.ECP <ide> connectionCls = ECPConnection <del> implements(INodeDriver) <ide> <ide> def list_nodes(self): <ide> """ <ide><path>libcloud/interface.py <del># Licensed to the Apache Software Foundation (ASF) under one or more <del># contributor license agreements. See the NOTICE file distributed with <del># this work for additional information regarding copyright ownership. <del># The ASF licenses this file to You under the Apache License, Version 2.0 <del># (the "License"); you may not use this file except in compliance with <del># the License. You may obtain a copy of the License at <del># <del># http://www.apache.org/licenses/LICENSE-2.0 <del># <del># Unless required by applicable law or agreed to in writing, software <del># distributed under the License is distributed on an "AS IS" BASIS, <del># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <del># See the License for the specific language governing permissions and <del># limitations under the License. <del> <del>""" <del>Provides zope.interface definitions for libcloud. <del>""" <del>from zope.interface import Interface, Attribute <del> <del> <del>class INode(Interface): <del> """ <del> A node (instance, etc) <del> """ <del> uuid = Attribute("""Unique identifier""") <del> id = Attribute("""Unique ID provided by the provider (i-abcd1234, etc)""") <del> name = Attribute("""Hostname or similar identifier""") <del> state = Attribute("""A standard Node state as provided by L{NodeState}""") <del> public_ip = Attribute("""List of Public IPs of the Node""") <del> private_ip = Attribute("""List of Private IPs of the Node""") <del> driver = Attribute("""The NodeDriver that belongs to this Node""") <del> extra = Attribute("""Dict containing provider specific data""") <del> <del> def get_uuid(): <del> """ <del> Provides a system wide unique ID for the node <del> """ <del> def destroy(): <del> """ <del> Call `self.driver.destroy_node(self)`. A convenience method. <del> """ <del> <del> def reboot(): <del> """ <del> Call `self.driver.reboot_node(self)`. A convenience method. <del> """ <del> <del> <del>class INodeFactory(Interface): <del> """ <del> Create nodes <del> """ <del> def __call__(id, name, state, public_ip, private_ip, driver): <del> """ <del> Set values for ivars, including any other requisite kwargs <del> """ <del> <del> <del>class INodeSize(Interface): <del> """ <del> A machine image <del> """ <del> id = Attribute("""Unique ID provided by the provider (m1.small, etc)""") <del> name = Attribute("""Name provided by the provider (Small CPU, etc)""") <del> ram = Attribute("""Amount of RAM provided in MB (256MB, 1740MB)""") <del> disk = Attribute("""Amount of disk provided in GB (200GB)""") <del> bandwidth = Attribute("""Amount of total transfer bandwidth in GB""") <del> price = Attribute("""Hourly price of this server in USD, estimated if <del> monthly""") <del> driver = Attribute("""The NodeDriver that belongs to this Image""") <del> <del> <del>class INodeSizeFactory(Interface): <del> """ <del> Create nodes <del> """ <del> def __call__(id, name, ram, disk, bandwidth, price, driver): <del> """ <del> Set values for ivars, including any other requisite kwargs <del> """ <del> <del> <del>class INodeImage(Interface): <del> """ <del> A machine image <del> """ <del> id = Attribute("""Unique ID provided by the provider (ami-abcd1234)""") <del> name = Attribute("""Name provided by the provider (Ubuntu 8.1)""") <del> driver = Attribute("""The NodeDriver that belongs to this Image""") <del> extra = Attribute("""Dict containing provider specific data""") <del> <del>class INodeImageFactory(Interface): <del> """ <del> Create nodes <del> """ <del> def __call__(id, name, driver): <del> """ <del> Set values for ivars, including any other requisite kwargs <del> """ <del> <del>class INodeLocation(Interface): <del> """ <del> Physical Location of a node <del> """ <del> id = Attribute("""Unique ID provided by the provider for a physical <del> datacenter""") <del> name = Attribute("""Name provided by the provider ('Austin Texas DC 1')""") <del> country = Attribute("""ISO 3166 country code of the physical location of <del> the data center <http://bit.ly/pKie5> (iso.org)""") <del> driver = Attribute("""The NodeDriver that belongs to this Location""") <del> <del>class INodeLocationFactory(Interface): <del> """ <del> Create nodes location <del> """ <del> def __call__(id, name, country, driver): <del> """ <del> Set values for ivars, including any other requisite kwargs <del> """ <del> <del>class INodeDriverFactory(Interface): <del> """ <del> Create NodeDrivers <del> """ <del> def __call__(key, secret=None, secure=True): <del> """ <del> Set of value for ivars <del> """ <del> <del> <del>class INodeDriver(Interface): <del> """ <del> A driver which provides nodes, such as an Amazon EC2 instance, <del> or Slicehost slice <del> """ <del> <del> connection = Attribute("""Represents the IConnection for this driver""") <del> type = Attribute("""The type of this provider as defined by L{Provider}""") <del> name = Attribute("""A pretty name (Linode, etc) for this provider""") <del> <del> NODE_STATE_MAP = Attribute("""A mapping of states found in the response to <del> their standard type. This is a constant.""") <del> <del> def create_node(**kwargs): <del> """ <del> Creates a new node based on provided params. Name is ignored on <del> some providers. <del> <del> To specify provider-specific options, use keyword arguments. <del> """ <del> <del> def destroy_node(node): <del> """ <del> Returns True if the destroy was successful, otherwise False <del> """ <del> <del> def list_nodes(): <del> """ <del> Returns a list of nodes for this provider <del> """ <del> <del> def list_images(location=None): <del> """ <del> Returns a list of images for this provider <del> """ <del> <del> def list_sizes(location=None): <del> """ <del> Returns a list of sizes for this provider <del> """ <del> <del> def list_locations(): <del> """ <del> Returns a list of locations for this prodiver <del> """ <del> <del> def reboot_node(node): <del> """ <del> Returns True if the reboot was successful, otherwise False <del> """ <del> <del>class IConnection(Interface): <del> """ <del> A Connection represents an interface between a Client and a Provider's Web <del> Service. It is capable of authenticating, making requests, and returning <del> responses. <del> """ <del> conn_classes = Attribute("""Classes used to create connections, should be <del> in the form of `(insecure, secure)`""") <del> responseCls = Attribute("""Provider-specific Class used for creating <del> responses""") <del> connection = Attribute("""Represents the lower-level connection to the <del> server""") <del> host = Attribute("""Default host for this connection""") <del> port = Attribute("""Default port for this connection. This should be a <del> tuple of the form `(insecure, secure)` or for single-port <del> Providers, simply `(port,)`""") <del> secure = Attribute("""Indicates if this is a secure connection. If previous <del> recommendations were followed, it would be advantageous <del> for this to be in the form: 0=insecure, 1=secure""") <del> driver = Attribute("""The NodeDriver that belongs to this Node""") <del> <del> def connect(host=None, port=None): <del> """ <del> A method for establishing a connection. If no host or port are given, <del> existing ivars should be used. <del> """ <del> <del> def request(action, params={}, data='', method='GET'): <del> """ <del> Make a request. <del> <del> An `action` should represent a path, such as `/list/nodes`. Query <del> parameters necessary to the request should be passed in `params` and <del> any data to encode goes in `data`. `method` should be one of: (GET, <del> POST). <del> <del> Should return a response object (specific to a provider). <del> """ <del> <del> def add_default_params(params): <del> """ <del> Adds default parameters (such as API key, version, etc.) <del> to the passed `params` <del> <del> Should return a dictionary. <del> """ <del> <del> def add_default_headers(headers): <del> """ <del> Adds default headers (such as Authorization, X-Foo-Bar) <del> to the passed `headers` <del> <del> Should return a dictionary. <del> """ <del> <del> def encode_data(data): <del> """ <del> Data may need to be encoded before sent in a request. <del> If not, simply return the data. <del> """ <del> <del> <del>class IConnectionKey(IConnection): <del> """ <del> IConnection which only depends on an API key for authentication. <del> """ <del> key = Attribute("""API key, token, etc.""") <del> <del> <del>class IConnectionUserAndKey(IConnectionKey): <del> """ <del> IConnection which depends on a user identifier and an API <del> for authentication. <del> """ <del> user_id = Attribute("""User identifier""") <del> <del> <del>class IConnectionKeyFactory(Interface): <del> """ <del> Create Connections which depend solely on an API key. <del> """ <del> def __call__(key, secure=True): <del> """ <del> Create a Connection. <del> <del> The acceptance of only `key` provides support for APIs with only one <del> authentication bit. <del> <del> The `secure` argument indicates whether or not a secure connection <del> should be made. Not all providers support this, so it may be ignored. <del> """ <del> <del> <del>class IConnectionUserAndKeyFactory(Interface): <del> """ <del> Create Connections which depends on both a user identifier and API key. <del> """ <del> def __call__(user_id, key, secure=True): <del> """ <del> Create a Connection. <del> <del> The first two arguments provide the initial values for `user_id` and <del> `key`, respectively, which should be used for authentication. <del> <del> The `secure` argument indicates whether or not a secure connection <del> should be made. Not all providers support this, so it may be ignored. <del> """ <del> <del> <del>class IResponse(Interface): <del> """ <del> A response as provided by a given HTTP Client. <del> """ <del> object = Attribute("""The processed response object, <del> e.g. via lxml or json""") <del> body = Attribute("""Unparsed response body""") <del> status = Attribute("""Response status code""") <del> headers = Attribute("""Response headers""") <del> error = Attribute("""Response error, L{None} if no error.""") <del> connection = Attribute("""Represents the IConnection for this response""") <del> <del> def parse_body(): <del> """ <del> Parse the response body (as XML, etc.) <del> """ <del> <del> def parse_error(): <del> """ <del> Parse the error that is contained in the response body (as XML, etc.) <del> """ <del> <del> def success(): <del> """ <del> Does the response indicate a successful request? <del> """ <del> <del> <del>class IResponseFactory(Interface): <del> """ <del> Creates Responses. <del> """ <del> def __call__(response): <del> """ <del> Process the given response, setting ivars. <del> """ <ide><path>test/test_base.py <ide> import sys <ide> import unittest <ide> <del>from zope.interface.verify import verifyObject <del> <del>from libcloud.interface import IResponse, INode, INodeSize, INodeImage, INodeDriver <del>from libcloud.interface import IConnectionKey, IConnectionUserAndKey <ide> from libcloud.base import Response, Node, NodeSize, NodeImage, NodeDriver <ide> from libcloud.base import ConnectionKey, ConnectionUserAndKey <ide> <ide> class BaseTests(unittest.TestCase): <ide> def test_base_node(self): <ide> node = Node(id=0, name=0, state=0, public_ip=0, private_ip=0, <ide> driver=FakeDriver()) <del> verifyObject(INode, node) <ide> <ide> def test_base_node_size(self): <ide> node_size = NodeSize(id=0, name=0, ram=0, disk=0, bandwidth=0, price=0, <ide> driver=FakeDriver()) <del> verifyObject(INodeSize, node_size) <ide> <ide> def test_base_node_image(self): <ide> node_image = NodeImage(id=0, name=0, driver=FakeDriver()) <del> verifyObject(INodeImage, node_image) <ide> <ide> def test_base_response(self): <del> verifyObject(IResponse, Response(MockResponse(status=200, <del> body='foo'))) <add> resp = Response(MockResponse(status=200, body='foo')) <ide> <ide> def test_base_node_driver(self): <ide> node_driver = NodeDriver('foo') <del> verifyObject(INodeDriver, node_driver) <ide> <ide> def test_base_connection_key(self): <ide> conn = ConnectionKey('foo') <del> verifyObject(IConnectionKey, conn) <ide> <ide> def test_base_connection_userkey(self): <ide> conn = ConnectionUserAndKey('foo', 'bar') <del> verifyObject(IConnectionUserAndKey, conn) <ide> <ide> # def test_drivers_interface(self): <ide> # failures = []
5
Ruby
Ruby
remove silly path method
c7ec737f86bade367eb45e004f21ec1b16f3e2e9
<ide><path>Library/Homebrew/formula.rb <ide> def initialize name='__UNKNOWN__', path=nil <ide> @name=name <ide> validate_variable :name <ide> <del> @path = path.nil? ? nil : Pathname.new(path) <add> # If we got an explicit path, use that, else determine from the name <add> @path = path.nil? ? self.class.path(name) : Pathname.new(path) <ide> <ide> set_instance_variable 'version' <ide> @version ||= @spec_to_use.detect_version <ide> def installed_prefix <ide> end <ide> end <ide> <del> def path <del> if @path.nil? <del> return self.class.path(name) <del> else <del> return @path <del> end <del> end <del> <ide> def prefix <ide> validate_variable :name <ide> validate_variable :version
1
Text
Text
update markdown formatting for *.md files
549f96889a77c39fa4f2257305788a00848f9e97
<ide><path>BUILDING.md <ide> platforms. This is true regardless of entries in the table below. <ide> | FreeBSD | x64 | >= 11 | Experimental | Downgraded as of Node.js 12 <sup>[7](#fn7)</sup> | <ide> <ide> <em id="fn1">1</em>: GCC 8 is not provided on the base platform. Users will <del> need the <del> [Toolchain test builds PPA](https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test?field.series_filter=xenial) <del> or similar to source a newer compiler. <add>need the <add>[Toolchain test builds PPA](https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test?field.series_filter=xenial) <add>or similar to source a newer compiler. <ide> <ide> <em id="fn2">2</em>: GCC 8 is not provided on the base platform. Users will <del> need the <del> [devtoolset-8](https://www.softwarecollections.org/en/scls/rhscl/devtoolset-8/) <del> or later to source a newer compiler. <add>need the <add>[devtoolset-8](https://www.softwarecollections.org/en/scls/rhscl/devtoolset-8/) <add>or later to source a newer compiler. <ide> <ide> <em id="fn3">3</em>: Older kernel versions may work for ARM64. However the <del> Node.js test infrastructure only tests >= 4.5. <add>Node.js test infrastructure only tests >= 4.5. <ide> <ide> <em id="fn4">4</em>: On Windows, running Node.js in Windows terminal emulators <del> like `mintty` requires the usage of [winpty](https://github.com/rprichard/winpty) <del> for the tty channels to work (e.g. `winpty node.exe script.js`). <del> In "Git bash" if you call the node shell alias (`node` without the `.exe` <del> extension), `winpty` is used automatically. <add>like `mintty` requires the usage of [winpty](https://github.com/rprichard/winpty) <add>for the tty channels to work (e.g. `winpty node.exe script.js`). <add>In "Git bash" if you call the node shell alias (`node` without the `.exe` <add>extension), `winpty` is used automatically. <ide> <ide> <em id="fn5">5</em>: The Windows Subsystem for Linux (WSL) is not <del> supported, but the GNU/Linux build process and binaries should work. The <del> community will only address issues that reproduce on native GNU/Linux <del> systems. Issues that only reproduce on WSL should be reported in the <del> [WSL issue tracker](https://github.com/Microsoft/WSL/issues). Running the <del> Windows binary (`node.exe`) in WSL is not recommended. It will not work <del> without workarounds such as stdio redirection. <add>supported, but the GNU/Linux build process and binaries should work. The <add>community will only address issues that reproduce on native GNU/Linux <add>systems. Issues that only reproduce on WSL should be reported in the <add>[WSL issue tracker](https://github.com/Microsoft/WSL/issues). Running the <add>Windows binary (`node.exe`) in WSL is not recommended. It will not work <add>without workarounds such as stdio redirection. <ide> <ide> <em id="fn6">6</em>: Running Node.js on x86 Windows should work and binaries <ide> are provided. However, tests in our infrastructure only run on WoW64. <ide> Ubuntu 14.04 and Debian 8. <ide> #### OpenSSL asm support <ide> <ide> OpenSSL-1.1.1 requires the following assembler version for use of asm <del>support on x86_64 and ia32. <add>support on x86\_64 and ia32. <ide> <ide> For use of AVX-512, <ide> <ide> For use of AVX2, <ide> * nasm version 2.10 or higher in Windows <ide> <ide> Please refer to <del> <https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_ia32cap.html> for details. <add><https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_ia32cap.html> for details. <ide> <del> If compiling without one of the above, use `configure` with the <add>If compiling without one of the above, use `configure` with the <ide> `--openssl-no-asm` flag. Otherwise, `configure` will fail. <ide> <ide> ### Previous versions of this document <ide> Consult previous versions of this document for older versions of Node.js: <ide> ### Note about Python <ide> <ide> The Node.js project supports Python >= 3 for building and testing. <add> <ide> ### Unix and macOS <ide> <ide> #### Unix prerequisites <ide> release version is actually installed when you run `make install`. <ide> To use the debug build with all the normal dependencies overwrite the release <ide> version in the install directory: <ide> <del>``` console <add>```console <ide> $ make install PREFIX=/opt/node-debug/ <ide> $ cp -a -f out/Debug/node /opt/node-debug/node <ide> ``` <ide> was captured on (i.e. 64-bit `gdb` for `node` built on a 64-bit system, Linux <ide> <ide> Example of generating a backtrace from the core dump: <ide> <del>``` console <add>```console <ide> $ gdb /opt/node-debug/node core.node.8.1535359906 <ide> $ backtrace <ide> ``` <ide> $ backtrace <ide> related bugs. ASAN builds are currently only supported on linux. <ide> If you want to check it on Windows or macOS or you want a consistent toolchain <ide> on Linux, you can try [Docker](https://www.docker.com/products/docker-desktop) <del> (using an image like `gengjiawen/node-build:2020-02-14`). <add>(using an image like `gengjiawen/node-build:2020-02-14`). <ide> <ide> The `--debug` is not necessary and will slow down build and testing, but it can <ide> show clear stacktrace if ASAN hits an issue. <ide> <del>``` console <add>```console <ide> $ ./configure --debug --enable-asan && make -j4 <ide> $ make test-only <ide> ``` <ide> $ make test-only <ide> <ide> If you plan to frequently rebuild Node.js, especially if using several branches, <ide> installing `ccache` can help to greatly reduce build times. Set up with: <add> <ide> ```console <ide> $ sudo apt install ccache # for Debian/Ubuntu, included in most Linux distros <ide> $ ccache -o cache_dir=<tmp_dir> <ide> $ ccache -o max_size=5.0G <ide> $ export CC="ccache gcc" # add to your .profile <ide> $ export CXX="ccache g++" # add to your .profile <ide> ``` <add> <ide> This will allow for near-instantaneous rebuilds even when switching branches. <ide> <ide> When modifying only the JS layer in `lib`, it is possible to externally load it <ide> without modifying the executable: <add> <ide> ```console <ide> $ ./configure --node-builtin-modules-path $(pwd) <ide> ``` <add> <ide> The resulting binary won't include any JS files and will try to load them from <ide> the specified directory. The JS debugger of Visual Studio Code supports this <ide> configuration since the November 2020 version and allows for setting <ide> $ ./configure --with-intl=full-icu <ide> <ide> ### Trimmed: `small-icu` (English only) support <ide> <del> In this configuration, only English data is included, but <add>In this configuration, only English data is included, but <ide> the full `Intl` (ECMA-402) APIs. It does not need to download <ide> any dependencies to function. You can add full data at runtime. <ide> <ide> If you want to build Node.js using openssl-3.0.0+quic, you can follow these <ide> steps: <ide> <ide> **clone OpenSSL source and prepare build** <add> <ide> ```bash <ide> git clone [email protected]:quictls/openssl.git <ide> <ide> will publish the OpenSSL libraries and such. We will also use this path <ide> (and sub-paths) later when compiling Node.js. <ide> <ide> **compile and install OpenSSL** <add> <ide> ```console <ide> make -j8 <ide> make install <ide> find the `fipsmodule.cnf` file - let's add the following to the end of the <ide> `openssl.cnf` file. <ide> <ide> **alter openssl.cnf** <add> <ide> ```text <ide> .include fipsmodule.cnf <ide> <ide> sure that you specify an absolute path for the `.include fipsmodule.cnf` line - <ide> using relative paths did not work on my system! <ide> <ide> **alter openssl.cnf using a script** <add> <ide> ```console <ide> cat <<EOT >> /path/to/install/dir/ssl/openssl.cnf <ide> .include /path/to/install/dir/ssl/fipsmodule.cnf <ide> EOT <ide> As you might have picked a non-custom path for your OpenSSL install dir, we <ide> have to export the following two environment variables in order for Node.js to <ide> find our OpenSSL modules we built beforehand: <add> <ide> ```console <ide> export OPENSSL_CONF=/path/to/install/dir/ssl/openssl.cnf <ide> export OPENSSL_MODULES=/path/to/install/dir/lib/ossl-modules <ide> ``` <ide> <ide> **build Node.js** <add> <ide> ```console <ide> ./configure \ <ide> --shared-openssl \ <ide> make -j8 <ide> ``` <ide> <ide> **verify the produced executable** <add> <ide> ```console <ide> ldd ./node <ide> linux-vdso.so.1 (0x00007ffd7917b000) <ide> If the `ldd` command says that `libcrypto` cannot be found one needs to set <ide> `--shared-openssl-libpath` (see previous step). <ide> <ide> **verify the OpenSSL version** <add> <ide> ```console <ide> ./node -p process.versions.openssl <ide> 3.0.0-alpha16+quic <ide> ``` <ide> <ide> **verify that FIPS is available** <add> <ide> ```console <ide> ./node -p 'process.config.variables.openssl_is_fips' <ide> true <ide> executable. See sections <ide> [Enabling FIPS using OpenSSL config](#enabling-fips-using-openssl-config) below. <ide> <ide> ### Enabling FIPS using Node.js options <add> <ide> This is done using one of the Node.js options `--enable-fips` or <ide> `--force-fips`, for example: <add> <ide> ```console <ide> $ node --enable-fips -p 'crypto.getFips()' <ide> ``` <ide> <ide> ### Enabling FIPS using OpenSSL config <add> <ide> This example show that using OpenSSL's configuration file, FIPS can be enabled <ide> without specifying the `--enable-fips` or `--force-fips` options by setting <ide> `default_properties = fips=yes` in the FIPS configuration file. See <ide> for details. <ide> <ide> For this to work the OpenSSL configuration file (default openssl.cnf) needs to <ide> be updated. The following shows an example: <add> <ide> ```console <ide> openssl_conf = openssl_init <ide> <ide> activate = 1 <ide> [algorithm_sect] <ide> default_properties = fips=yes <ide> ``` <add> <ide> After this change Node.js can be run without the `--enable-fips` or `--force-fips` <ide> options. <ide> <ide><path>CHANGELOG.md <ide> Please use the following table to find the changelog for a specific Node.js <ide> release. <ide> <ide> <!--lint disable maximum-line-length--> <add> <ide> <table> <ide> <tr> <ide> <th title="Current"><a href="doc/changelogs/CHANGELOG_V16.md">16</a><sup>Current</sup></th> <ide> release. <ide> LTS releases. <ide> * Release versions in **bold** text are the most recent supported releases. <ide> <del>---- <del>---- <add>*** <add> <add>*** <ide> <ide> ## 2016-05-06, Version 0.12.14 (Maintenance), @rvagg <ide> <ide> release. <ide> <ide> ## 2009.08.21, Version 0.1.5 <ide> <del><a href="doc/changelogs/CHANGELOG_ARCHIVE.md#0.1.5>Moved to doc/changelogs/CHANGELOG_V6.md#6.0.0</a>. <add><a href="doc/changelogs/CHANGELOG_ARCHIVE.md#0.1.5">Moved to doc/changelogs/CHANGELOG_V6.md#6.0.0</a>. <ide> <ide> ## 2009.08.13, Version 0.1.4 <ide> <ide><path>CONTRIBUTING.md <ide> See [details on our policy on Code of Conduct](./doc/guides/contributing/code-of <ide> * [Notes](./doc/guides/contributing/pull-requests.md#notes) <ide> <ide> <a id="developers-certificate-of-origin"></a> <add> <ide> ## Developer's Certificate of Origin 1.1 <ide> <add><pre> <ide> By making a contribution to this project, I certify that: <ide> <ide> (a) The contribution was created in whole or in part by me and I <ide> By making a contribution to this project, I certify that: <ide> personal information I submit with it, including my sign-off) is <ide> maintained indefinitely and may be redistributed consistent with <ide> this project or the open source license(s) involved. <add></pre> <ide><path>GOVERNANCE.md <ide> the nomination fails. <ide> <ide> There are steps a nominator can take in advance to make a nomination as <ide> frictionless as possible. To request feedback from other collaborators in <del> private, use the [collaborators discussion page][] <del> (which only collaborators may view). A nominator may also work with the <add>private, use the [collaborators discussion page][] <add>(which only collaborators may view). A nominator may also work with the <ide> nominee to improve their contribution profile. <ide> <ide> Collaborators might overlook someone with valuable contributions. In that case, <ide><path>onboarding.md <ide> onboarding session. <ide> [Publicizing or hiding organization membership][]. <ide> <ide> * Notifications: <del> * Use [https://github.com/notifications](https://github.com/notifications) or <add> * Use <https://github.com/notifications> or <ide> set up email <ide> * Watching the main repository will flood your inbox (several hundred <ide> notifications on typical weekdays), so be prepared <ide> <ide> The project has two venues for real-time discussion: <add> <ide> * [`#nodejs-dev`](https://openjs-foundation.slack.com/archives/C019Y2T6STH) on <ide> the [OpenJS Foundation](https://slack-invite.openjsf.org/) <ide> <ide> The project has two venues for real-time discussion: <ide> * The best outcome is for people who come to our issue tracker to feel like <ide> they can come back again. <ide> <del>* You are expected to follow *and* hold others accountable to the <add>* You are expected to follow _and_ hold others accountable to the <ide> [Code of Conduct][]. <ide> <ide> ## Managing the issue tracker <ide> The project has two venues for real-time discussion: <ide> not perfect, of course. Feel free to apply relevant labels and remove <ide> irrelevant labels from pull requests and issues. <ide> * `semver-{minor,major}`: <del> * If a change has the remote *chance* of breaking something, use the <add> * If a change has the remote _chance_ of breaking something, use the <ide> `semver-major` label <ide> * When adding a `semver-*` label, add a comment explaining why you're adding <ide> it. Do it right away so you don't forget! <ide> The project has two venues for real-time discussion: <ide> ## Reviewing pull requests <ide> <ide> * The primary goal is for the codebase to improve. <add> <ide> * Secondary (but not far off) is for the person submitting code to succeed. A <ide> pull request from a new contributor is an opportunity to grow the community. <add> <ide> * Review a bit at a time. Do not overwhelm new contributors. <ide> * It is tempting to micro-optimize. Don't succumb to that temptation. We <ide> change V8 often. Techniques that provide improved performance today may be <ide> unnecessary in the future. <add> <ide> * Be aware: Your opinion carries a lot of weight! <add> <ide> * Nits (requests for small changes that are not essential) are fine, but try to <ide> avoid stalling the pull request. <ide> * Identify them as nits when you comment: `Nit: change foo() to bar().` <ide> * If they are stalling the pull request, fix them yourself on merge. <add> <ide> * Insofar as possible, issues should be identified by tools rather than human <ide> reviewers. If you are leaving comments about issues that could be identified <ide> by tools but are not, consider implementing the necessary tooling. <add> <ide> * Minimum wait for comments time <ide> * There is a minimum waiting time which we try to respect for non-trivial <ide> changes so that people who may have important input in such a distributed <ide> project are able to respond. <ide> * For non-trivial changes, leave the pull request open for at least 48 hours. <ide> * If a pull request is abandoned, check if they'd mind if you took it over <ide> (especially if it just has nits left). <add> <ide> * Approving a change <ide> * Collaborators indicate that they have reviewed and approve of the changes in <ide> a pull request using GitHub’s approval interface <ide> The project has two venues for real-time discussion: <ide> such as `async_hooks`. <ide> <ide> * Continuous Integration (CI) Testing: <del> * [https://ci.nodejs.org/](https://ci.nodejs.org/) <add> * <https://ci.nodejs.org/> <ide> * It is not automatically run. You need to start it manually. <ide> * Log in on CI is integrated with GitHub. Try to log in now! <ide> * You will be using `node-test-pull-request` most of the time. Go there now! <ide> needs to be pointed out separately during the onboarding. <ide> * Almost any mistake you could make can be fixed or reverted. <ide> * The existing collaborators trust you and are grateful for your help! <ide> * Other repositories: <del> * [https://github.com/nodejs/TSC](https://github.com/nodejs/TSC) <del> * [https://github.com/nodejs/build](https://github.com/nodejs/build) <del> * [https://github.com/nodejs/nodejs.org](https://github.com/nodejs/nodejs.org) <del> * [https://github.com/nodejs/readable-stream](https://github.com/nodejs/readable-stream) <del> * [https://github.com/nodejs/LTS](https://github.com/nodejs/LTS) <del> * [https://github.com/nodejs/citgm](https://github.com/nodejs/citgm) <add> * <https://github.com/nodejs/TSC> <add> * <https://github.com/nodejs/build> <add> * <https://github.com/nodejs/nodejs.org> <add> * <https://github.com/nodejs/readable-stream> <add> * <https://github.com/nodejs/LTS> <add> * <https://github.com/nodejs/citgm> <ide> * The OpenJS Foundation hosts regular summits for active contributors to the <ide> Node.js project, where we have face-to-face discussions about our work on the <ide> project. The Foundation has travel funds to cover participants' expenses
5
PHP
PHP
fix bug in type hint
187e239aede4d443827d9de77105d1d137a8e053
<ide><path>src/Illuminate/Foundation/Application.php <ide> protected function getStackedClient() <ide> /** <ide> * Merge the developer defined middlewares onto the stack. <ide> * <del> * @param \Symfony\Component\HttpKernel\HttpKernelInterface <add> * @param \Stack\Builder <ide> * @return void <ide> */ <del> protected function mergeCustomMiddlewares(HttpKernelInterface $client) <add> protected function mergeCustomMiddlewares($stack) <ide> { <ide> foreach ($this->middlewares as $key => $value) <ide> { <ide> $parameters = array_unshift($value, $key); <ide> <del> call_user_func_array(array($client, 'push'), $parameters); <add> call_user_func_array(array($stack, 'push'), $parameters); <ide> } <ide> } <ide>
1
PHP
PHP
add docblock to toilluminateresponse
83167a14ad2a378eaf9bc8b21acc14d0f9ceb445
<ide><path>src/Illuminate/Foundation/Exceptions/Handler.php <ide> <ide> use Exception; <ide> use Psr\Log\LoggerInterface; <add>use Illuminate\Http\Response; <ide> use Symfony\Component\HttpKernel\Exception\HttpException; <ide> use Symfony\Component\Console\Application as ConsoleApplication; <ide> use Symfony\Component\Debug\ExceptionHandler as SymfonyDisplayer; <ide> public function render($request, Exception $e) <ide> } <ide> } <ide> <del> protected function toIlluminateResponse($response, $e) <add> /** <add> * Map exception into an illuminate response. <add> * <add> * @param \Symfony\Component\HttpFoundation\Response $response <add> * @param \Exception $e <add> * @return \Illuminate\Http\Response <add> */ <add> protected function toIlluminateResponse($response, Exception $e) <ide> { <del> $response = new \Illuminate\Http\Response($response->getContent(), $response->getStatusCode(), $response->headers->all()); <add> $response = new Response($response->getContent(), $response->getStatusCode(), $response->headers->all()); <ide> <ide> $response->exception = $e; <ide>
1
Ruby
Ruby
simplify version comparison tests
23cc14f9a15da11bac6f3847887e91f129d29b7b
<ide><path>Library/Homebrew/test/test_versions.rb <ide> class VersionComparisonTests < Test::Unit::TestCase <ide> include VersionAssertions <ide> <ide> def test_version_comparisons <del> assert_version_comparison '0.1', '==', '0.1.0' <del> assert_version_comparison '0.1', '!=', '0.2' <del> assert_version_comparison '1.2.3', '>', '1.2.2' <del> assert_version_comparison '1.2.3-p34', '>', '1.2.3-p33' <del> assert_version_comparison '1.2.4', '<', '1.2.4.1' <del> assert_version_comparison 'HEAD', '==', 'HEAD' <del> assert_version_comparison 'HEAD', '>', '1.2.3' <del> assert_version_comparison '1.2.3', '<', 'HEAD' <del> assert_version_comparison '3.2.0b4', '<', '3.2.0' <del> assert_version_comparison '1.0beta6', '<', '1.0b7' <del> assert_version_comparison '1.0b6', '<', '1.0beta7' <del> assert_version_comparison '1.1alpha4', '<', '1.1beta2' <del> assert_version_comparison '1.1beta2', '<', '1.1rc1' <del> assert_nil Version.new('1.0') <=> 'foo' <add> assert_equal 0, version('0.1') <=> version('0.1.0') <add> assert_equal -1, version('0.1') <=> version('0.2') <add> assert_equal 1, version('1.2.3') <=> version('1.2.2') <add> assert_equal 1, version('1.2.3-p34') <=> version('1.2.3-p33') <add> assert_equal -1, version('1.2.4') <=> version('1.2.4.1') <add> assert_equal 0, version('HEAD') <=> version('HEAD') <add> assert_equal 1, version('HEAD') <=> version('1.2.3') <add> assert_equal -1, version('1.2.3') <=> version('HEAD') <add> assert_equal -1, version('3.2.0b4') <=> version('3.2.0') <add> assert_equal -1, version('1.0beta6') <=> version('1.0b7') <add> assert_equal -1, version('1.0b6') <=> version('1.0beta7') <add> assert_equal -1, version('1.1alpha4') <=> version('1.1beta2') <add> assert_equal -1, version('1.1beta2') <=> version('1.1rc1') <add> assert_equal -1, version('1.0.0beta7') <=> version('1.0.0') <add> assert_equal 1, version('3.2.1') <=> version('3.2beta4') <add> assert_nil version('1.0') <=> 'foo' <ide> end <ide> <ide> def test_macos_version_comparison <ide> class VersionParsingTests < Test::Unit::TestCase <ide> def test_pathname_version <ide> d = HOMEBREW_CELLAR/'foo-0.1.9' <ide> d.mkpath <del> assert_version_equal '0.1.9', d.version <add> assert_equal 0, version('0.1.9') <=> d.version <ide> end <ide> <ide> def test_no_version <ide><path>Library/Homebrew/test/testing_env.rb <ide> def shutup <ide> ENV.extend(HomebrewEnvExtension) <ide> <ide> module VersionAssertions <add> def version v <add> Version.new(v) <add> end <add> <ide> def assert_version_equal expected, actual <ide> assert_equal Version.new(expected), actual <ide> end <ide> def assert_version_detected expected, url <ide> def assert_version_nil url <ide> assert_nil Version.parse(url) <ide> end <del> <del> def assert_version_comparison a, comparison, b <del> eval "assert Version.new(a) #{comparison} Version.new(b)" <del> end <ide> end
2
Text
Text
add changes for 1.4.0-rc.1
c10b249e3d08b3bf27a871138d7f587a46b244cb
<ide><path>CHANGELOG.md <add><a name="v1.4.0-rc.1"></a> <add># v1.4.0-rc.1 Sartorial Chronography (2015-04-24) <add> <add> <add>## Bug Fixes <add> <add>- **$animate:** <add> - ensure that from styles are applied for class-based animations <add> ([8f819d2c](https://github.com/angular/angular.js/commit/8f819d2cb5c8025b25534529a6e897dc8805885b)) <add> - make sure the JS animation lookup is an object lookup <add> ([103a39ca](https://github.com/angular/angular.js/commit/103a39ca8dad0300bead15c358aad846510b2229), <add> [#11619](https://github.com/angular/angular.js/issues/11619)) <add>- **$animateCss:** ensure that rAF waiting loop doesn't ignore pending items during a flush <add> ([90e424b2](https://github.com/angular/angular.js/commit/90e424b206239e261024e8ef7fcac762236cd8b7)) <add>- **$http:** stop coercing falsy HTTP request bodies to null / empty body <add> ([e04a887c](https://github.com/angular/angular.js/commit/e04a887c9b506de18516600310fe6e529d9d2ca3), <add> [#11552](https://github.com/angular/angular.js/issues/11552), [#11593](https://github.com/angular/angular.js/issues/11593)) <add>- **ngAnimate:** <add> - close parent animations only when there are classes to resolve <add> ([1459be17](https://github.com/angular/angular.js/commit/1459be170dabfca40501dcf219dfced5ba513169)) <add> - ensure ngClass-based classes are always resolved for CSS-enabled animations <add> ([89f081e4](https://github.com/angular/angular.js/commit/89f081e452e9a75c2d3bf86bfef8b7f9bd1f2b0e)) <add> - do not abort animation if only `ng-anchor-in` is used <add> ([3333a5c3](https://github.com/angular/angular.js/commit/3333a5c380f830cba8efec5825cb6648f930f206)) <add> - ensure that a filtered-out leave animation always runs its DOM operation <add> ([6dd64ab5](https://github.com/angular/angular.js/commit/6dd64ab5f34fa19db8f90e6eabc810843089ba14), <add> [#11555](https://github.com/angular/angular.js/issues/11555)) <add> - ensure that animations work when the app is bootstrapped on the document node <add> ([bee14ed1](https://github.com/angular/angular.js/commit/bee14ed1e7b77ea7dc62326611380da36dec297e), <add> [#11574](https://github.com/angular/angular.js/issues/11574)) <add> - ensure SVG classes are properly removed <add> ([fa0bbded](https://github.com/angular/angular.js/commit/fa0bbded1ea040fbfdb1a4339e4a374fe9717a82)) <add>- **ngAria:** change accessibility keypress event to use event.which if it is provided <add> ([249f9b81](https://github.com/angular/angular.js/commit/249f9b81cbad5c57cf978a47842744aadd85cdb4), <add> [#11340](https://github.com/angular/angular.js/issues/11340)) <add>- **ngMessageFormat:** <add> - ensure bindings are valid for Protractor <add> ([992114f7](https://github.com/angular/angular.js/commit/992114f7a7f5f39778753e0c49458f14b6290ffc), <add> [#11644](https://github.com/angular/angular.js/issues/11644), [#11649](https://github.com/angular/angular.js/issues/11649)) <add> - minified symbol and nested required expression <add> ([8a45064f](https://github.com/angular/angular.js/commit/8a45064f2bdec13ba3de5b0a0785df76188ab172), <add> [#11414](https://github.com/angular/angular.js/issues/11414), [#11592](https://github.com/angular/angular.js/issues/11592)) <add>- **select:** allow empty option to be added dynamically by ng-repeat <add> ([abf59c28](https://github.com/angular/angular.js/commit/abf59c285c3ff6af20dbf4236eba5204ae735abb), <add> [#11470](https://github.com/angular/angular.js/issues/11470), [#11512](https://github.com/angular/angular.js/issues/11512)) <add> <add> <add>## Features <add> <add>- **$animate:** provide support for animations on elements outside of $rootElement <add> ([e41faaa2](https://github.com/angular/angular.js/commit/e41faaa2a155a42bcc66952497a6f33866878508)) <add> <add> <add> <add> <ide> <a name="v1.4.0-rc.0"></a> <ide> # v1.4.0-rc.0 smooth-unwinding (2015-04-10) <ide>
1
Javascript
Javascript
update string#objectat documentation
eaaa0927943dc2ecca30ae5415ab8b6ba653ad88
<ide><path>packages/ember-runtime/lib/mixins/array.js <ide> // License: Licensed under MIT license (see license.js) <ide> // ========================================================================== <ide> <del> <ide> require('ember-runtime/mixins/enumerable'); <ide> <del> <del> <ide> // .......................................................... <ide> // HELPERS <ide> // <ide> Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.protot <ide> /** <ide> @field {Number} length <ide> <del> Your array must support the length property. Your replace methods should <add> Your array must support the length property. Your replace methods should <ide> set this property whenever it changes. <ide> */ <ide> length: Ember.required(), <ide> <ide> /** <del> This is one of the primitives you must implement to support Ember.Array. <del> Returns the object at the named index. If your object supports retrieving <del> the value of an array item using get() (i.e. myArray.get(0)), then you do <del> not need to implement this method yourself. <add> Returns the object at the given index. If the given index is negative or <add> is greater or equal than the array length, returns `undefined`. <add> <add> This is one of the primitives you must implement to support `Ember.Array`. <add> If your object supports retrieving the value of an array item using `get()` <add> (i.e. `myArray.get(0)`), then you do not need to implement this method <add> yourself. <add> <add> var arr = ['a', 'b', 'c', 'd']; <add> arr.objectAt(0); => "a" <add> arr.objectAt(3); => "d" <add> arr.objectAt(-1); => undefined <add> arr.objectAt(4); => undefined <add> arr.objectAt(5); => undefined <ide> <ide> @param {Number} idx <del> The index of the item to return. If idx exceeds the current length, <del> return null. <add> The index of the item to return. <ide> */ <ide> objectAt: function(idx) { <ide> if ((idx < 0) || (idx>=get(this, 'length'))) return undefined ; <ide> Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.protot <ide> <ide> // Add any extra methods to Ember.Array that are native to the built-in Array. <ide> /** <del> Returns a new array that is a slice of the receiver. This implementation <add> Returns a new array that is a slice of the receiver. This implementation <ide> uses the observable array methods to retrieve the objects for the new <ide> slice. <ide> <ide> Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.protot <ide> return this.__each; <ide> }).property().cacheable() <ide> <del> <del> <ide> }) ; <del> <del> <del>
1
Python
Python
fix error getting floating ip instance_id
f33fcd6a6aaa119d557d29ca4db9e3b2a5d33a60
<ide><path>libcloud/compute/drivers/openstack.py <ide> def _to_floating_ip(self, obj): <ide> port.extra["mac_address"]} <ide> <ide> if 'port_details' in obj and obj['port_details']: <del> if obj['port_details']['device_owner'] == 'compute:nova': <add> if obj['port_details']['device_owner'] in ['compute:nova', <add> 'compute:Nona']: <ide> instance_id = obj['port_details']['device_id'] <ide> <ide> ip_address = obj['floating_ip_address']
1
Ruby
Ruby
serialize stdout on ci
869fb0214971f3dbcccbe1915702ffc7e7d69d16
<ide><path>Library/Homebrew/cask/cmd/brew-cask-tests.rb <ide> require "English" <ide> <ide> def run_tests(executable, files, args = []) <del> system "bundle", "exec", executable, "--", *args, "--", *files <add> opts = [] <add> opts << "--serialize-stdout" if ENV["CI"] <add> <add> system "bundle", "exec", executable, *opts, "--", *args, "--", *files <ide> end <ide> <ide> repo_root = Pathname(__FILE__).realpath.parent.parent <ide><path>Library/Homebrew/dev-cmd/tests.rb <ide> def tests <ide> <ide> files = Dir["test/test_*.rb"] <ide> files -= Dir["test/test_os_mac_*.rb"] unless OS.mac? <add> <add> opts = [] <add> opts << "--serialize-stdout" if ENV["CI"] <add> <ide> args = [] <ide> args << "--trace" if ARGV.include? "--trace" <add> <ide> if ARGV.value("only") <ide> ENV["HOMEBREW_TESTS_ONLY"] = "1" <ide> test_name, test_method = ARGV.value("only").split("/", 2) <ide> files = ["test/test_#{test_name}.rb"] <ide> args << "--name=test_#{test_method}" if test_method <ide> end <add> <ide> args += ARGV.named.select { |v| v[/^TEST(OPTS)?=/] } <del> system "bundle", "exec", "parallel_test", "--", *args, "--", *files <add> <add> system "bundle", "exec", "parallel_test", *opts, <add> "--", *args, "--", *files <ide> <ide> Homebrew.failed = !$?.success? <ide>
2
Go
Go
handle partial attachment entries during configure
454128c6e82cded211c1412e3eb350b1f7533ee2
<ide><path>daemon/cluster/executor/container/executor.go <ide> func (e *executor) Configure(ctx context.Context, node *api.Node) error { <ide> attachments := make(map[string]string) <ide> <ide> for _, na := range node.Attachments { <add> if na == nil || na.Network == nil || len(na.Addresses) == 0 { <add> // this should not happen, but we got a panic here and don't have a <add> // good idea about what the underlying data structure looks like. <add> logrus.WithField("NetworkAttachment", fmt.Sprintf("%#v", na)). <add> Warnf("skipping nil or malformed node network attachment entry") <add> continue <add> } <add> <ide> if na.Network.Spec.Ingress { <ide> ingressNA = na <ide> } <add> <ide> attachments[na.Network.ID] = na.Addresses[0] <ide> } <ide> <del> if (ingressNA == nil) && (node.Attachment != nil) { <add> if (ingressNA == nil) && (node.Attachment != nil) && (len(node.Attachment.Addresses) > 0) { <ide> ingressNA = node.Attachment <ide> attachments[ingressNA.Network.ID] = ingressNA.Addresses[0] <ide> }
1
Javascript
Javascript
restore check on atom_home
82f5e81cec2727013d3291907ddd04cc7ffd7a37
<ide><path>static/index.js <ide> console.error('Unhandled promise rejection %o with error: %o', promise, error) <ide> }) <ide> <add> // Ensure ATOM_HOME is always set before anything else is required <add> // This is because of a difference in Linux not inherited between browser and render processes <add> // issue #5142 <add> setupAtomHome() <add> <ide> // Normalize to make sure drive letter case is consistent on Windows <ide> process.resourcesPath = path.normalize(process.resourcesPath) <ide> <ide> require('ipc').sendChannel('window-command', 'window:loaded') <ide> } <ide> <add> function setupAtomHome () { <add> if (!process.env.ATOM_HOME) { <add> var home <add> if (process.platform === 'win32') { <add> home = process.env.USERPROFILE <add> } else { <add> home = process.env.HOME <add> } <add> var atomHome = path.join(home, '.atom') <add> try { <add> atomHome = fs.realpathSync(atomHome) <add> } catch (error) { <add> // Ignore since the path might just not exist yet. <add> } <add> process.env.ATOM_HOME = atomHome <add> } <add> } <add> <ide> function setupCsonCache (cacheDir) { <ide> require('season').setCacheDir(path.join(cacheDir, 'cson')) <ide> }
1
Python
Python
add exception for "gonna"
280c03f67b06836251edff32a2a0a5d320f34e52
<ide><path>spacy/en/language_data.py <ide> def get_time_exc(hours): <ide> {ORTH: "ma"} <ide> ], <ide> <add> "gonna": [ <add> {ORTH: "gon", LEMMA: "go"}, <add> {ORTH: "na", LEMMA: "to"} <add> ], <add> <add> "Gonna": [ <add> {ORTH: "Gon", LEMMA: "go"}, <add> {ORTH: "na", LEMMA: "to"} <add> ], <add> <ide> "whats": [ <ide> {ORTH: "what"}, <ide> {ORTH: "s"}
1
Javascript
Javascript
fix "missing flag" error for non-boolean types
0c3c27a718579066e08e1b2f5529deb67999e114
<ide><path>scripts/babel/__tests__/transform-test-gate-pragma-test.js <ide> describe('transform test-gate-pragma: actual runtime', () => { <ide> } <ide> }); <ide> <add> // @gate build === "development" <add> test('strings', () => { <add> if (!__DEV__) { <add> throw Error("Doesn't work in production!"); <add> } <add> }); <add> <ide> // Always should fail because of the unguarded console.error <ide> // @gate false <ide> test('works with console.error tracking', () => { <ide><path>scripts/jest/TestFlags.js <ide> function getTestFlags() { <ide> { <ide> get(flags, flagName) { <ide> const flagValue = flags[flagName]; <del> if (typeof flagValue !== 'boolean' && typeof flagName === 'string') { <add> if (flagValue === undefined && typeof flagName === 'string') { <ide> throw Error( <ide> `Feature flag "${flagName}" does not exist. See TestFlags.js ` + <ide> 'for more details.'
2
Ruby
Ruby
eliminate special case for core gcc
3f11f1a0def50bba3349c0dc948f84c8bc82eb04
<ide><path>Library/Homebrew/extend/ENV/shared.rb <ide> def warn_about_non_apple_gcc(name) <ide> EOS <ide> end <ide> <del> if gcc_formula.name == "gcc" <del> return if gcc_formula.opt_prefix.exist? <add> unless gcc_formula.opt_prefix.exist? <ide> raise <<-EOS.undent <del> The Homebrew GCC was not installed. <del> You must: <del> brew install gcc <del> EOS <del> end <del> <del> if !gcc_formula.opt_prefix.exist? <del> raise <<-EOS.undent <del> The requested Homebrew GCC, #{gcc_version_name}, was not installed. <del> You must: <del> brew tap homebrew/versions <del> brew install #{gcc_version_name} <add> The requested Homebrew GCC was not installed. You must: <add> brew install #{gcc_formula.full_name} <ide> EOS <ide> end <ide> end
1
PHP
PHP
fix cs error
34115e8412001abb63a414b24563e6f5a79b3efb
<ide><path>src/Shell/Task/CommandTask.php <ide> public function getShell(string $commandName) <ide> $pluginDot = ''; <ide> } <ide> <del> if (!in_array($commandName, $this->commands(), true) && (empty($pluginDot) && !in_array($name, $this->commands(), true))) { <add> if (!in_array($commandName, $this->commands(), true) <add> && empty($pluginDot) <add> && !in_array($name, $this->commands(), true) <add> ) { <ide> return false; <ide> } <ide>
1
Javascript
Javascript
make a list of known globals
feea1330cc3858a5aa65f2072a6025cb5ca0cd56
<ide><path>src/node.js <ide> var events = module.requireNative('events'); <ide> // Signal Handlers <ide> (function() { <ide> var signalWatchers = {}; <del> addListener = process.addListener, <del> removeListener = process.removeListener; <add> var addListener = process.addListener; <add> var removeListener = process.removeListener; <ide> <ide> function isSignal (event) { <ide> return event.slice(0, 3) === 'SIG' && process.hasOwnProperty(event); <ide><path>test/simple/test-global-leak.js <add>var assert = require('assert'); <add> <add>var knownGlobals = [ setTimeout <add> , setInterval <add> , clearTimeout <add> , clearInterval <add> , console <add> , Buffer <add> , process <add> , global <add> , __module <add> , include <add> , puts <add> , print <add> , p <add> ]; <add> <add>for (var x in global) { <add> var found = false; <add> <add> for (var y in knownGlobals) { <add> if (global[x] === knownGlobals[y]) { <add> found = true; <add> break; <add> } <add> } <add> <add> if (!found) { <add> console.error("Unknown global: %s", x); <add> assert.ok(false); <add> } <add>}
2
Ruby
Ruby
fix upgrading dependents on missing keg
ffe827ad0e63dfbeed357b50916fe404409176a4
<ide><path>Library/Homebrew/formula.rb <ide> def self.each(&block) <ide> end <ide> end <ide> <del> # Clear cache of .racks <del> def self.clear_racks_cache <del> @racks = nil <del> end <del> <del> # Clear caches of .racks and .installed. <del> def self.clear_installed_formulae_cache <del> clear_racks_cache <del> @installed = nil <del> end <del> <ide> # An array of all racks currently installed. <ide> # @private <ide> def self.racks <del> @racks ||= if HOMEBREW_CELLAR.directory? <add> Formula.cache[:racks] ||= if HOMEBREW_CELLAR.directory? <ide> HOMEBREW_CELLAR.subdirs.reject do |rack| <ide> rack.symlink? || rack.basename.to_s.start_with?(".") || rack.subdirs.empty? <ide> end <ide> def self.racks <ide> # An array of all installed {Formula} <ide> # @private <ide> def self.installed <del> @installed ||= racks.flat_map do |rack| <add> Formula.cache[:installed] ||= racks.flat_map do |rack| <ide> Formulary.from_rack(rack) <ide> rescue <ide> [] <ide><path>Library/Homebrew/formula_installer.rb <ide> def build <ide> end <ide> <ide> def link(keg) <add> Formula.clear_cache <add> <ide> unless link_keg <ide> begin <ide> keg.optlink(verbose: verbose?) <del> Formula.clear_cache <ide> rescue Keg::LinkError => e <ide> onoe "Failed to create #{formula.opt_prefix}" <ide> puts "Things that depend on #{formula.full_name} will probably not build." <ide><path>Library/Homebrew/tab.rb <ide> def to_json(options = nil) <ide> def write <ide> # If this is a new installation, the cache of installed formulae <ide> # will no longer be valid. <del> Formula.clear_installed_formulae_cache unless tabfile.exist? <add> Formula.clear_cache unless tabfile.exist? <ide> <ide> self.class.cache[tabfile] = self <ide> tabfile.atomic_write(to_json) <ide><path>Library/Homebrew/test/keg_spec.rb <ide> def setup_test_keg(name, version) <ide> end <ide> <ide> specify "::all" do <del> Formula.clear_racks_cache <ide> expect(described_class.all).to eq([keg]) <ide> end <ide> <ide><path>Library/Homebrew/upgrade.rb <ide> def check_broken_dependents(installed_formulae) <ide> .select do |f| <ide> keg = f.any_installed_keg <ide> next unless keg <add> next unless keg.directory? <ide> <ide> LinkageChecker.new(keg, cache_db: db) <ide> .broken_library_linkage? <ide> def check_installed_dependents(args:) <ide> <ide> upgrade_formulae(upgradeable_dependents, args: args) <ide> <del> # Refresh installed formulae after upgrading <add> # Update installed formulae after upgrading <ide> installed_formulae = FormulaInstaller.installed.to_a <ide> <ide> # Assess the dependents tree again now we've upgraded.
5
Text
Text
update stream.io link
73f3325f80a381d1d62ab1b84956295963f445ed
<ide><path>README.md <ide> Please see the [security policy][security-policy]. <ide> [bitio-img]: https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/bitio-readme.png <ide> <ide> [sentry-url]: https://getsentry.com/welcome/ <del>[stream-url]: https://getstream.io/try-the-api/?utm_source=drf&utm_medium=banner&utm_campaign=drf <add>[stream-url]: https://getstream.io/?utm_source=drf&utm_medium=sponsorship&utm_content=developer <ide> [rollbar-url]: https://rollbar.com/?utm_source=django&utm_medium=sponsorship&utm_campaign=freetrial <ide> [esg-url]: https://software.esg-usa.com/ <ide> [retool-url]: https://retool.com/?utm_source=djangorest&utm_medium=sponsorship <ide><path>docs/index.md <ide> continued development by **[signing up for a paid plan][funding]**. <ide> </ul> <ide> <div style="clear: both; padding-bottom: 20px;"></div> <ide> <del>*Many thanks to all our [wonderful sponsors][sponsors], and in particular to our premium backers, [Sentry](https://getsentry.com/welcome/), [Stream](https://getstream.io/?utm_source=drf&utm_medium=banner&utm_campaign=drf), [ESG](https://software.esg-usa.com/), [Rollbar](https://rollbar.com/?utm_source=django&utm_medium=sponsorship&utm_campaign=freetrial), [Cadre](https://cadre.com), [Kloudless](https://hubs.ly/H0f30Lf0), [Lights On Software](https://lightsonsoftware.com), [Retool](https://retool.com/?utm_source=djangorest&utm_medium=sponsorship), and [bit.io](https://bit.io/jobs?utm_source=DRF&utm_medium=sponsor&utm_campaign=DRF_sponsorship).* <add>*Many thanks to all our [wonderful sponsors][sponsors], and in particular to our premium backers, [Sentry](https://getsentry.com/welcome/), [Stream](https://getstream.io/?utm_source=drf&utm_medium=sponsorship&utm_content=developer), [ESG](https://software.esg-usa.com/), [Rollbar](https://rollbar.com/?utm_source=django&utm_medium=sponsorship&utm_campaign=freetrial), [Cadre](https://cadre.com), [Kloudless](https://hubs.ly/H0f30Lf0), [Lights On Software](https://lightsonsoftware.com), [Retool](https://retool.com/?utm_source=djangorest&utm_medium=sponsorship), and [bit.io](https://bit.io/jobs?utm_source=DRF&utm_medium=sponsor&utm_campaign=DRF_sponsorship).* <ide> <ide> --- <ide>
2
Text
Text
update changelog properly with gh [ci-skip]
0f156100a2d25fba820016c684cbc3d3fadbc1bd
<ide><path>actionpack/CHANGELOG.md <add>* Add `:serializer` option for `config.session_store :cookie_store`. This <add> changes default serializer when using `:cookie_store` to <add> `ActionDispatch::Session::MarshalSerializer` which is wrapper on Marshal. <add> <add> It is also possible to pass: <add> <add> * `:json_serializer` which is secure wrapper on JSON using `JSON.parse` and <add> `JSON.generate` methods with quirks mode; <add> * any other Symbol or String like `:my_custom_serializer` which will be <add> camelized and constantized in `ActionDispatch::Session` namespace; <add> * serializer object with `load` and `dump` methods defined. <add> <add> *Łukasz Sarnacki + Matt Aimonetti* <add> <ide> * Ensure that `request.filtered_parameters` is reset between calls to `process` <ide> in `ActionController::TestCase`. <ide> <ide> <ide> *Alessandro Diaferia* <ide> <del>* Add `:serializer` option for `config.session_store :cookie_store`. This <del> changes default serializer when using `:cookie_store` to <del> `ActionDispatch::Session::MarshalSerializer` which is wrapper on Marshal. <del> <del> It is also possible to pass: <del> <del> * `:json_serializer` which is secure wrapper on JSON using `JSON.parse` and <del> `JSON.generate` methods with quirks mode; <del> * any other Symbol or String like `:my_custom_serializer` which will be <del> camelized and constantized in `ActionDispatch::Session` namespace; <del> * serializer object with `load` and `dump` methods defined. <del> <del> *Łukasz Sarnacki* <del> <ide> * Allow an absolute controller path inside a module scope. Fixes #12777. <ide> <ide> Example:
1
Go
Go
fix empty-lines (revive)
b04f1416f603f9f727dd921092feb82e47d6348b
<ide><path>opts/address_pools_test.go <ide> func TestAddressPoolOpt(t *testing.T) { <ide> if err := poolopt.Set(invalidAddresspoolString); err == nil { <ide> t.Fatal(err) <ide> } <del> <ide> } <ide><path>opts/opts_test.go <ide> func TestValidateIPAddress(t *testing.T) { <ide> if ret, err := ValidateIPAddress(`random invalid string`); err == nil || ret != "" { <ide> t.Fatalf("ValidateIPAddress(`random invalid string`) got %s %s", ret, err) <ide> } <del> <ide> } <ide> <ide> func TestMapOpts(t *testing.T) { <ide> func TestListOptsWithoutValidator(t *testing.T) { <ide> if len(mapListOpts) != 1 { <ide> t.Errorf("Expected [map[bar:{}]], got [%v]", mapListOpts) <ide> } <del> <ide> } <ide> <ide> func TestListOptsWithValidator(t *testing.T) { <ide> func TestValidateLabel(t *testing.T) { <ide> assert.Check(t, is.Equal(result, testCase.expectedResult)) <ide> } <ide> }) <del> <ide> } <ide> } <ide>
2
Javascript
Javascript
add a port validation to `connect`
d80d131c75d7defa06845d7daa634c4d51515e0c
<ide><path>lib/net.js <ide> function connect(self, address, port, addressType, localAddress) { <ide> } <ide> <ide> var req = { oncomplete: afterConnect }; <del> if (addressType == 6) { <del> err = self._handle.connect6(req, address, port); <del> } else if (addressType == 4) { <del> err = self._handle.connect(req, address, port); <add> if (addressType === 6 || addressType === 4) { <add> port = port | 0; <add> if (port <= 0 || port > 65535) <add> throw new RangeError('Port should be > 0 and < 65536'); <add> <add> if (addressType === 6) { <add> err = self._handle.connect6(req, address, port); <add> } else if (addressType === 4) { <add> err = self._handle.connect(req, address, port); <add> } <ide> } else { <ide> err = self._handle.connect(req, address, afterConnect); <ide> } <ide><path>test/simple/test-net-create-connection.js <ide> server.listen(tcpPort, 'localhost', function() { <ide> net.createConnection(tcpPort, 'localhost').on('connect', cb); <ide> net.createConnection(tcpPort, cb); <ide> net.createConnection(tcpPort, 'localhost', cb); <add> <add> assert.throws(function () { <add> net.createConnection({ <add> port: 'invalid!' <add> }, cb); <add> }); <ide> }); <ide> <ide> process.on('exit', function() {
2