我努力理解这个keystonejs项目https://github.com/keystonejs/keystone的目标,它基于其中的许多模块和其中的许多 package.json。
它也包含根 package.json。
它基于 react 17 和节点 14/16 和 graphql。
包结构根
子模块的封装结构
根包.json
{
"name": "@keystone-6/mono-repo",
"description": "KeystoneJS monorepo for all the @keystone-6 packages",
"private": true,
"version": "0.0.0",
"author": "The KeystoneJS Development Team",
"license": "MIT",
"repository": "https://github.com/keystonejs/keystone",
"homepage": "https://github.com/keystonejs/keystone",
"scripts": {
"prisma": "prisma",
"docs": "manypkg run @keystone-6/website dev",
"coverage": "cross-env DISABLE_LOGGING=true NODE_ENV=test jest --runInBand --coverage",
"format:file": "prettier --write",
"format": "prettier --write \"**/*.{js,json,ts,tsx,md,mdx}\" && remark . --output",
"fresh": "yarn clean && yarn",
"clean": "rimraf \"**/node_modules\" \"**/yarn-error.log\" \"**/out.log\" \"**/.DS_Store\" \"**/dist\"",
"lint:eslint": "eslint . --ext ts,tsx,js",
"lint:prettier": "prettier --list-different \"**/*.{js,json,ts,tsx}\"",
"lint:markdown": "remark . --frail --quiet",
"lint:types": "tsc",
"lint": "yarn lint:prettier && yarn lint:eslint && yarn lint:markdown && yarn lint:types && yarn lint:filters",
"test": "yarn lint && yarn test:unit",
"test:unit": "cross-env DISABLE_LOGGING=true NODE_ENV=test jest --no-watchman --runInBand --logHeapUsage",
"test:unit:debug": "cross-env NODE_ENV=test node --inspect-brk `which jest` --runInBand",
"test:admin-ui": "yarn jest tests/admin-ui-tests",
"benchmark": "yarn workspace @keystone-6/benchmarks-legacy go",
"changeset": "changeset",
"publish-changed": "yarn build && changeset publish --public",
"version-packages": "changeset version",
"build": "preconstruct build",
"prepare": "manypkg check && preconstruct dev && yarn run --silent contributing-guide && node scripts/generate-artifacts-for-projects",
"contributing-guide": "is-ci && exit 0 || chalk -t \"{bold Contributing to KeystoneJS?}\" && terminal-link \" Read the full Contributing Guide\" \"https://github.com/keystonejs/keystone/blob/main/CONTRIBUTING.md\"",
"npm-tag": "manypkg npm-tag",
"update": "manypkg upgrade",
"update-project-schemas": "cross-env UPDATE_SCHEMAS=1 node scripts/generate-artifacts-for-projects",
"generate-filters": "cd prisma-utils && yarn generate",
"lint:filters": "cd prisma-utils && yarn verify"
},
"dependencies": {
"@babel/core": "^7.16.0",
"@babel/plugin-proposal-class-properties": "^7.16.0",
"@babel/plugin-proposal-object-rest-spread": "^7.16.0",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.16.0",
"@babel/preset-env": "^7.16.0",
"@babel/preset-react": "^7.16.0",
"@babel/preset-typescript": "^7.16.0",
"@changesets/changelog-github": "^0.4.1",
"@changesets/cli": "^2.18.0",
"@jest/test-sequencer": "^27.3.1",
"@manypkg/cli": "^0.19.1",
"@preconstruct/cli": "2.1.5",
"@preconstruct/eslint-plugin-format-js-tag": "^0.2.0",
"@testing-library/jest-dom": "^5.15.0",
"@types/babel__core": "^7.1.16",
"@types/jest": "^27.0.2",
"@types/node-fetch": "^2.5.12",
"@types/normalize-path": "3.0.0",
"@typescript-eslint/eslint-plugin": "^5.7.0",
"@typescript-eslint/parser": "^5.7.0",
"chalk-cli": "^5.0.0",
"cross-env": "^7.0.3",
"eslint": "^7.32.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-jest": "^25.2.4",
"eslint-plugin-react": "^7.27.0",
"eslint-plugin-react-hooks": "^4.3.0",
"is-ci": "^3.0.1",
"jest": "^27.3.1",
"prettier": "^2.5.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"remark-cli": "^6.0.1",
"remark-frontmatter": "^1.3.3",
"remark-toc": "^5.1.1",
"rimraf": "^3.0.2",
"terminal-link-cli": "^3.0.0",
"typescript": "^4.4.4"
},
"prettier": {
"proseWrap": "preserve",
"singleQuote": true,
"trailingComma": "es5",
"printWidth": 100,
"arrowParens": "avoid",
"overrides": [
{
"files": "docs/**",
"options": {
"embeddedLanguageFormatting": "off"
}
}
]
},
"remarkConfig": {
"settings": {
"commonmark": true,
"fences": true,
"listItemIndent": "1",
"rule": "-",
"ruleSpaces": false
},
"plugins": [
"remark-frontmatter",
"remark-toc"
]
},
"workspaces": {
"packages": [
"design-system/packages/*",
"design-system/website",
"docs",
"examples-staging/*",
"examples/*",
"packages/*",
"tests/admin-ui-tests",
"tests/api-tests",
"tests/benchmarks",
"tests/examples-smoke-tests",
"tests/test-projects/*",
"prisma-utils",
"scripts/*"
]
},
"preconstruct": {
"packages": [
"packages/*",
"design-system/packages/*",
"prisma-utils",
"scripts/*"
]
},
"manypkg": {
"defaultBranch": "main"
},
"jest": {
"setupFilesAfterEnv": [
"./tests/jest/setup.ts"
],
"testSequencer": "./tests/jest/jest-sequencer.js",
"testEnvironment": "node",
"testPathIgnorePatterns": [
"/node_modules/"
],
"transformIgnorePatterns": [
"/node_modules/",
"\\.pnp\\.[^\\/]+$"
],
"collectCoverageFrom": [
"packages/**/*.{js,ts,tsx}",
"!**/*.d.ts",
"!packages/**/dist/**",
"!packages/keystone/src/fields/**/test-fixtures.{js,ts}"
]
},
"resolutions": {
"babel-plugin-remove-graphql-queries": "2.7.2"
},
"engines": {
"node": "^14.15 || ^16.13"
}
}
这个存储库代码 keystonejs 框架本身吗?如果是,我应该在本地 keystonejs 框架中使用它作为依赖项吗?
我们可以在本地运行这个项目吗?或者我们可以创建这个 docker 图像吗?
谁能给我一些建议,因为我无法理解这个回购背后的主要目的?
即使我尝试在 dockerfile 下面创建它的图像,但没有成功,最终遇到了一些与 yarn 的运行命令相关的问题
# https://docs.docker.com/samples/library/node/
ARG NODE_VERSION=16.13
# https://github.com/Yelp/dumb-init/releases
ARG DUMB_INIT_VERSION=1.2.2
# Build container
FROM node:${NODE_VERSION}-alpine AS build
ARG DUMB_INIT_VERSION
WORKDIR /home/node
RUN apk add --no-cache build-base python2 yarn && \
wget -O dumb-init -q https://github.com/Yelp/dumb-init/releases/download/v${DUMB_INIT_VERSION}/dumb-init_${DUMB_INIT_VERSION}_amd64 && \
chmod +x dumb-init
ADD ./package.json ./package.json
ADD ./yarn.lock ./yarn.lock
RUN yarn install
ADD . /home/node
RUN yarn build && yarn cache clean
# Runtime container
FROM node:${NODE_VERSION}-alpine
WORKDIR /home/node
COPY --from=build /home/node /home/node
EXPOSE 3000
CMD ["./dumb-init", "yarn", "start"]
错误:
[+] Building 50.6s (11/14)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 813B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 34B 0.0s
=> [internal] load metadata for docker.io/library/node:16.13-alpine 3.3s
=> [auth] library/node:pull token for registry-1.docker.io 0.0s
=> [internal] load build context 1.2s
=> => transferring context: 635.00kB 1.2s
=> [build 1/8] FROM docker.io/library/node:16.13-alpine@sha256:2f50f4a428f8b5280817c9d4d896dbee03f072e93f4e0c70b90cc84bd1fcfe0d 0.0s
=> CACHED [build 2/8] WORKDIR /home/node 0.0s
=> CACHED [build 3/8] RUN apk add --no-cache build-base python2 yarn && wget -O dumb-init -q https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_amd64 && 0.0s
=> CACHED [build 4/8] ADD ./package.json ./package.json 0.0s
=> CACHED [build 5/8] ADD ./yarn.lock ./yarn.lock 0.0s
=> ERROR [build 6/8] RUN yarn install 46.0s
------
> [build 6/8] RUN yarn install:
#11 0.589 yarn install v1.22.15
#11 0.743 [1/5] Validating package.json...
#11 0.750 [2/5] Resolving packages...
#11 1.840 [3/5] Fetching packages...
#11 35.27 info fsevents@2.3.2: The platform "linux" is incompatible with this module.
#11 35.27 info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
#11 35.29 info fsevents@1.2.13: The platform "linux" is incompatible with this module.
#11 35.29 info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
#11 35.30 [4/5] Linking dependencies...
#11 35.30 warning " > babel-plugin-remove-graphql-queries@2.7.2" has unmet peer dependency "gatsby@^2.0.0".
#11 35.30 warning " > babel-plugin-remove-graphql-queries@2.7.2" has unmet peer dependency "graphql@^14.1.1".
#11 43.78 [5/5] Building fresh packages...
#11 44.28 success Saved lockfile.
#11 44.29 $ manypkg check && preconstruct dev && yarn run --silent contributing-guide && node scripts/generate-artifacts-for-projects
#11 44.58 ☔️ success workspaces valid!
#11 45.09 info project is valid!
#11 45.09 success created links!
#11 45.57 Contributing to KeystoneJS?
#11 45.75 Read the full Contributing Guide (https://github.com/keystonejs/keystone/blob/main/CONTRIBUTING.md)
#11 45.80 node:internal/modules/cjs/loader:936
#11 45.80 throw err;
#11 45.80 ^
#11 45.80
#11 45.80 Error: Cannot find module '/home/node/scripts/generate-artifacts-for-projects'
#11 45.80 at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
#11 45.80 at Function.Module._load (node:internal/modules/cjs/loader:778:27)
#11 45.80 at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
#11 45.80 at node:internal/main/run_main_module:17:47 {
#11 45.80 code: 'MODULE_NOT_FOUND',
#11 45.80 requireStack: []
#11 45.80 }
#11 45.81 error Command failed with exit code 1.
#11 45.81 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
------
executor failed running [/bin/sh -c yarn install]: exit code: 1
我想知道这个回购的意图。