Skip to content

Commit

Permalink
Merge pull request #266 from emulsify-ds/develop
Browse files Browse the repository at this point in the history
Release: Sync main branch with develop
  • Loading branch information
callinmullaney authored May 1, 2024
2 parents 109360b + 0033b67 commit 22d5303
Show file tree
Hide file tree
Showing 26 changed files with 321 additions and 107 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/addtoprojects.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Add to projects

on:
issues:
types:
- opened
pull_request:
types:
- opened

jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
# You can target a repository in a different organization
# to the issue
project-url: https://github.com/orgs/emulsify-ds/projects/6
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
23 changes: 23 additions & 0 deletions .github/workflows/contributors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Add contributors
on:
schedule:
- cron: "20 20 * * *"
push:
branches:
- develop

jobs:
add-contributors:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: BobAnkh/add-contributors@master
with:
CONTRIBUTOR: "### Contributors"
COLUMN_PER_ROW: "6"
ACCESS_TOKEN: ${{secrets.ADD_TO_PROJECT_PAT}}
IMG_WIDTH: "100"
FONT_SIZE: "14"
PATH: "/README.md"
COMMIT_MESSAGE: "docs(README): update contributors"
AVATAR_SHAPE: "round"
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: 16.13
node-version: 20
- name: Install
run: npm install
- name: Build
run: npm run build
- name: Release
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm run semantic-release
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.13
20
90 changes: 89 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Emulsify Design System](https://user-images.githubusercontent.com/409903/170579210-327abcdd-2c98-4922-87bb-36446a4cc013.svg)](https://www.emulsify.info/)
![npm](https://img.shields.io/npm/dm/@emulsify/cli?style=flat-square)
# emulsify-cli

Command line interface for Emulsify.
Expand All @@ -12,7 +14,7 @@ npm install -g @emulsify/cli

## Usage

For more information on how to use emulsify-cli, please see the [usage documentation](https://docs.emulsify.info/supporting-projects/emulsify-cli/emulsify-cli-usage).
For more information on how to use emulsify-cli, please see the [usage documentation](https://www.emulsify.info/docs/supporting-projects/emulsify-cli/emulsify-cli-usage).

## Development

Expand Down Expand Up @@ -48,3 +50,89 @@ Emulsify-cli is developed using TypeScript. You can find all of the source files
## Deployment

This project is automatically built and deployed to NPM via a GitHub Actions workflow. In order to deploy changes merged into the `develop` branch, simply merge `develop` into `main`, and call it a day.

### Contributors

<table>
<tr>
<td align="center" style="word-wrap: break-word; width: 150.0; height: 150.0">
<a href=https://github.com/patrickocoffeyo>
<img src=https://avatars.githubusercontent.com/u/1107871?v=4 width="100;" style="border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt=Patrick Coffey/>
<br />
<sub style="font-size:14px"><b>Patrick Coffey</b></sub>
</a>
</td>
<td align="center" style="word-wrap: break-word; width: 150.0; height: 150.0">
<a href=https://github.com/ModulesUnraveled>
<img src=https://avatars.githubusercontent.com/u/1663810?v=4 width="100;" style="border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt=Brian Lewis/>
<br />
<sub style="font-size:14px"><b>Brian Lewis</b></sub>
</a>
</td>
<td align="center" style="word-wrap: break-word; width: 150.0; height: 150.0">
<a href=https://github.com/JeffTomlinson>
<img src=https://avatars.githubusercontent.com/u/2602202?v=4 width="100;" style="border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt=Jeff Tomlinson/>
<br />
<sub style="font-size:14px"><b>Jeff Tomlinson</b></sub>
</a>
</td>
<td align="center" style="word-wrap: break-word; width: 150.0; height: 150.0">
<a href=https://github.com/callinmullaney>
<img src=https://avatars.githubusercontent.com/u/369018?v=4 width="100;" style="border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt=Callin Mullaney/>
<br />
<sub style="font-size:14px"><b>Callin Mullaney</b></sub>
</a>
</td>
<td align="center" style="word-wrap: break-word; width: 150.0; height: 150.0">
<a href=https://github.com/amazingrando>
<img src=https://avatars.githubusercontent.com/u/409903?v=4 width="100;" style="border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt=Randy Oest/>
<br />
<sub style="font-size:14px"><b>Randy Oest</b></sub>
</a>
</td>
<td align="center" style="word-wrap: break-word; width: 150.0; height: 150.0">
<a href=https://github.com/mikeethedude>
<img src=https://avatars.githubusercontent.com/u/15275301?v=4 width="100;" style="border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt=mikeethedude/>
<br />
<sub style="font-size:14px"><b>mikeethedude</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center" style="word-wrap: break-word; width: 150.0; height: 150.0">
<a href=https://github.com/fertant>
<img src=https://avatars.githubusercontent.com/u/3853492?v=4 width="100;" style="border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt=Andrii Shutov/>
<br />
<sub style="font-size:14px"><b>Andrii Shutov</b></sub>
</a>
</td>
<td align="center" style="word-wrap: break-word; width: 150.0; height: 150.0">
<a href=https://github.com/ryanhagerty>
<img src=https://avatars.githubusercontent.com/u/8405274?v=4 width="100;" style="border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt=Ryan Hagerty/>
<br />
<sub style="font-size:14px"><b>Ryan Hagerty</b></sub>
</a>
</td>
<td align="center" style="word-wrap: break-word; width: 150.0; height: 150.0">
<a href=https://github.com/nJim>
<img src=https://avatars.githubusercontent.com/u/9594124?v=4 width="100;" style="border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt=Jim Vomero/>
<br />
<sub style="font-size:14px"><b>Jim Vomero</b></sub>
</a>
</td>
<td align="center" style="word-wrap: break-word; width: 150.0; height: 150.0">
<a href=https://github.com/calebtr-metro>
<img src=https://avatars.githubusercontent.com/u/43386533?v=4 width="100;" style="border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt=Caleb Tucker-Raymond/>
<br />
<sub style="font-size:14px"><b>Caleb Tucker-Raymond</b></sub>
</a>
</td>
<td align="center" style="word-wrap: break-word; width: 150.0; height: 150.0">
<a href=https://github.com/iryston>
<img src=https://avatars.githubusercontent.com/u/1258460?v=4 width="100;" style="border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt=Igor R. Plity/>
<br />
<sub style="font-size:14px"><b>Igor R. Plity</b></sub>
</a>
</td>
</tr>
</table>
7 changes: 6 additions & 1 deletion jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ jest.mock('simple-git', () => {
clone: jest.fn(),
branch: jest.fn(),
checkout: jest.fn(),
fetch: jest.fn(),
fetch: jest.fn().mockReturnThis(),
pull: jest.fn(),
init: jest.fn().mockReturnThis(),
addRemote: jest.fn().mockReturnThis(),
tags: jest.fn(() => {
return { latest: '' };
}),
};

return jest.fn(() => mockGit);
Expand Down
36 changes: 8 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"@semantic-release/github": "^8.0.2",
"@semantic-release/npm": "^8.0.3",
"@types/chalk": "^2.2.0",
"@types/commander": "^2.12.2",
"@types/fs-extra": "^9.0.8",
"@types/jest": "^26.0.20",
"@types/node": "^14.14.25",
Expand All @@ -69,7 +68,7 @@
"ajv": "^7.2.4",
"ajv-formats": "^2.1.1",
"chalk": "^4.1.0",
"commander": "^7.0.0",
"commander": "^12.0.0",
"consola": "^2.15.3",
"fs-extra": "^10.0.0",
"progress": "^2.0.3",
Expand Down
1 change: 1 addition & 0 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
tagFormat: '${version}',
branches: ['main'],
repositoryUrl: '[email protected]:emulsify-ds/emulsify-cli.git',
plugins: [
Expand Down
1 change: 1 addition & 0 deletions src/handlers/componentInstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export default async function componentInstall(
const systemConf: EmulsifySystem | void = await getJsonFromCachedFile(
'systems',
[systemName],
emulsifyConfig.system.checkout,
EMULSIFY_SYSTEM_CONFIG_FILE
);

Expand Down
1 change: 1 addition & 0 deletions src/handlers/componentList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export default async function componentList(): Promise<void> {
const systemConf: EmulsifySystem | void = await getJsonFromCachedFile(
'systems',
[systemName],
emulsifyConfig.system.checkout,
EMULSIFY_SYSTEM_CONFIG_FILE
);

Expand Down
32 changes: 24 additions & 8 deletions src/handlers/systemInstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import getAvailableSystems from '../util/system/getAvailableSystems';
import getGitRepoNameFromUrl from '../util/getGitRepoNameFromUrl';
import cloneIntoCache from '../util/cache/cloneIntoCache';
import getCachedItemCheckout from '../util/cache/getCachedItemCheckout';
import getRepositoryLatestTag from '../util/getRepositoryLatestTag';
import installComponentFromCache from '../util/project/installComponentFromCache';
import installGeneralAssetsFromCache from '../util/project/installGeneralAssetsFromCache';
import getJsonFromCachedFile from '../util/cache/getJsonFromCachedFile';
Expand All @@ -43,13 +44,21 @@ export async function getSystemRepoInfo(
): Promise<(GitCloneOptions & { name: string }) | void> {
// If a repository and checkout were specified, use that to return system information.
if (repository && checkout) {
const repoName = getGitRepoNameFromUrl(repository);
if (repoName) {
return {
name: repoName,
repository,
checkout,
};
try {
const repoName = getGitRepoNameFromUrl(repository);
if (repoName) {
return {
name: repoName,
repository,
checkout,
};
}
} catch (error: unknown) {
if (error instanceof Error) {
return log('error', error.message, EXIT_ERROR);
} else {
throw error;
}
}
}

Expand Down Expand Up @@ -109,16 +118,23 @@ export default async function systemInstall(
);
}

let checkout = repo.checkout;
// Attempt to get latest tag if no branch was supplied.
if (!checkout) {
checkout = await getRepositoryLatestTag(repo.repository);
}

// Clone the system into the cache.
await cloneIntoCache('systems', [repo.name])({
repository: repo.repository,
checkout: repo.checkout,
checkout: checkout,
});

// Load the system configuration file.
const systemConf: EmulsifySystem | void = await getJsonFromCachedFile(
'systems',
[repo.name],
repo.checkout,
EMULSIFY_SYSTEM_CONFIG_FILE
);

Expand Down
Loading

0 comments on commit 22d5303

Please sign in to comment.