update got dependency and convert to esm module (#533)

* update require got to import got

* convert remaining to esm

* wip: replace jest with vitest

* fix test imports and vitest config

* remove dist package.json

* fix import in ent test

* add dist

* move actions/core to prod dependency

* remove unused import that was breaking esm compilation

* simplify imports

* use module.createRequire to import jsonata

* add doc link comment

* add comments on import insanity

* add more comments

* update PR tempalte

* bump got and remove jest deps

* revert debug npm run command

* fix fs import

* simplify vitest config for each test suite
This commit is contained in:
John-Michael Faircloth
2024-03-19 10:42:34 -05:00
committed by GitHub
parent a727ce205a
commit 77efb36ae3
39 changed files with 12213 additions and 14317 deletions
+12 -11
View File
@@ -1,12 +1,14 @@
// @ts-check
const core = require('@actions/core');
const command = require('@actions/core/lib/command');
const got = require('got').default;
const jsonata = require('jsonata');
const { normalizeOutputKey } = require('./utils');
const { WILDCARD } = require('./constants');
import core from '@actions/core';
import got from 'got';
const { auth: { retrieveToken }, secrets: { getSecrets } } = require('./index');
import { normalizeOutputKey } from './utils.js';
import { WILDCARD } from './constants.js';
import { retrieveToken } from './auth.js';
import { getSecrets } from './secrets.js';
// ncc doesn't compile jsonata imports properly, so we must use our own custom require
import require from "./cjs-require.js";
const jsonata = require('jsonata');
const AUTH_METHODS = ['approle', 'token', 'github', 'jwt', 'kubernetes', 'ldap', 'userpass'];
const ENCODING_TYPES = ['base64', 'hex', 'utf8'];
@@ -219,9 +221,8 @@ function parseHeadersInput(inputKey, inputOptions) {
}, new Map());
}
module.exports = {
export {
exportSecrets,
parseSecretsInput,
parseHeadersInput,
};
}