Skip to content
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

Renamed dist to bundle; renamed lib to dist and ignored it #558

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
dist/**/* linguist-generated
lib/**/* linguist-generated
bundle/**/* linguist-generated
2 changes: 1 addition & 1 deletion .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
paths-ignore:
- dist/
- bundle/
- node_modules/
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ jobs:
- name: Build
run: yarn build

- name: Package
run: yarn package
- name: Bundle
run: yarn bundle

- uses: CatChen/check-git-status-action@v1
id: check-git-status
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ on:
diff-targets:
description: 'Diff Targets'
required: false
default: '{README.md,LICENSE,dist/**/*}'
default: '{README.md,LICENSE,bundle/**/*}'
type: string
dry-run:
description: 'Dry run'
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
update-shorthand-release: true
dry-run: ${{ inputs.dry-run || false }}
skip-if-no-diff: ${{ inputs.skip-if-no-diff || github.event_name != 'workflow_dispatch' }}
diff-targets: ${{ inputs.diff-targets || '{README.md,LICENSE,dist/**/*}' }}
diff-targets: ${{ inputs.diff-targets || '{README.md,LICENSE,bundle/**/*}' }}
github-token: ${{ steps.get-github-app-token.outputs.token }}

publish:
Expand Down
38 changes: 33 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
Expand Down Expand Up @@ -41,8 +42,8 @@ build/Release
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo
Expand All @@ -53,6 +54,9 @@ typings/
# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
Expand All @@ -68,28 +72,41 @@ typings/
# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
# dotenv environment variable files
.env
.env.test
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

Expand All @@ -101,3 +118,14 @@ typings/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

7 changes: 2 additions & 5 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn build
git add lib

yarn package
git add dist
yarn bundle
git add bundle

yarn lint-staged
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
.prettierrc.json
action.yml
assets/
dist/
bundle/
src/
tests/
eslint.config.js
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
dist/
lib/
bundle/
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ inputs:
default: ${{ github.token }}
runs:
using: 'node20'
main: 'dist/index.js'
post: 'dist/index.js'
main: 'bundle/index.js'
post: 'bundle/index.js'
post-if: always()
branding:
icon: 'box'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';
import path from 'path';
import { fileURLToPath } from 'url';
import { FlatCompat } from '@eslint/eslintrc';
import js from '@eslint/js';
import ts from 'typescript-eslint';

const __filename = fileURLToPath(import.meta.url);
Expand Down Expand Up @@ -31,8 +31,8 @@ export default ts.config(
rules: {},
ignorePatterns: [
'node_modules/**/*',
'lib/**/*',
'dist/**/*',
'bundle/**/*',
'eslint.config.js',
],
overrides: [
Expand Down
6 changes: 0 additions & 6 deletions lib/getOctokit.d.ts

This file was deleted.

39 changes: 0 additions & 39 deletions lib/getOctokit.js

This file was deleted.

1 change: 0 additions & 1 deletion lib/index.d.ts

This file was deleted.

45 changes: 0 additions & 45 deletions lib/index.js

This file was deleted.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
"name": "typescript-github-action-template",
"version": "0.1.19",
"description": "A template to create custom GitHub Action with TypeScript/JavaScript.",
"main": "lib/index.js",
"types": "lib/index.d.js",
"main": "dist/index.js",
"types": "dist/index.d.js",
"type": "module",
"scripts": {
"build": "rm -rf lib && yarn tsc",
"package": "rm -rf dist && yarn ncc build src/index.ts --external eslint --source-map --license licenses.txt",
"build": "rm -rf dist && yarn tsc",
"bundle": "rm -rf bundle && yarn ncc build src/index.ts --external eslint --source-map --license licenses.txt --out bundle",
"test": "echo \"Error: no test specified\" && exit 1",
"lint": "eslint -c eslint.config.js",
"postinstall": "is-ci || husky install",
"prepublishOnly": "pinst --disable",
"prepublishOnly": "pinst --disable && yarn build",
"postpublish": "pinst --enable",
"preversion": "yarn && yarn build && yarn package"
"preversion": "yarn && yarn build && yarn bundle"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
"outDir": "lib" /* Specify an output folder for all emitted files. */,
"outDir": "dist" /* Specify an output folder for all emitted files. */,
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
Expand Down
Loading