🌐 AI搜索 & 代理 主页
Skip to content

Commit c9d33ad

Browse files
committed
Build: migrate most grunt tasks off of grunt
Updated tasks include: - lint - npmcopy - build, minify, and process for distribution. - new custom build command using yargs - compare size of minified/gzip built files - pretest scripts, including qunit-fixture, babel transpilation, and npmcopy - node smoke tests - promises aplus tests - new watch task using `rollup.watch` directly Also: - upgraded husky and added the new lint command - updated lint config to use new "flat" config format. See https://eslint.org/docs/latest/use/configure/configuration-files-new - Temporarily disabled one lint rule until flat config is supported by eslint-plugin-import. See import-js/eslint-plugin-import#2556 - committed package-lock.json - updated all test scripts to use the new build - added an express test server that uses middleware-mockserver this can be used to run tests without karma - build-all-variants is now build:all
1 parent 6fe8869 commit c9d33ad

Some content is hidden

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

72 files changed

+11137
-34977
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ charset = utf-8
1010
trim_trailing_whitespace = true
1111
insert_final_newline = true
1212

13-
[package.json]
13+
[*.{json,yml}]
1414
indent_style = space
1515
indent_size = 2
1616

.eslintignore

Lines changed: 0 additions & 17 deletions
This file was deleted.

.eslintrc-browser.json

Lines changed: 0 additions & 32 deletions
This file was deleted.

.eslintrc-node.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/node.js.yml

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -40,40 +40,47 @@ jobs:
4040
NODE_VERSION: "18.x"
4141
NPM_SCRIPT: "test:browser"
4242
BROWSERS: "FirefoxHeadless"
43+
4344
steps:
44-
- name: Checkout
45-
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
45+
- name: Checkout
46+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
47+
48+
- name: Cache
49+
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
50+
with:
51+
path: ~/.npm
52+
key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
53+
restore-keys: |
54+
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-
55+
56+
- name: Use Node.js ${{ matrix.NODE_VERSION }}
57+
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
58+
with:
59+
node-version: ${{ matrix.NODE_VERSION }}
4660

47-
- name: Cache
48-
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
49-
with:
50-
path: ~/.npm
51-
key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
52-
restore-keys: |
53-
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-
61+
- name: Install firefox ESR
62+
run: |
63+
export FIREFOX_SOURCE_URL='https://download.mozilla.org/?product=firefox-esr-latest&lang=en-US&os=linux64'
64+
wget --no-verbose $FIREFOX_SOURCE_URL -O - | tar -jx -C ${HOME}
65+
if: contains(matrix.NAME, 'Firefox ESR')
5466

55-
- name: Use Node.js ${{ matrix.NODE_VERSION }}
56-
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
57-
with:
58-
node-version: ${{ matrix.NODE_VERSION }}
67+
- name: Install dependencies
68+
run: npm install
5969

60-
- name: Install firefox ESR
61-
run: |
62-
export FIREFOX_SOURCE_URL='https://download.mozilla.org/?product=firefox-esr-latest&lang=en-US&os=linux64'
63-
wget --no-verbose $FIREFOX_SOURCE_URL -O - | tar -jx -C ${HOME}
64-
if: "contains(matrix.NAME, 'Firefox ESR')"
70+
- name: Install Playwright dependencies
71+
run: npx playwright-webkit install-deps
72+
if: matrix.NPM_SCRIPT == 'test:browser' && contains(matrix.BROWSERS, 'WebkitHeadless')
6573

66-
- name: Install dependencies
67-
run: |
68-
npm install
74+
- name: Lint code
75+
run: npm run lint
76+
if: matrix.NODE_VERSION == '18.x'
6977

70-
- name: Install Playwright dependencies
71-
run: npx playwright-webkit install-deps
72-
if: "matrix.NPM_SCRIPT == 'test:browser' && contains(matrix.BROWSERS, 'WebkitHeadless')"
78+
- name: Prepare tests
79+
run: npm run pretest
7380

74-
- name: Run tests
75-
env:
76-
BROWSERS: ${{ matrix.BROWSERS }}
77-
run: |
78-
export PATH=${HOME}/firefox:$PATH
79-
npm run ${{ matrix.NPM_SCRIPT }}
81+
- name: Run tests
82+
env:
83+
BROWSERS: ${{ matrix.BROWSERS }}
84+
run: |
85+
export PATH=${HOME}/firefox:$PATH
86+
npm run ${{ matrix.NPM_SCRIPT }}

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@
88
.bower.json
99
.sizecache.json
1010
yarn.lock
11-
package-lock.json
11+
.eslintcache
1212

1313
npm-debug.log*
1414

15-
# Ignore everything in `dist` folder except for the ESLint config
16-
/dist/*
17-
!/dist/.eslintrc.json
15+
/dist
1816

17+
/external
1918
/node_modules
2019

2120
/test/data/core/jquery-iterability-transpiled.js

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx commitplease .git/COMMIT_EDITMSG

.husky/pre-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm run lint
5+
npm run qunit-fixture

.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.eslintignore
2-
.eslintrc.json
2+
eslint.config.js
33

44
/.editorconfig
55
/.gitattributes

0 commit comments

Comments
 (0)