Skip to content

Commit

Permalink
Rename all files from .js to .ts
Browse files Browse the repository at this point in the history
  • Loading branch information
queengooborg committed Jun 7, 2022
1 parent 69e190a commit 5bdc6a2
Show file tree
Hide file tree
Showing 64 changed files with 117 additions and 117 deletions.
2 changes: 1 addition & 1 deletion .c8rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"**/.nyc_output/**",
"**/coverage/**",
"**/node_modules/**",
"**/**.test.js"
"**/**.test.ts"
]
}
2 changes: 1 addition & 1 deletion index.js → index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { fileURLToPath } from 'node:url';

import { fdir } from 'fdir';

import extend from './scripts/lib/extend.js';
import extend from './scripts/lib/extend';

const dirname = fileURLToPath(new URL('.', import.meta.url));

Expand Down
2 changes: 1 addition & 1 deletion scripts/diff-features.js → scripts/diff-features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function enumerateFeatures(ref = 'HEAD') {
// If the clean install fails, proceed anyways
}

execSync(`node ./scripts/enumerate-features.js --data-from=${worktree}`);
execSync(`ts-node ./scripts/enumerate-features --data-from=${worktree}`);

return JSON.parse(fs.readFileSync('.features.json', { encoding: 'utf-8' }));
} finally {
Expand Down
2 changes: 1 addition & 1 deletion scripts/diff.js → scripts/diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import chalk from 'chalk-template';
import deepDiff from 'deep-diff';
import esMain from 'es-main';

import { getMergeBase, getFileContent, getGitDiffStatuses } from './lib/git.js';
import { getMergeBase, getFileContent, getGitDiffStatuses } from './lib/git';

// Note: This does not detect renamed files
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import esMain from 'es-main';
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';

import { walk } from '../utils/index.js';
import { walk } from '../utils';

function main({ dest, dataFrom }) {
fs.writeFileSync(dest, JSON.stringify(enumerateFeatures(dataFrom)));
Expand All @@ -18,7 +18,7 @@ function enumerateFeatures(dataFrom) {
const feats = [];

const walker = dataFrom
? walk(undefined, import(path.join(process.cwd(), dataFrom, 'index.js')))
? walk(undefined, import(path.join(process.cwd(), dataFrom, 'index.ts')))
: walk();

for (const { path, compat } of walker) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import fs from 'node:fs';

import { IS_WINDOWS } from '../../test/utils.js';
import { IS_WINDOWS } from '../../test/utils';

/**
* @typedef {import('../../types').Identifier} Identifier
Expand Down
4 changes: 2 additions & 2 deletions scripts/fix/feature-order.js → scripts/fix/feature-order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import fs from 'node:fs';

import compareFeatures from '../lib/compare-features.js';
import { IS_WINDOWS } from '../../test/utils.js';
import compareFeatures from '../lib/compare-features';
import { IS_WINDOWS } from '../../test/utils';

/**
* @typedef {import('../../types').Identifier} Identifier
Expand Down
12 changes: 6 additions & 6 deletions scripts/fix/index.js → scripts/fix/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import path from 'node:path';
import { fileURLToPath } from 'node:url';
import esMain from 'es-main';

import fixBrowserOrder from './browser-order.js';
import fixFeatureOrder from './feature-order.js';
import fixPropertyOrder from './property-order.js';
import fixStatementOrder from './statement-order.js';
import fixLinks from './links.js';
import fixStatus from './status.js';
import fixBrowserOrder from './browser-order';
import fixFeatureOrder from './feature-order';
import fixPropertyOrder from './property-order';
import fixStatementOrder from './statement-order';
import fixLinks from './links';
import fixStatus from './status';

const dirname = fileURLToPath(new URL('.', import.meta.url));

Expand Down
4 changes: 2 additions & 2 deletions scripts/fix/links.js → scripts/fix/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import fs from 'node:fs';

import { IS_WINDOWS } from '../../test/utils.js';
import { processData } from '../../test/linter/test-links.js';
import { IS_WINDOWS } from '../../test/utils';
import { processData } from '../../test/linter/test-links';

/**
* @param {string} filename
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import fs from 'node:fs';

import { IS_WINDOWS } from '../../test/utils.js';
import { IS_WINDOWS } from '../../test/utils';

const propOrder = {
__compat: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

import fs from 'node:fs';

import { IS_WINDOWS } from '../../test/utils.js';
import { IS_WINDOWS } from '../../test/utils';

import compareStatements from '../lib/compare-statements.js';
import compareStatements from '../lib/compare-statements';

/**
* Return a new "support_block" object whose support statements have
Expand Down
2 changes: 1 addition & 1 deletion scripts/fix/status.js → scripts/fix/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { readFileSync, writeFileSync } from 'node:fs';

import { IS_WINDOWS } from '../../test/utils.js';
import { IS_WINDOWS } from '../../test/utils';

const fixStatusContradiction = (key, value) => {
const status = value?.__compat?.status;
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate-types.js → scripts/generate-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import fs from 'node:fs/promises';
import esMain from 'es-main';
import { compileFromFile } from 'json-schema-to-typescript';

import bcd from '../index.js';
import bcd from '../index';

const opts = {
bannerComment: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import assert from 'node:assert/strict';

import compareFeatures from './compare-features.js';
import compareFeatures from './compare-features';

describe('compare-features script', () => {
it('`compareFeatures()` works correctly', () => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import assert from 'node:assert/strict';

import compareStatements from './compare-statements.js';
import compareStatements from './compare-statements';

const tests = [
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import assert from 'node:assert/strict';

import { removeWebViewFlags } from './002-remove-webview-flags.js';
import { removeWebViewFlags } from './002-remove-webview-flags';

/**
* @typedef {import('../../types').Identifier} Identifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { fileURLToPath } from 'node:url';

import esMain from 'es-main';

import { IS_WINDOWS } from '../../test/utils.js';
import { IS_WINDOWS } from '../../test/utils';

const dirname = fileURLToPath(new URL('.', import.meta.url));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

const { exec } = require('child_process');

exec('node scripts/fix-statement-order.js');
exec('node scripts/fix-statement-order');
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import assert from 'node:assert/strict';

import { fixExperimental } from './007-experimental-false.js';
import { fixExperimental } from './007-experimental-false';

describe('fixExperimental()', () => {
it('chrome + firefox + safari', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import path from 'node:path';
import { fileURLToPath } from 'node:url';
import esMain from 'es-main';

import { walk } from '../../utils/index.js';
import { walk } from '../../utils/index';

import bcd from '../../index.js';
import bcd from '../../index';
const { browsers } = bcd;

const dirname = fileURLToPath(new URL('.', import.meta.url));
Expand Down
8 changes: 4 additions & 4 deletions scripts/release/build.js → scripts/release/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import path from 'node:path';
import esMain from 'es-main';
import stringify from 'fast-json-stable-stringify';

import bumpData from './mirror.js';
import compileTS from '../generate-types.js';
import { walk } from '../../utils/index.js';
import bumpData from './mirror';
import compileTS from '../generate-types';
import { walk } from '../../utils/index';

const packageJson = JSON.parse(
await fs.readFile(new URL('../../package.json', import.meta.url), 'utf-8'),
Expand All @@ -21,7 +21,7 @@ const verbatimFiles = ['LICENSE', 'README.md'];

// Returns a string representing data ready for writing to JSON file
async function createDataBundle() {
const { default: bcd } = await import('../../index.js');
const { default: bcd } = await import('../../index');

const walker = walk(undefined, bcd);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import assert from 'node:assert/strict';

import { getMatchingBrowserVersion } from './mirror.js';
import { getMatchingBrowserVersion } from './mirror';

describe('mirror', () => {
describe('getMatchingBrowserVersion()', () => {
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/mirror.js → scripts/release/mirror.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import compareVersions from 'compare-versions';

import bcd from '../../index.js';
import bcd from '../../index';
const { browsers } = bcd;

/**
Expand Down
4 changes: 2 additions & 2 deletions scripts/release/notes.js → scripts/release/notes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import {
releaseYargsBuilder,
requireGitHubCLI,
buildQuery,
} from './utils.js';
import diffFeatures from '../diff-features.js';
} from './utils';
import diffFeatures from '../diff-features';

function main(argv) {
const { startVersionTag, endVersionTag } = argv;
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/pulls.js → scripts/release/pulls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import esMain from 'es-main';
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';

import { buildQuery, getRefDate, releaseYargsBuilder } from './utils.js';
import { buildQuery, getRefDate, releaseYargsBuilder } from './utils';

const pullsBaseURL = new URL(
'https://github.com/mdn/browser-compat-data/pulls',
Expand Down
4 changes: 2 additions & 2 deletions scripts/release/stats.js → scripts/release/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import esMain from 'es-main';
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';

import { exec, releaseYargsBuilder } from './utils.js';
import { walk } from '../../utils/index.js';
import { exec, releaseYargsBuilder } from './utils';
import { walk } from '../../utils/index';

const { argv } = yargs(hideBin(process.argv)).command(
'$0 [start-version-tag [end-version-tag]]',
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions scripts/statistics.js → scripts/statistics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import esMain from 'es-main';
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';

import bcd from '../index.js';
import bcd from '../index';

import { getRefDate } from './release/utils.js';
import { getRefDate } from './release/utils';

/** @type {string[]} */
const webextensionsBrowsers = [
Expand Down
2 changes: 1 addition & 1 deletion scripts/traverse.js → scripts/traverse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import esMain from 'es-main';
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';

import bcd from '../index.js';
import bcd from '../index';

/**
* @typedef {import('../../types').Identifier} Identifier
Expand Down
8 changes: 4 additions & 4 deletions test/lint.js → test/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
import chalk from 'chalk-template';

import linters from './linter/index.js';
import extend from '../scripts/lib/extend.js';
import { walk } from '../utils/index.js';
import { pluralize } from './utils.js';
import linters from './linter/index';
import extend from '../scripts/lib/extend';
import { walk } from '../utils/index';
import { pluralize } from './utils';

const dirname = fileURLToPath(new URL('.', import.meta.url));

Expand Down
34 changes: 0 additions & 34 deletions test/linter/index.js

This file was deleted.

34 changes: 34 additions & 0 deletions test/linter/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* This file is a part of @mdn/browser-compat-data
* See LICENSE file for more information. */

import { Linters } from '../utils';

import testBrowsersData from './test-browsers-data';
import testBrowsersPresence from './test-browsers-presence';
import testConsistency from './test-consistency';
import testDescriptions from './test-descriptions';
import testLinks from './test-links';
import testNotes from './test-notes';
import testObsolete from './test-obsolete';
import testPrefix from './test-prefix';
import testSchema from './test-schema';
import testSpecURLs from './test-spec-urls';
import testStatus from './test-status';
import testStyle from './test-style';
import testVersions from './test-versions';

export default new Linters([
testBrowsersData,
testBrowsersPresence,
testConsistency,
testDescriptions,
testLinks,
testNotes,
testObsolete,
testPrefix,
testSchema,
testSpecURLs,
testStatus,
testStyle,
testVersions,
]);
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import chalk from 'chalk-template';

import bcd from '../../index.js';
import bcd from '../../index';
const { browsers } = bcd;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import chalk from 'chalk-template';

import bcd from '../../index.js';
import bcd from '../../index';
const { browsers } = bcd;

/**
Expand Down

0 comments on commit 5bdc6a2

Please sign in to comment.