-
Notifications
You must be signed in to change notification settings - Fork 0
chore: initialise repository #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c10dbc0
init
jog1t dd8bed0
handle move static files
jog1t 5a92d0a
update .github/workflows/preview.yml
jog1t 0140af5
update .github/workflows/publish.yml
jog1t ac75c6e
update .github/workflows/ci.yml
jog1t c8486ca
fix workflows
jog1t File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "permissions": { | ||
| "allow": [ | ||
| "Bash(pnpm install:*)", | ||
| "Bash(npm install:*)" | ||
| ] | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # GitHub Workflows | ||
|
|
||
| This directory contains automated workflows for CI/CD. | ||
|
|
||
| ## Workflows | ||
|
|
||
| ### CI (`ci.yml`) | ||
| Runs on every push to `main` and on pull requests: | ||
| - Installs dependencies | ||
| - Builds the plugin | ||
| - Builds the example app | ||
|
|
||
| ### Preview Package (`preview.yml`) | ||
| Runs on pull requests and pushes to `main`: | ||
| - Builds the package | ||
| - Publishes a preview version via [pkg.pr.new](https://github.com/stackblitz-labs/pkg.pr.new) | ||
| - Adds a comment to PRs with installation instructions | ||
|
|
||
| ### Publish to npm (`publish.yml`) | ||
| Runs when a GitHub release is created: | ||
| - Builds the package | ||
| - Publishes to npm with the `--access public` flag | ||
|
|
||
| ## Setup | ||
|
|
||
| ### For npm Publishing | ||
|
|
||
| 1. Create an npm access token: | ||
| - Go to https://www.npmjs.com/settings/YOUR_USERNAME/tokens | ||
| - Click "Generate New Token" → "Automation" | ||
| - Copy the token | ||
|
|
||
| 2. Add the token to your GitHub repository: | ||
| - Go to your repository Settings → Secrets and variables → Actions | ||
| - Click "New repository secret" | ||
| - Name: `NPM_TOKEN` | ||
| - Value: Paste your npm token | ||
| - Click "Add secret" | ||
|
|
||
| 3. Create a release: | ||
| - Go to your repository → Releases → Draft a new release | ||
| - Create a tag (e.g., `v0.1.0`) | ||
| - Click "Publish release" | ||
| - The workflow will automatically publish to npm | ||
|
|
||
| ### For pkg.pr.new | ||
|
|
||
| No setup required! The workflow will automatically: | ||
| - Publish preview packages for every PR | ||
| - Comment on PRs with installation instructions | ||
| - Update the comment when new commits are pushed | ||
|
|
||
| ## Testing Locally | ||
|
|
||
| Before creating a release, test the build: | ||
|
|
||
| ```bash | ||
| pnpm install | ||
| pnpm build | ||
| cd example && pnpm build | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 9 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'pnpm' | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Build plugin | ||
| run: pnpm build | ||
|
|
||
| - name: Build example | ||
| run: | | ||
| cd example | ||
| pnpm build | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: Preview Package | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| preview: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 9 | ||
jog1t marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'pnpm' | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Build | ||
| run: pnpm build | ||
|
|
||
| - name: Publish preview | ||
| run: pnpx pkg-pr-new publish | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: Publish to npm | ||
|
|
||
| on: | ||
| release: | ||
| types: [created] | ||
|
|
||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 9 | ||
jog1t marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'pnpm' | ||
| registry-url: 'https://registry.npmjs.org' | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Build | ||
| run: pnpm build | ||
|
|
||
| - name: Publish to npm | ||
| run: pnpm publish --access public --no-git-checks | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # Dependencies | ||
| node_modules/ | ||
| .pnpm-store/ | ||
|
|
||
| # Build output | ||
| dist/ | ||
| *.tsbuildinfo | ||
| .vite/ | ||
| .turbo/ | ||
|
|
||
| # Environment files | ||
| .env | ||
| .env.local | ||
| .env.*.local | ||
|
|
||
| # Editor directories and files | ||
| .vscode/* | ||
| !.vscode/extensions.json | ||
| !.vscode/settings.json | ||
| .idea/ | ||
| *.suo | ||
| *.ntvs* | ||
| *.njsproj | ||
| *.sln | ||
| *.sw? | ||
| *.code-workspace | ||
|
|
||
| # OS files | ||
| .DS_Store | ||
| Thumbs.db | ||
|
|
||
| # Logs | ||
| logs/ | ||
| *.log | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| pnpm-debug.log* | ||
| lerna-debug.log* | ||
|
|
||
| # Testing | ||
| coverage/ | ||
|
|
||
| # Temporary files | ||
| *.tmp | ||
| *.temp | ||
| .cache/ | ||
|
|
||
| # Example build output | ||
| example/dist/ | ||
| example/api/ | ||
| example/public/ |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.