Skip to content

Commit

Permalink
Merge pull request #580 from eik-lib/next
Browse files Browse the repository at this point in the history
Release next
  • Loading branch information
wkillerud authored Aug 12, 2024
2 parents 5a0e04a + 2ec4225 commit c7339ee
Show file tree
Hide file tree
Showing 89 changed files with 1,506 additions and 943 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

10 changes: 0 additions & 10 deletions .eslintrc

This file was deleted.

1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
30 changes: 16 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
name: Release and Publish
name: Publish

permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance

on:
push:
Expand All @@ -9,28 +15,24 @@ on:
- next

jobs:
test:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: npm install
- run: npm install

- run: npm run lint

- name: Lint files
run: npm run lint
- run: npm run types

- name: Run tests
run: npm run test:ci
- run: npm run test:ci

- name: Run semantic release
run: npx semantic-release
- run: npx semantic-release
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Lint and Tests
name: Test

on:
push:
Expand All @@ -9,7 +9,7 @@ on:
- next

jobs:
build:
test:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest] #, windows-latest]
Expand All @@ -20,16 +20,14 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install
- run: npm install

- name: Lint files
run: npm run lint
- run: npm run lint

- name: Run tests
run: npm run test:ci
- run: npm run types

- run: npm run test:ci
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ coverage
.vscode
.eikrc
test/.eik
test-read-json.json
test-read-json.json
types/
.tap
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
package-lock=false
save-exact=true
163 changes: 163 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,166 @@
# [3.0.0-next.1](https://github.com/eik-lib/cli/compare/v2.0.39...v3.0.0-next.1) (2024-08-06)


### Bug Fixes

* add jsdoc for publish commands as well ([a2b51c8](https://github.com/eik-lib/cli/commit/a2b51c86fe10ab84aa21e07151007fdc723e36c4))
* include type definitions for programatic API ([96d6079](https://github.com/eik-lib/cli/commit/96d6079145198f5df3cd353952e9bac4d530031d))
* update boxen, chalk and ora ([73a200f](https://github.com/eik-lib/cli/commit/73a200f20a59edc69abc5fb3d8760fbf2630b0c1))
* update date-fns ([0b32270](https://github.com/eik-lib/cli/commit/0b322700cd62e73052eef42016658931c27202c2))
* update Eik common to v4.0.0 ([1078484](https://github.com/eik-lib/cli/commit/107848440a11eac4cc5b49a33fb172bffe43e1d9))
* update gzip-size ([6075766](https://github.com/eik-lib/cli/commit/6075766b9a3c60f91b7d64374e9396b87fb9294c))
* update make-dir ([8d9c939](https://github.com/eik-lib/cli/commit/8d9c939449e0adfd8bed33d517f8e219d6790a74))
* update rimraf ([3e40b11](https://github.com/eik-lib/cli/commit/3e40b11b527c722f4ecf51872f0b09d82eef034b))
* update ssri package ([944426a](https://github.com/eik-lib/cli/commit/944426add01481af20232410b3d86fc983b73da8))
* update tar package ([41c8227](https://github.com/eik-lib/cli/commit/41c8227578b166682c00c6dd841bcb972f475433))
* update to Eik common v4.0.1 ([fb69c35](https://github.com/eik-lib/cli/commit/fb69c35c085266571d2352a60ebe9c9783e21d46))


### chore

* convert codebase to ESM ([f3c4c74](https://github.com/eik-lib/cli/commit/f3c4c746cc3ac283d0f8e493682af34086831f51))


### Code Refactoring

* remove eik v alias ([80ac9b6](https://github.com/eik-lib/cli/commit/80ac9b62a2cc7d53fd4e5dbbbd983efc490214bd))


### Features

* add alias command as an eventual replacement for the 3 existing alias commands ([ff4a27c](https://github.com/eik-lib/cli/commit/ff4a27cc8e46f55321a6c814d23a111737eba29d))
* add eik --version and eik -v ali flags to list eik cli version ([5ddd162](https://github.com/eik-lib/cli/commit/5ddd16245a3285d9ebd002aa35d96557d50c2bd5))
* init reads name and version from package.json ([6effb76](https://github.com/eik-lib/cli/commit/6effb768a7c2ec5110d935201960d9d872abff48))
* support specifying a config file using --config or -c cli flags ([a78b9de](https://github.com/eik-lib/cli/commit/a78b9de9f8f8e7e64bcdf24e649e0c27ea6eec1f))


### BREAKING CHANGES

* eik v command is no longer an alias for eik version
* JavaScript API is now ESM only and no longer supports CJS

# [3.0.0-next.1](https://github.com/eik-lib/cli/compare/v2.0.39...v3.0.0-next.1) (2024-08-06)


### Bug Fixes

* add jsdoc for publish commands as well ([a2b51c8](https://github.com/eik-lib/cli/commit/a2b51c86fe10ab84aa21e07151007fdc723e36c4))
* include type definitions for programatic API ([96d6079](https://github.com/eik-lib/cli/commit/96d6079145198f5df3cd353952e9bac4d530031d))
* update boxen, chalk and ora ([73a200f](https://github.com/eik-lib/cli/commit/73a200f20a59edc69abc5fb3d8760fbf2630b0c1))
* update date-fns ([0b32270](https://github.com/eik-lib/cli/commit/0b322700cd62e73052eef42016658931c27202c2))
* update gzip-size ([6075766](https://github.com/eik-lib/cli/commit/6075766b9a3c60f91b7d64374e9396b87fb9294c))
* update make-dir ([8d9c939](https://github.com/eik-lib/cli/commit/8d9c939449e0adfd8bed33d517f8e219d6790a74))
* update rimraf ([3e40b11](https://github.com/eik-lib/cli/commit/3e40b11b527c722f4ecf51872f0b09d82eef034b))
* update ssri package ([944426a](https://github.com/eik-lib/cli/commit/944426add01481af20232410b3d86fc983b73da8))
* update tar package ([41c8227](https://github.com/eik-lib/cli/commit/41c8227578b166682c00c6dd841bcb972f475433))


### chore

* convert codebase to ESM ([f3c4c74](https://github.com/eik-lib/cli/commit/f3c4c746cc3ac283d0f8e493682af34086831f51))


### Code Refactoring

* remove eik v alias ([80ac9b6](https://github.com/eik-lib/cli/commit/80ac9b62a2cc7d53fd4e5dbbbd983efc490214bd))


### Features

* add alias command as an eventual replacement for the 3 existing alias commands ([ff4a27c](https://github.com/eik-lib/cli/commit/ff4a27cc8e46f55321a6c814d23a111737eba29d))
* add eik --version and eik -v ali flags to list eik cli version ([5ddd162](https://github.com/eik-lib/cli/commit/5ddd16245a3285d9ebd002aa35d96557d50c2bd5))


### BREAKING CHANGES

* eik v command is no longer an alias for eik version
* JavaScript API is now ESM only and no longer supports CJS

# [3.0.0-next.1](https://github.com/eik-lib/cli/compare/v2.0.39...v3.0.0-next.1) (2024-08-04)


### Bug Fixes

* add jsdoc for publish commands as well ([a2b51c8](https://github.com/eik-lib/cli/commit/a2b51c86fe10ab84aa21e07151007fdc723e36c4))
* include type definitions for programatic API ([96d6079](https://github.com/eik-lib/cli/commit/96d6079145198f5df3cd353952e9bac4d530031d))
* update boxen, chalk and ora ([73a200f](https://github.com/eik-lib/cli/commit/73a200f20a59edc69abc5fb3d8760fbf2630b0c1))
* update date-fns ([0b32270](https://github.com/eik-lib/cli/commit/0b322700cd62e73052eef42016658931c27202c2))
* update gzip-size ([6075766](https://github.com/eik-lib/cli/commit/6075766b9a3c60f91b7d64374e9396b87fb9294c))
* update make-dir ([8d9c939](https://github.com/eik-lib/cli/commit/8d9c939449e0adfd8bed33d517f8e219d6790a74))
* update rimraf ([3e40b11](https://github.com/eik-lib/cli/commit/3e40b11b527c722f4ecf51872f0b09d82eef034b))
* update ssri package ([944426a](https://github.com/eik-lib/cli/commit/944426add01481af20232410b3d86fc983b73da8))
* update tar package ([41c8227](https://github.com/eik-lib/cli/commit/41c8227578b166682c00c6dd841bcb972f475433))


### chore

* convert codebase to ESM ([f3c4c74](https://github.com/eik-lib/cli/commit/f3c4c746cc3ac283d0f8e493682af34086831f51))


### Features

* add alias command as an eventual replacement for the 3 existing alias commands ([ff4a27c](https://github.com/eik-lib/cli/commit/ff4a27cc8e46f55321a6c814d23a111737eba29d))


### BREAKING CHANGES

* JavaScript API is now ESM only and no longer supports CJS

# [3.0.0-next.1](https://github.com/eik-lib/cli/compare/v2.0.39...v3.0.0-next.1) (2024-08-01)


### Bug Fixes

* add jsdoc for publish commands as well ([a2b51c8](https://github.com/eik-lib/cli/commit/a2b51c86fe10ab84aa21e07151007fdc723e36c4))
* include type definitions for programatic API ([96d6079](https://github.com/eik-lib/cli/commit/96d6079145198f5df3cd353952e9bac4d530031d))
* update boxen, chalk and ora ([73a200f](https://github.com/eik-lib/cli/commit/73a200f20a59edc69abc5fb3d8760fbf2630b0c1))
* update date-fns ([0b32270](https://github.com/eik-lib/cli/commit/0b322700cd62e73052eef42016658931c27202c2))
* update gzip-size ([6075766](https://github.com/eik-lib/cli/commit/6075766b9a3c60f91b7d64374e9396b87fb9294c))
* update make-dir ([8d9c939](https://github.com/eik-lib/cli/commit/8d9c939449e0adfd8bed33d517f8e219d6790a74))
* update rimraf ([3e40b11](https://github.com/eik-lib/cli/commit/3e40b11b527c722f4ecf51872f0b09d82eef034b))
* update ssri package ([944426a](https://github.com/eik-lib/cli/commit/944426add01481af20232410b3d86fc983b73da8))
* update tar package ([41c8227](https://github.com/eik-lib/cli/commit/41c8227578b166682c00c6dd841bcb972f475433))


### chore

* convert codebase to ESM ([f3c4c74](https://github.com/eik-lib/cli/commit/f3c4c746cc3ac283d0f8e493682af34086831f51))


### BREAKING CHANGES

* JavaScript API is now ESM only and no longer supports CJS

# [3.0.0-next.1](https://github.com/eik-lib/cli/compare/v2.0.39...v3.0.0-next.1) (2024-08-01)


### Bug Fixes

* add jsdoc for publish commands as well ([a2b51c8](https://github.com/eik-lib/cli/commit/a2b51c86fe10ab84aa21e07151007fdc723e36c4))
* include type definitions for programatic API ([96d6079](https://github.com/eik-lib/cli/commit/96d6079145198f5df3cd353952e9bac4d530031d))


### chore

* convert codebase to ESM ([f3c4c74](https://github.com/eik-lib/cli/commit/f3c4c746cc3ac283d0f8e493682af34086831f51))


### BREAKING CHANGES

* JavaScript API is now ESM only and no longer supports CJS

# [3.0.0-next.1](https://github.com/eik-lib/cli/compare/v2.0.39...v3.0.0-next.1) (2024-07-31)


### chore

* convert codebase to ESM ([f3c4c74](https://github.com/eik-lib/cli/commit/f3c4c746cc3ac283d0f8e493682af34086831f51))


### BREAKING CHANGES

* JavaScript API is now ESM only and no longer supports CJS

## [2.0.39](https://github.com/eik-lib/cli/compare/v2.0.38...v2.0.39) (2024-07-29)


Expand Down
48 changes: 38 additions & 10 deletions classes/alias.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,39 @@
'use strict';
import assert from 'assert';
import abslog from 'abslog';
import { join } from 'path';
import { schemas, validators } from '@eik/common';
import { request } from '../utils/http/index.js';
import { typeSlug } from '../utils/index.js';

const assert = require('assert');
const abslog = require('abslog');
const { join } = require('path');
const { schemas, validators } = require('@eik/common');
const { request } = require('../utils/http');
const { typeSlug } = require('../utils');
/**
* @typedef {object} AliasOptions
* @property {import('abslog').AbstractLoggerOptions} [logger]
* @property {string} server
* @property {"package" | "npm" | "map"} [type="package"]
* @property {string} name
* @property {string} version
* @property {string} alias
* @property {string} token
*/

module.exports = class Alias {
constructor({ logger, server, token, type, name, version, alias } = {}) {
/**
* @typedef {object} AliasResult
* @property {string} server
* @property {string} type
* @property {string} name
* @property {string} alias
* @property {string} version
* @property {boolean} update
* @property {string[]} files
* @property {string} org
* @property {string} integrity
*/

export default class Alias {
/**
* @param {AliasOptions} options
*/
constructor({ logger, server, token, type, name, version, alias }) {
this.log = abslog(logger);
this.server = server;
this.token = token;
Expand All @@ -18,6 +43,9 @@ module.exports = class Alias {
this.version = version;
}

/**
* @returns {Promise<AliasResult>}
*/
async run() {
const data = {
server: this.server,
Expand Down Expand Up @@ -121,4 +149,4 @@ module.exports = class Alias {
}
}
}
};
}
Loading

0 comments on commit c7339ee

Please sign in to comment.