Skip to content

Commit

Permalink
Merge pull request #21 from eik-lib/fix_eik_common
Browse files Browse the repository at this point in the history
fix: replace broken usage of old eik common module
  • Loading branch information
digitalsadhu authored Apr 19, 2023
2 parents c43cebe + 72473fa commit c360258
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/generate-notes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { join } = require("path");
const common = require("@eik/common");
const { typeSlug } = require("@eik/common-utils");

/**
* Semantic Release "generate notes" hook
Expand All @@ -17,7 +17,7 @@ module.exports = async function generateNotes(options, context, state) {
const version = state.versionToPublish;
const date = new Date();
const dateString = `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;
const slug = common.helpers.typeSlug(type);
const slug = typeSlug(type);
const versionURL = new URL(join(slug, name, version), server).href;
const nameURL = new URL(join(slug, name), server).href;

Expand Down
8 changes: 4 additions & 4 deletions lib/success.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { join } = require("path");
const fetch = require("node-fetch");
const common = require("@eik/common");
const { default: fetch } = require("node-fetch");
const { typeSlug } = require("@eik/common-utils");

const PUBLISH_SUCCESS =
"Publish: ✅ Successfully published package %s (v%s) to %s.";
Expand All @@ -20,9 +20,9 @@ module.exports = async function success(options, context, state) {
if (!state.publishNeeded) return;
const { logger } = context;
const { server, name, type } = state.eikJSON;
const slug = common.helpers.typeSlug(type);
const slug = typeSlug(type);
const url = new URL(join(slug, name, state.versionToPublish), server);
url.searchParams.set("ts", Date.now());
url.searchParams.set("ts", `${Date.now()}`);
const result = await fetch(url);
if (result.ok) {
logger.log(PUBLISH_SUCCESS, name, state.versionToPublish, url.href);
Expand Down
4 changes: 2 additions & 2 deletions lib/verify-conditions.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const AggregateError = require("aggregate-error");
const eik = require("@eik/cli");
const common = require("@eik/common");
const { configStore } = require("@eik/common-config-loader");

const E_TOKEN_MISSING = "Verify: ❌ EIK_TOKEN environment variable not found";
const E_LEVEL_INVALID =
Expand Down Expand Up @@ -30,7 +30,7 @@ module.exports = async function verifyConditions(options, context, state) {

// verify existance of and validity of eik.json file AND read contents
try {
state.eikJSON = common.helpers.configStore.findInDirectory(context.cwd);
state.eikJSON = configStore.findInDirectory(context.cwd);
} catch (err) {
errors.push(err);
}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"license": "MIT",
"dependencies": {
"@eik/cli": "^2.0.0-next.6",
"@eik/common": "^4.0.0-next.4",
"@eik/common-config-loader": "^0.0.1-next.2",
"@eik/common-utils": "^0.0.1-next.1",
"aggregate-error": "^3.0.0",
"execa": "^5.1.1",
"node-fetch": "^2.6.1"
Expand Down

0 comments on commit c360258

Please sign in to comment.