To run:
npx jscodeshift ./src -t ./shifter.ts --extensions=tsx --parser=tsx -p
Not covered cases:
import capitalize from '@mui/utils/capitalize’;
To run:
npx jscodeshift ./src -t ./shifter.ts --extensions=tsx --parser=tsx -p
Not covered cases:
import capitalize from '@mui/utils/capitalize’;
// @ts-check | |
const fs = require('fs'); | |
const path = require('path'); | |
const os = require('os'); | |
var { spawn } = require('child_process'); | |
const systemCpuCores = os.cpus(); | |
const pathToArtifacts = path.join(__dirname, '..', 'build', 'assets'); | |
const processes = systemCpuCores.length > 1 ? systemCpuCores.length - 1 : 1; |
class Foo { | |
constructor () { | |
if (this.hasQuestion) { | |
alert(42); | |
} | |
} | |
} | |
import SecondComponent from 'foo/bar'; | |
function MyComponent(args) { return { a: 1, b: 2, c: args.e } } | |
function hasHelperManagerFor() { | |
return true; | |
} | |
function hasComponentManagerFor() { |
import { get } from 'lodash'; | |
const permissions = { | |
study: { | |
see: ['STUDY_MANAGER', 'DATA_ENTRY', 'ADMIN'], | |
create: ['DATA_ENTRY', 'ADMIN'], | |
edit: ['STUDY_DIRECTOR', 'DATA_ENTRY', 'ADMIN'], | |
} | |
} |
import { createTemplate, setComponentTemplate, templateOnlyComponent } from '@glimmer/core'; | |
export default setComponentTemplate( | |
createTemplate(`<h1 ...attributes>AMA LAZY [{{@name}}]</h1>`), | |
templateOnlyComponent() | |
); |
let EmberCore; | |
try { | |
EmberCore = requireModule('ember')['default']; | |
} catch { | |
EmberCore = window.Ember; | |
} | |
const keys = ['application','engine']; | |
//const isEmberApp = (el) => el._debugContainerKey && keys.includes(el._debugContainerKey.split(':')[0]); |
import path from 'path'; | |
import os from 'os'; | |
import fs from 'fs-extra'; | |
// https://github.com/embroider-build/embroider/blob/main/PORTING-ADDONS-TO-V2.md | |
async function migrate(entry) { | |
const { default: walkSync } = await import('walk-sync'); | |
const files = () => walkSync(entry, { | |
ignore: [ | |
'.git', |
// A launch configuration that compiles the extension and then opens it inside a new window | |
{ | |
"version": "0.1.0", | |
"configurations": [ | |
{ | |
"name": "Attach by Process ID", | |
"processId": "${command:PickProcess}", | |
"request": "attach", | |
"resolveSourceMapLocations": null, | |
"sourceMaps": true, |
'use strict'; | |
const EmberApp = require('ember-cli/lib/broccoli/ember-app'); | |
module.exports = function (defaults) { | |
let app = new EmberApp(defaults, {}); | |
// we need to add emebr-template-compiler into runtime | |
app.import('node_modules/ember-source/dist/ember-template-compiler.js'); |