This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { MigrateUpArgs, MigrateDownArgs } from '@payloadcms/db-mongodb'; | |
import { Field, RichTextField, BlockField } from 'payload/dist/fields/config/types'; | |
import { CollectionModel } from '@payloadcms/db-mongodb/dist/types'; | |
/** | |
* Migration steps: | |
* 1. Go and change all your fields to `richText` instead of plugin's wrapper | |
* 2. Run a migration | |
* | |
* This migration supports: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run it in the place where is your `lingui.config` is located | |
# ts-node ./migrate.ts | |
import { | |
CatalogType, | |
ExtractedMessageType, | |
getConfig, | |
LinguiConfigNormalized, | |
MessageType, | |
} from "@lingui/conf" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const webpack = require('webpack'); | |
const os = require('os'); | |
const rimraf = require('rimraf'); | |
const helpers = require('../helpers'); | |
const gutil = require('gulp-util'); | |
const argv = require('process').argv; | |
const fs = require('fs'); | |
const path = require('path'); | |
const {statsToString, statsErrorsToString, statsWarningsToString} = require('../stats'); | |
const {getEmittedFiles} = require('@angular-devkit/build-webpack/src/utils'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports = function (file, api, options) { | |
const j = api.jscodeshift; | |
const source = j(file.source); | |
const body = source.find(j.Program).get('body'); | |
delete body.value[0].comments; | |
let jobDone = false; | |
const classConstructor = source.find(j.FunctionDeclaration, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports = function (file, api) { | |
const j = api.jscodeshift; | |
const source = j(file.source); | |
const body = source.find(j.Program).get('body'); | |
delete body.value[0].comments; | |
let jobDone = false; | |
const factoryCall = source.find(j.CallExpression, (node) => ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#set($cmpName = "") | |
#foreach($str in $NAME.split("-")) | |
#set($str = $str.substring(0,1).toUpperCase()+$str.substring(1)) | |
#set($cmpName = $cmpName + $str) | |
#end | |
import React, { Component } from 'react'; | |
import PropTypes from 'prop-types'; | |
export class ${cmpName} extends Component { | |
static propTypes = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path'); | |
var fs = require('fs'); | |
module.exports = function (file, api, options) { | |
const j = api.jscodeshift; | |
const ast = j(file.source); | |
const body = ast.find(j.Program).get('body'); | |
// Find each angular.<method>() usage | |
var moduleUsages = ast.find(j.CallExpression, isModuleExpression) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (file, api) { | |
const j = api.jscodeshift; | |
const ast = j(file.source); | |
const body = ast.find(j.Program).get('body'); | |
// Find each angular.<method>() usage | |
var angularUsages = ast.find(j.MemberExpression, isAngularExpression); | |
if (angularUsages.length === 0) { | |
return null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(fileInfo, { jscodeshift: j }) { | |
const ast = j(fileInfo.source); | |
const body = ast.find(j.Program).get("body"); | |
const getFirstNode = () => ast.find(j.Program).get('body', 0).node; | |
// Save the comments attached to the first node | |
const firstNode = getFirstNode(); | |
const { comments } = firstNode; | |
ast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#set($ctrlName = "") | |
#foreach($str in $NAME.split("-")) | |
#set($str = $str.substring(0,1).toUpperCase()+$str.substring(1)) | |
#set($ctrlName = $ctrlName + $str) | |
#end | |
#set($ctrlName = $ctrlName.replaceFirst("\.component", "")) | |
#set($directiveName = $ctrlName.substring(0,1).toLowerCase()+$ctrlName.substring(1)) | |
export default function(ngModule: ng.IModule) { | |
ngModule.component('${directiveName}', { | |
controllerAs: 'ctrl', |