Skip to content

Commit 26992b4

Browse files
chrisberthet-kelly
andcommitted
Initial commit
This commit introduces plugin-devkit, a fully rewritten Shopify CLI plugin succeeding plugin-theme-component. The rewrite modernizes the codebase, updates the API, and aligns with current best practices while simplifying core functionality as a Shopify CLI tool. All documentation and configuration files have been updated to reflect the new identity and structure. The plugin-theme-component repo will be archived, with its history (v1.0.0 to v5.1.0) preserved there. This new repo starts fresh at v1.0.0, marking an overhaul and clean slate for future development on this plugin. Co-authored-by: Thomas Kelly <thomas@archetypethemes.co> Co-authored-by: Chris Berthe <chrisberthe@gmail.com>
0 parents  commit 26992b4

File tree

144 files changed

+17033
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+17033
-0
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/dist

.eslintrc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": ["oclif", "oclif-typescript", "prettier"],
3+
"settings": {
4+
"node": {
5+
"version": ">=18.0.0"
6+
}
7+
}
8+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Bug report
3+
about: Report an issue with the DevKit CLI
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Problem description
10+
A clear and concise description of what the bug is.
11+
12+
## Environment
13+
- Collection repository: [e.g. components]
14+
- Branch name: [e.g. main]
15+
- CLI version: [e.g. 1.22.5]
16+
- Operating system: [e.g. macOS 12.6, Windows 11]
17+
- Node.js version: [e.g. 18.12.1]
18+
19+
## Steps to reproduce
20+
1. Run command '...'
21+
2. See error
22+
23+
## Expected behavior
24+
A clear and concise description of what you expected to happen.
25+
26+
## Actual behavior
27+
What actually happened, including any error messages or screenshots.
28+
29+
## Additional context
30+
Add any other context about the problem here (e.g., configuration files, logs).
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Feature request
3+
about: Suggest a new feature for the DevKit CLI
4+
title: ''
5+
labels: feature
6+
assignees: ''
7+
---
8+
9+
## Current limitation
10+
A clear and concise description of what the current limitation is. Ex. I'm unable to [...] when [...]
11+
12+
## Proposed solution
13+
A clear and concise description of what you want to happen.
14+
15+
## Use cases
16+
Describe specific use cases this feature would address.
17+
18+
## Alternatives considered
19+
A clear and concise description of any alternative solutions or features you've considered.
20+
21+
## Additional context
22+
Add any other context, mockups, or examples about the feature request here.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Publish to NPM
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-node@v4
13+
with:
14+
node-version: latest
15+
- run: npm install
16+
- run: npm run build
17+
- uses: JS-DevTools/npm-publish@19c28f1ef146469e409470805ea4279d47c3d35c
18+
with:
19+
token: ${{ secrets.NPM_TOKEN }}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Version, tag and GitHub release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-node@v4
13+
- name: Generate GitHub App Token
14+
id: generate-token
15+
uses: tibdex/github-app-token@v1
16+
with:
17+
app_id: ${{ secrets.ARCHETYPE_GITHUB_APP_ID }}
18+
private_key: ${{ secrets.ARCHETYPE_GITHUB_APP_KEY }}
19+
20+
- name: Check if version already exists
21+
id: version-check
22+
run: |
23+
package_version=$(node -p "require('./package.json').version")
24+
exists=$(gh api repos/${{ github.repository }}/releases/tags/v$package_version >/dev/null 2>&1 && echo "true" || echo "")
25+
26+
if [ -n "$exists" ];
27+
then
28+
echo "Version v$package_version already exists"
29+
echo "::warning file=package.json,line=1::Version v$package_version already exists - no release will be created. If you want to create a new release, please update the version in package.json and push again."
30+
echo "skipped=true" >> $GITHUB_OUTPUT
31+
else
32+
echo "Version v$package_version does not exist. Creating release..."
33+
echo "skipped=false" >> $GITHUB_OUTPUT
34+
echo "tag=v$package_version" >> $GITHUB_OUTPUT
35+
fi
36+
env:
37+
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
38+
- name: Setup git
39+
if: ${{ steps.version-check.outputs.skipped == 'false' }}
40+
run: |
41+
git config --global user.name "github-actions[bot]"
42+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
43+
- name: Create Github Release
44+
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5
45+
if: ${{ steps.version-check.outputs.skipped == 'false' }}
46+
with:
47+
name: ${{ steps.version-check.outputs.tag }}
48+
tag: ${{ steps.version-check.outputs.tag }}
49+
commit: ${{ github.ref_name }}
50+
token: ${{ steps.generate-token.outputs.token }}
51+
skipIfReleaseExists: true

.github/workflows/run-tests.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Run tests
2+
on:
3+
push:
4+
branches-ignore: [main]
5+
workflow_dispatch:
6+
7+
jobs:
8+
unit-tests:
9+
strategy:
10+
matrix:
11+
# os: ['ubuntu-latest', 'windows-latest']
12+
os: ['ubuntu-latest']
13+
node_version: [lts/-1, lts/*, latest]
14+
fail-fast: false
15+
runs-on: ${{ matrix.os }}
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: ${{ matrix.node_version }}
21+
cache: npm
22+
- run: npm install
23+
- run: npm run build
24+
- run: npm run test

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
*-debug.log
2+
*-error.log
3+
**/.DS_Store
4+
/.idea
5+
/dist
6+
/tmp
7+
/node_modules
8+
oclif.manifest.json
9+
yarn.lock
10+
pnpm-lock.yaml
11+
12+
# Test run-time fixtures
13+
test-collection
14+
test-theme
15+
.shopify

.mocharc.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"require": [
3+
"ts-node/register"
4+
],
5+
"watch-extensions": [
6+
"ts"
7+
],
8+
"recursive": true,
9+
"reporter": "spec",
10+
"timeout": 60000,
11+
"node-option": [
12+
"loader=ts-node/esm",
13+
"experimental-specifier-resolution=node"
14+
]
15+
}

.prettierrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"@oclif/prettier-config"

0 commit comments

Comments
 (0)