Skip to content

Commit

Permalink
chore(): remove TS transformer (#8660)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaMan123 authored Feb 5, 2023
1 parent 9258628 commit 0d26eea
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 583 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## [next]

- ci(): remove TS transformer [#8660](https://github.com/fabricjs/fabric.js/pull/8660)
- refactor(): BREAKING remove stateful mixin and functionality [#8663](https://github.com/fabricjs/fabric.js/pull/8663)
- patch(): Added WebGLProbe to env, removed isLikelyNode, added specific env dispose ( instead of cleanup JSDOM ) [#8652](https://github.com/fabricjs/fabric.js/pull/8652)
- ci(): Removed the browser publish script [#8656](https://github.com/fabricjs/fabric.js/pull/8656)
Expand Down
79 changes: 0 additions & 79 deletions scripts/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import os from 'os';
import { build } from './build.mjs';
import { awaitBuild } from './buildLock.mjs';
import { CLI_CACHE, wd } from './dirname.mjs';
import { listFiles, transform as transformFiles } from './transform_files.mjs';

const program = new commander.Command();

Expand Down Expand Up @@ -389,42 +388,6 @@ function createChoiceData(type, file) {
};
}

async function selectFileToTransform() {
const files = _.map(listFiles(), ({ dir, file }) =>
createChoiceData(
path.relative(path.resolve(wd, 'src'), dir).replaceAll('\\', '/'),
file
)
);
const { tests: filteredTests } = await inquirer.prompt([
{
type: 'test-selection',
name: 'tests',
message: 'Select files to transform to es6',
highlight: true,
searchable: true,
default: [],
pageSize: 10,
source(answersSoFar, input = '') {
return new Promise((resolve) => {
const value = _.map(this.getCurrentValue(), (value) =>
createChoiceData(value.type, value.file)
);
const res = fuzzy
.filter(input, files, {
extract: (item) => item.name,
})
.map((element) => element.original);
resolve(value.concat(_.differenceBy(res, value, 'name')));
});
},
},
]);
return filteredTests.map(({ type, file }) =>
path.resolve(wd, 'src', type, file)
);
}

async function selectTestFile() {
const selected = readCLIFile();
const unitTests = listTestFiles('unit').map((file) =>
Expand Down Expand Up @@ -634,46 +597,4 @@ website
.option('-w, --watch')
.action(exportToWebsite);

program
.command('transform')
.description('transforms files into es6')
.option('-o, --overwrite', 'overwrite exisitng files', false)
.option('-x, --no-exports', 'do not use exports')
.option('-i, --index', 'create index files', false)
.option('-ts, --typescript', 'transform into typescript', false)
.option('-v, --verbose', 'verbose logging', true)
.option('-a, --all', 'transform all files', false)
.option(
'-d, --diff <branch>',
'compare against given branch (default: master) and transform all files with diff'
)
.action(
async ({
overwrite,
exports,
index,
typescript,
verbose,
all,
diff: gitRef,
} = {}) => {
let files = [];
if (gitRef) {
gitRef = gitRef === true ? 'master' : gitRef;
const { changes } = getGitInfo(gitRef);
files = changes.map((change) => path.resolve(wd, change));
} else if (!all) {
files = await selectFileToTransform();
}
transformFiles({
overwriteExisitingFiles: overwrite,
useExports: exports,
createIndex: index,
ext: typescript ? 'ts' : 'js',
verbose,
files,
});
}
);

program.parse(process.argv);
Loading

0 comments on commit 0d26eea

Please sign in to comment.