diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 3a1b942..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,25 +0,0 @@ -module.exports = { - extends: [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "standard-with-typescript", - "prettier", - ], - // overrides: [ - // { - // env: { - // node: true, - // }, - // files: [".eslintrc.{js,cjs}"], - // parserOptions: { - // sourceType: "script", - // }, - // }, - // ], - parser: "@typescript-eslint/parser", - // parserOptions: { - // ecmaVersion: "latest", - // }, - plugins: ["@typescript-eslint"], - rules: {}, -}; diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..acece11 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,10 @@ +{ + "extends": [ + "plugin:@typescript-eslint/recommended", + "standard-with-typescript", + "prettier" + ], + "parser": "@typescript-eslint/parser", + "plugins": ["@typescript-eslint"], + "rules": {} +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a65e89..3a503e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,4 +33,43 @@ jobs: run: npm run build - name: Test - run: npm test \ No newline at end of file + run: npm test + release_and_publish: + runs-on: ubuntu-latest + environment: npm_publish_env + needs: build + 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 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies + run: npm ci + + - name: Build project + run: npm run build + + - name: Print Head of token + run: echo ${{secrets.NPM_TOKEN}} | head -c6 + + - name: Configure NPM + run: | + echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc + + - name: Run Semantic Release + run: npx semantic-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_RELEASR_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 479c6b1..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Publish -on: - push: - branches: - - main -jobs: - release_and_publish: - runs-on: ubuntu-latest - permissions: write-all - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: 'npm' - registry-url: 'https://registry.npmjs.org' - - - name: Install dependencies - run: npm ci - - - name: Build project - run: npm run build - - - name: Run Semantic Release - run: npx semantic-release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Publish to npm - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - - - diff --git a/.gitignore b/.gitignore index 7fe6097..429c676 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,7 @@ node_modules # build directory -out \ No newline at end of file +out + +# npm packages +*.tgz \ No newline at end of file diff --git a/.npmignore b/.npmignore index 749334d..782de91 100644 --- a/.npmignore +++ b/.npmignore @@ -4,7 +4,7 @@ # config files .prettierignore -.eslintrc.js +.eslintrc.json webpack.config.js .commitlintrc.json @@ -16,5 +16,4 @@ webpack.config.js # ts tsconfig.json -*.tsbuildinfo -*.ts \ No newline at end of file +*.tsbuildinfo \ No newline at end of file diff --git a/lemlib-lemlink-0.0.0.tgz b/lemlib-lemlink-0.0.0.tgz deleted file mode 100644 index d4f1001..0000000 Binary files a/lemlib-lemlink-0.0.0.tgz and /dev/null differ diff --git a/package.json b/package.json index 88cdddd..7a0d5b8 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { "name": "@lemlib/lemlink", - "version": "0.0.0", + "version": "0.0.0-development", "description": "An alternative project manager and uploader for vex v5 projects", "main": "out/main.js", "scripts": { "build": "tsc", - "check-lint": "eslint \"src/**/*.ts\"", + "check-lint": "eslint \"src/**.ts\" --cache --cache-location node_modules/.cache/eslint/.eslintcache", "check-format": "prettier . -c --cache", "pre-commit": "npm run check-lint && npm run check-format", "lint": "npm run check-lint --fix", @@ -14,7 +14,8 @@ "test": "echo not implemented yet", "package": "pkg . -t node18", "prepare": "husky install", - "prepack": "npm run check-lint && npm run check-format" + "prepack": "npm run check-lint && npm run check-format", + "semantic-release": "semantic-release" }, "keywords": [ "lemlib", @@ -36,7 +37,8 @@ "husky": "^8.0.0", "jest": "^29.7.0", "prettier": "^3.1.0", - "typescript": "^5.0.2" + "typescript": "^5.0.2", + "semantic-release": "^22.0.8" }, "bin": { "lem-link": "out/main.js" @@ -46,22 +48,18 @@ }, "release": { "branches": [ - "main", + "stable", { - "name": "beta", + "name": "pre-release", "prerelease": true } - ], - "plugins": [ - "@semantic-release/commit-analyzer", - "@semantic-release/release-notes-generator", - [ - "@semantic-release/npm", - { - "npmPublish": false - } - ], - "@semantic-release/github" ] + }, + "repository": { + "type": "git", + "url": "https://github.com/meisZWFLZ/LemLink.git" + }, + "publishConfig": { + "registry": "https://registry.npmjs.org/" } } diff --git a/src/main.ts b/src/main.ts index fa7253d..4fc6be2 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1 +1 @@ -console.log("hello lemlib"); +console.log("hello lemlib + feature!");