1
0
Fork 0

fix: use module imports, upgrade js-utils to module

This commit is contained in:
Sean Sube 2022-10-08 15:56:30 -05:00
parent f6ef1f4b35
commit ceda879c1d
11 changed files with 23 additions and 24 deletions

View File

@ -15,7 +15,7 @@
"author": "ssube",
"license": "MIT",
"devDependencies": {
"@apextoaster/js-utils": "0.5.0-0",
"@apextoaster/js-utils": "0.5.0-1",
"@istanbuljs/nyc-config-typescript": "1.0.2",
"@istanbuljs/schema": "0.1.3",
"@microsoft/api-documenter": "7.19.16",

View File

@ -1,4 +1,4 @@
import { VERSION_INFO } from './version';
import { VERSION_INFO } from './version.js';
export async function main(argv: Array<string>): Promise<number> {
/* eslint-disable-next-line no-console */

View File

@ -3,8 +3,8 @@ export {
createSchema,
IncludeSchemaOptions,
SchemaOptions,
} from './schema';
export { envType } from './type/Env';
export { createInclude, IncludeOptions } from './type/Include';
export { regexpType } from './type/Regexp';
export { streamType } from './type/Stream';
} from './schema.js';
export { envType } from './type/Env.js';
export { createInclude, IncludeOptions } from './type/Include.js';
export { regexpType } from './type/Regexp.js';
export { streamType } from './type/Stream.js';

View File

@ -1,4 +1,4 @@
import { VERSION_INFO } from './version';
import { VERSION_INFO } from './version.js';
export {
VERSION_INFO,

View File

@ -1,10 +1,10 @@
import { mustDefault } from '@apextoaster/js-utils';
import { DEFAULT_SCHEMA, Schema } from 'js-yaml';
import { envType } from './type/Env';
import { createInclude, IncludeOptions } from './type/Include';
import { regexpType } from './type/Regexp';
import { streamType } from './type/Stream';
import { envType } from './type/Env.js';
import { createInclude, IncludeOptions } from './type/Include.js';
import { regexpType } from './type/Regexp.js';
import { streamType } from './type/Stream.js';
/**
* @public

View File

@ -1,6 +1,6 @@
import { expect } from 'chai';
import { main } from '../src/app';
import { main } from '../src/app.js';
describe('main function', async () => {
it('should exit 1', async () => expect(main([])).to.eventually.equal(1));

View File

@ -1,8 +1,7 @@
import { NotFoundError } from '@apextoaster/js-utils';
import { expect } from 'chai';
import { NotFoundError } from '@apextoaster/js-utils';
import { envType } from '../../src/type/Env';
import { VERSION_INFO } from '../../src/version';
import { envType } from '../../src/type/Env.js';
describe('env config type', async () => {
it('should throw on missing variables', async () => {
@ -16,6 +15,6 @@ describe('env config type', async () => {
});
it('should construct a value from variables', async () => {
expect(envType.construct('CI_COMMIT_SHA')).to.equal(VERSION_INFO.git.commit);
expect(envType.construct('CI_COMMIT_SHA')).to.match(/[a-f0-9]+/);
});
});

View File

@ -3,7 +3,7 @@ import { expect } from 'chai';
import { DEFAULT_SCHEMA } from 'js-yaml';
import { join } from 'path';
import { createInclude, IncludeOptions } from '../../src/type/Include';
import { createInclude, IncludeOptions } from '../../src/type/Include.js';
const TEST_ROOT = '../test/type';

View File

@ -1,6 +1,6 @@
import { expect } from 'chai';
import { regexpType } from '../../src/type/Regexp';
import { regexpType } from '../../src/type/Regexp.js';
describe('regexp config type', async () => {
it('match slashed strings', async () => {

View File

@ -1,7 +1,7 @@
import { NotFoundError } from '@apextoaster/js-utils';
import { expect } from 'chai';
import { streamType } from '../../src/type/Stream';
import { streamType } from '../../src/type/Stream.js';
describe('stream config type', async () => {
it('should resolve existing streams', async () => {

View File

@ -2,10 +2,10 @@
# yarn lockfile v1
"@apextoaster/js-utils@0.5.0-0":
version "0.5.0-0"
resolved "https://artifacts.apextoaster.com/repository/group-npm/@apextoaster/js-utils/-/js-utils-0.5.0-0.tgz#6c94a3a8a2530b8b4b97aee21984e6ae15488daf"
integrity sha512-4uMjuogP86Z3OZVEu05PZTXBJi6YriNItfpZuQAgq4nqK8Vz3AIdHJoKGqycKmr22h3+/ASQzuWm+zcEJxrjUQ==
"@apextoaster/js-utils@0.5.0-1":
version "0.5.0-1"
resolved "https://artifacts.apextoaster.com/repository/group-npm/@apextoaster/js-utils/-/js-utils-0.5.0-1.tgz#c0060735df1b846e3f0f0c15b8181491cfb8ec5b"
integrity sha512-i1g8x2G2O/gHzmbuuSmqHJNbfGY4px4S3N6F/Cbb7u3opj5d3tvewlkubkl+CELrLllCxrhKxHZ8ZM8ajSwQdg==
"@babel/code-frame@^7.0.0":
version "7.5.5"