|
9 | 9 | "src",
|
10 | 10 | "templates"
|
11 | 11 | ],
|
12 |
| - "main": "lib/index", |
| 12 | + "type": "module", |
| 13 | + "exports": "./lib/index.js", |
13 | 14 | "repository": "api-platform/client-generator",
|
14 | 15 | "homepage": "https://github.com/api-platform/client-generator",
|
15 | 16 | "bugs": "https://github.com/api-platform/client-generator/issues",
|
|
18 | 19 | "devDependencies": {
|
19 | 20 | "@babel/cli": "^7.0.0",
|
20 | 21 | "@babel/core": "^7.0.0",
|
| 22 | + "@babel/eslint-parser": "^7.0.0", |
21 | 23 | "@babel/plugin-proposal-class-properties": "^7.0.0",
|
22 | 24 | "@babel/plugin-proposal-export-default-from": "^7.0.0",
|
23 | 25 | "@babel/plugin-transform-flow-strip-types": "^7.0.0",
|
24 | 26 | "@babel/plugin-transform-runtime": "^7.0.0",
|
25 | 27 | "@babel/preset-env": "^7.6.0",
|
26 |
| - "babel-eslint": "^10.0.0", |
27 |
| - "babel-jest": "^26.0.0", |
28 |
| - "eslint": "^7.17.0", |
29 |
| - "eslint-config-prettier": "^7.1.0", |
30 |
| - "eslint-plugin-import": "^2.14.0", |
31 |
| - "eslint-plugin-prettier": "^3.3.0", |
32 |
| - "husky": "^4.3.6", |
33 |
| - "jest": "^26.6.3", |
34 |
| - "lint-staged": "^10.5.3", |
| 28 | + "@playwright-testing-library/test": "4.3.0-beta.1", |
| 29 | + "@playwright/test": "^1.25.0", |
| 30 | + "babel-jest": "^28.1.0", |
| 31 | + "eslint": "^8.22.0", |
| 32 | + "eslint-config-prettier": "^8.5.0", |
| 33 | + "eslint-plugin-import": "^2.26.0", |
| 34 | + "eslint-plugin-prettier": "^4.2.0", |
| 35 | + "husky": "^8.0.0", |
| 36 | + "jest": "^28.1.0", |
| 37 | + "jest-light-runner": "^0.3.0", |
| 38 | + "lint-staged": "^13.0.0", |
| 39 | + "start-server-and-test": "^1.14.0", |
35 | 40 | "tmp": "^0.2.1"
|
36 | 41 | },
|
37 | 42 | "dependencies": {
|
38 |
| - "@api-platform/api-doc-parser": "^0.12.0", |
| 43 | + "@api-platform/api-doc-parser": "^0.15.0", |
39 | 44 | "@babel/runtime": "^7.0.0",
|
40 |
| - "chalk": "^4.1.0", |
41 |
| - "commander": "^8.2.0", |
| 45 | + "chalk": "^5.0.0", |
| 46 | + "commander": "^9.4.0", |
42 | 47 | "handlebars": "^4.0.12",
|
43 | 48 | "handlebars-helpers": "^0.10.0",
|
44 | 49 | "isomorphic-fetch": "^3.0.0",
|
45 | 50 | "mkdirp": "^1.0.4",
|
46 |
| - "prettier": "^2.2.1", |
| 51 | + "prettier": "^2.7.0", |
47 | 52 | "sprintf-js": "^1.1.1"
|
48 | 53 | },
|
49 | 54 | "scripts": {
|
| 55 | + "prepare": "husky install", |
50 | 56 | "test": "jest src",
|
51 | 57 | "lint": "eslint src",
|
52 | 58 | "fix": "eslint --fix src",
|
|
55 | 61 | "watch": "babel --watch src -d lib --ignore '*.test.js'",
|
56 | 62 | "test-gen": "rm -rf ./tmp && yarn build && ./lib/index.js https://demo.api-platform.com ./tmp/react -g react && ./lib/index.js https://demo.api-platform.com ./tmp/react-native -g react-native && ./lib/index.js https://demo.api-platform.com ./tmp/next -g next && ./lib/index.js https://demo.api-platform.com ./tmp/vue -g vue",
|
57 | 63 | "test-gen-custom": "rm -rf ./tmp && yarn build && babel src/generators/ReactGenerator.js src/generators/BaseGenerator.js -d ./tmp/gens && cp -r ./templates/react ./templates/react-common ./templates/entrypoint.js ./tmp/gens && ./lib/index.js https://demo.api-platform.com ./tmp/react-custom -g \"$(pwd)/tmp/gens/ReactGenerator.js\" -t ./tmp/gens",
|
58 |
| - "test-gen-swagger": "rm -rf ./tmp && yarn build && ./lib/index.js https://demo.api-platform.com/docs.json ./tmp/react -f swagger && ./lib/index.js https://demo.api-platform.com/docs.json ./tmp/react-native -g react-native -f swagger && ./lib/index.js https://demo.api-platform.com/docs.json ./tmp/vue -g vue -f swagger", |
59 |
| - "test-gen-env": "rm -rf ./tmp && yarn build && API_PLATFORM_CLIENT_GENERATOR_ENTRYPOINT=https://demo.api-platform.com API_PLATFORM_CLIENT_GENERATOR_OUTPUT=./tmp ./lib/index.js" |
60 |
| - }, |
61 |
| - "husky": { |
62 |
| - "hooks": { |
63 |
| - "pre-commit": "lint-staged" |
64 |
| - } |
| 64 | + "test-gen-openapi3": "rm -rf ./tmp && yarn build && ./lib/index.js https://demo.api-platform.com/docs.json ./tmp/react -f openapi3 && ./lib/index.js https://demo.api-platform.com/docs.json ./tmp/react-native -g react-native -f openapi3 && ./lib/index.js https://demo.api-platform.com/docs.json ./tmp/vue -g vue -f openapi3", |
| 65 | + "test-gen-env": "rm -rf ./tmp && yarn build && API_PLATFORM_CLIENT_GENERATOR_ENTRYPOINT=https://demo.api-platform.com API_PLATFORM_CLIENT_GENERATOR_OUTPUT=./tmp ./lib/index.js", |
| 66 | + "test-app": "rm -rf ./tmp/app && mkdir -p ./tmp/app && yarn create next-app --typescript ./tmp/app/next && yarn --cwd ./tmp/app/next add lodash.get lodash.has isomorphic-unfetch formik react-query && yarn --cwd ./tmp/app/next add -D @types/lodash && cp -R ./tmp/next/* ./tmp/app/next && rm ./tmp/app/next/pages/index.tsx && rm -rf ./tmp/app/next/pages/api && yarn --cwd ./tmp/app/next build && start-server-and-test 'yarn --cwd ./tmp/app/next start' http://127.0.0.1:3000/books 'yarn playwright test'" |
65 | 67 | },
|
66 | 68 | "lint-staged": {
|
67 |
| - "src/**/*.js": "npm run lint" |
| 69 | + "src/**/*.js": "yarn lint --fix" |
68 | 70 | },
|
69 | 71 | "bin": {
|
70 | 72 | "generate-api-platform-client": "./lib/index.js"
|
|
0 commit comments