Compare commits
2 commits
master
...
3.4.48-344
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
acd5fedc68 | ||
|
|
135913d4bb |
7 changed files with 17767 additions and 8928 deletions
28
.github/workflows/test-and-publish.yml
vendored
28
.github/workflows/test-and-publish.yml
vendored
|
|
@ -61,17 +61,17 @@ jobs:
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
cache: 'yarn'
|
cache: 'npm'
|
||||||
- name: Log environment setup
|
- name: Log environment setup
|
||||||
run: |
|
run: |
|
||||||
node -v
|
node -v
|
||||||
yarn -v
|
npm -v
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: yarn install --ignore-engines
|
run: npm install
|
||||||
- name: Build templates
|
- name: Build templates
|
||||||
run: yarn run build:templates
|
run: npm run build:templates
|
||||||
- name: Build library
|
- name: Build library
|
||||||
run: yarn run build
|
run: npm run build
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -97,12 +97,12 @@ jobs:
|
||||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
tag: "${{ env.version }}"
|
tag: "${{ env.version }}"
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: yarn
|
run: npm install
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
node-version: '18.x'
|
node-version: '18.x'
|
||||||
- name: Configure Yarn version
|
- name: Configure NPM version
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -112,19 +112,17 @@ jobs:
|
||||||
echo "registry=https://registry.npmjs.org/" >> .npmrc
|
echo "registry=https://registry.npmjs.org/" >> .npmrc
|
||||||
echo "access=public" >> .npmrc
|
echo "access=public" >> .npmrc
|
||||||
echo "save-exact=true" >> .npmrc
|
echo "save-exact=true" >> .npmrc
|
||||||
yarn config set version-tag-prefix ""
|
|
||||||
yarn config set version-git-message "Release version %s"
|
|
||||||
- name: Version package
|
- name: Version package
|
||||||
run: |
|
run: |
|
||||||
# Update version in packages to publish
|
# Update version in packages to publish
|
||||||
yarn version --non-interactive --new-version $(cat .version)
|
npm version $(cat .version) -m "Release version %s"
|
||||||
- name: Publish to NPM
|
- name: Publish to NPM
|
||||||
run: yarn publish --tag $(cat .tag) --non-interactive --new-version $(cat .version)
|
run: npm publish --tag $(cat .tag)
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '18.x'
|
node-version: '18.x'
|
||||||
registry-url: 'https://npm.pkg.github.com'
|
registry-url: 'https://npm.pkg.github.com'
|
||||||
- name: Configure Yarn version
|
- name: Configure NPM version
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -134,18 +132,16 @@ jobs:
|
||||||
echo "@rtfpessoa:registry=https://npm.pkg.github.com/" >> .npmrc
|
echo "@rtfpessoa:registry=https://npm.pkg.github.com/" >> .npmrc
|
||||||
echo "access=public" >> .npmrc
|
echo "access=public" >> .npmrc
|
||||||
echo "save-exact=true" >> .npmrc
|
echo "save-exact=true" >> .npmrc
|
||||||
yarn config set version-tag-prefix ""
|
|
||||||
yarn config set version-git-message "Release version %s"
|
|
||||||
- name: Version package
|
- name: Version package
|
||||||
run: |
|
run: |
|
||||||
# Update version in packages to publish
|
# Update version in packages to publish
|
||||||
yarn version --non-interactive --new-version $(cat .version)
|
npm version $(cat .version) -m "Release version %s"
|
||||||
- name: Publish to GPR
|
- name: Publish to GPR
|
||||||
run: |
|
run: |
|
||||||
# HACK: Override npm package name to be able to publish in GitHub
|
# HACK: Override npm package name to be able to publish in GitHub
|
||||||
sed -i 's/^ "name":.*/ "name": "@rtfpessoa\/diff2html",/g' package.json
|
sed -i 's/^ "name":.*/ "name": "@rtfpessoa\/diff2html",/g' package.json
|
||||||
echo "Going to publish version $(cat .version) to GitHub"
|
echo "Going to publish version $(cat .version) to GitHub"
|
||||||
yarn publish --tag $(cat .tag) --non-interactive --new-version $(cat .version)
|
npm publish --tag $(cat .tag)
|
||||||
# HACK: Restore npm package name
|
# HACK: Restore npm package name
|
||||||
sed -i 's/^ "name":.*/ "name": "diff2html",/g' package.json
|
sed -i 's/^ "name":.*/ "name": "diff2html",/g' package.json
|
||||||
- name: Upload docs
|
- name: Upload docs
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
. "$(dirname "$0")/_/husky.sh"
|
. "$(dirname "$0")/_/husky.sh"
|
||||||
|
|
||||||
npx lint-staged
|
npm run lint:staged
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,9 @@
|
||||||
|
|
||||||
- Before sending a pull request make sure your code is tested.
|
- Before sending a pull request make sure your code is tested.
|
||||||
|
|
||||||
- Before sending a pull request for a feature, be sure to run tests with `yarn test`.
|
- Before sending a pull request for a feature, be sure to run tests with `npm run test`.
|
||||||
|
|
||||||
- Use the same coding style as the rest of the codebase, most of the check can be performed with `yarn run lint`.
|
- Use the same coding style as the rest of the codebase, most of the check can be performed with `npm run run lint`.
|
||||||
|
|
||||||
- Use `git rebase` (not `git merge`) to sync your work from time to time with the master branch.
|
- Use `git rebase` (not `git merge`) to sync your work from time to time with the master branch.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -321,7 +321,7 @@ import { Controller } from '@hotwired/stimulus';
|
||||||
|
|
||||||
import { Diff2HtmlUI, Diff2HtmlUIConfig } from 'diff2html/lib/ui/js/diff2html-ui-slim.js';
|
import { Diff2HtmlUI, Diff2HtmlUIConfig } from 'diff2html/lib/ui/js/diff2html-ui-slim.js';
|
||||||
|
|
||||||
// Requires `yarn add highlight.js`
|
// Requires `npm install highlight.js`
|
||||||
import 'highlight.js/styles/github.css';
|
import 'highlight.js/styles/github.css';
|
||||||
import 'diff2html/bundles/css/diff2html.min.css';
|
import 'diff2html/bundles/css/diff2html.min.css';
|
||||||
|
|
||||||
|
|
|
||||||
17737
package-lock.json
generated
Normal file
17737
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
27
package.json
27
package.json
|
|
@ -36,32 +36,33 @@
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"eslint": "eslint --ignore-path .gitignore \"**/*.{js,jsx,ts,tsx,json}\"",
|
"eslint": "eslint --ignore-path .gitignore \"**/*.{js,jsx,ts,tsx,json}\"",
|
||||||
"lint:check": "yarn run eslint",
|
"lint:staged": "lint-staged",
|
||||||
"lint:fix": "yarn run eslint --fix",
|
"lint:check": "eslint",
|
||||||
|
"lint:fix": "eslint --fix",
|
||||||
"prettier": "prettier --ignore-path .gitignore '**/*.+(js|jsx|ts|tsx|json|css|html|md|mdx)'",
|
"prettier": "prettier --ignore-path .gitignore '**/*.+(js|jsx|ts|tsx|json|css|html|md|mdx)'",
|
||||||
"format:check": "yarn run prettier --check",
|
"format:check": "npm run prettier --check",
|
||||||
"format:fix": "yarn run prettier --write",
|
"format:fix": "npm run prettier --write",
|
||||||
"build": "yarn run build:css && yarn run build:templates && yarn run build:commonjs && yarn run build:esm && yarn run build:bundles && yarn run build:website",
|
"build": "npm run build:css && npm run build:templates && npm run build:commonjs && npm run build:esm && npm run build:bundles && npm run build:website",
|
||||||
"build:commonjs": "rm -rf lib; tsc -p tsconfig.json --outDir lib",
|
"build:commonjs": "rm -rf lib; tsc -p tsconfig.json --outDir lib",
|
||||||
"build:esm": "rm -rf lib-esm; tsc -p tsconfig.json -m ESNext --outDir lib-esm",
|
"build:esm": "rm -rf lib-esm; tsc -p tsconfig.json -m ESNext --outDir lib-esm",
|
||||||
"build:bundles": "rm -rf ./bundles/js; webpack --mode production --config webpack.bundles.ts",
|
"build:bundles": "rm -rf ./bundles/js; webpack --mode production --config webpack.bundles.ts",
|
||||||
"build:css": "rm -rf ./bundles/css; postcss --config ./postcss.config.js --no-map -o ./bundles/css/diff2html.min.css ./src/ui/css/diff2html.css",
|
"build:css": "rm -rf ./bundles/css; postcss --config ./postcss.config.js --no-map -o ./bundles/css/diff2html.min.css ./src/ui/css/diff2html.css",
|
||||||
"build:templates": "ts-node ./scripts/hulk.ts --wrapper ts --variable 'defaultTemplates' ./src/templates/*.mustache > ./src/diff2html-templates.ts",
|
"build:templates": "ts-node ./scripts/hulk.ts --wrapper ts --variable 'defaultTemplates' ./src/templates/*.mustache > ./src/diff2html-templates.ts",
|
||||||
"build:website": "rm -rf docs; webpack --mode production --config webpack.website.ts",
|
"build:website": "rm -rf docs; webpack --mode production --config webpack.website.ts",
|
||||||
"gen": "yarn run gen:toc",
|
"gen": "npm run gen:toc",
|
||||||
"gen:toc-base": "markdown-toc --maxdepth 3 --bullets='-' -i",
|
"gen:toc-base": "markdown-toc --maxdepth 3 --bullets='-' -i",
|
||||||
"gen:toc": "yarn run gen:toc-base README.md",
|
"gen:toc": "npm run gen:toc-base README.md",
|
||||||
"test": "is-ci 'test:coverage' 'test:watch'",
|
"test": "is-ci 'test:coverage' 'test:watch'",
|
||||||
"test:coverage": "jest --coverage",
|
"test:coverage": "jest --coverage",
|
||||||
"test:watch": "jest --watch",
|
"test:watch": "jest --watch",
|
||||||
"test:debug": "node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand --watch",
|
"test:debug": "node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand --watch",
|
||||||
"coverage:open": "yarn run test:coverage && open ./coverage/index.html",
|
"coverage:open": "npm run test:coverage && open ./coverage/index.html",
|
||||||
"coverage:push": "curl -Ls https://coverage.codacy.com/get.sh | bash",
|
"coverage:push": "curl -Ls https://coverage.codacy.com/get.sh | bash",
|
||||||
"validate": "yarn run build:templates && yarn run format:check && yarn run lint:check && yarn run build && yarn run test:coverage",
|
"validate": "npm run build:templates && npm run format:check && npm run lint:check && npm run build && npm run test:coverage",
|
||||||
"fix": "yarn run format:fix && yarn run lint:fix",
|
"fix": "npm run format:fix && npm run lint:fix",
|
||||||
"start": "yarn run start:website",
|
"start": "npm run start:website",
|
||||||
"start:website": "webpack serve --mode development --config webpack.website.ts",
|
"start:website": "webpack serve --mode development --config webpack.website.ts",
|
||||||
"preversion": "yarn run validate",
|
"preversion": "npm run validate",
|
||||||
"version": "git add -A package.json",
|
"version": "git add -A package.json",
|
||||||
"prepare": "husky install"
|
"prepare": "husky install"
|
||||||
},
|
},
|
||||||
|
|
@ -77,7 +78,7 @@
|
||||||
"prettier --write"
|
"prettier --write"
|
||||||
],
|
],
|
||||||
"README.md": [
|
"README.md": [
|
||||||
"yarn run gen:toc-base"
|
"npm run gen:toc-base"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue