From b654eb33234de5922f4089d1b400cae1065b4b1e Mon Sep 17 00:00:00 2001 From: Himenon Date: Thu, 6 Feb 2020 13:06:54 +0900 Subject: [PATCH] ci: update checkout settings --- .github/workflows/pull-request-workflow.yml | 6 ++-- .github/workflows/push-master-workflow.yml | 2 +- .github/workflows/release-workflow.yml | 4 +-- jest.config.json | 18 ----------- lerna.json | 8 ++--- package.json | 1 + packages/cli/package.json | 1 + packages/view/jest.config.json | 7 ++--- packages/view/package.json | 3 +- packages/view/scripts/webpack.config.ts | 9 +----- .../FileTree/__tests__/Store.test.ts | 30 ++++++++++++------- 11 files changed, 35 insertions(+), 54 deletions(-) delete mode 100644 jest.config.json diff --git a/.github/workflows/pull-request-workflow.yml b/.github/workflows/pull-request-workflow.yml index 74fd5ca..cc1f276 100644 --- a/.github/workflows/pull-request-workflow.yml +++ b/.github/workflows/pull-request-workflow.yml @@ -8,12 +8,12 @@ jobs: strategy: matrix: - node-version: [10.x] + node-version: [12.x] steps: - uses: actions/checkout@v2 with: - ref: master + ref: ${{ github.event.pull_request.head.sha }} - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: @@ -23,6 +23,6 @@ jobs: run: | yarn install --frozen-lockfile yarn build - yarn test + yarn test:ci env: CI: true diff --git a/.github/workflows/push-master-workflow.yml b/.github/workflows/push-master-workflow.yml index 7ab60ce..254d3f8 100644 --- a/.github/workflows/push-master-workflow.yml +++ b/.github/workflows/push-master-workflow.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: - node-version: [10.x] + node-version: [12.x] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/release-workflow.yml b/.github/workflows/release-workflow.yml index c27a566..fd92e78 100644 --- a/.github/workflows/release-workflow.yml +++ b/.github/workflows/release-workflow.yml @@ -13,10 +13,10 @@ jobs: ref: master - uses: actions/setup-node@v1 with: - node-version: 10 + node-version: 12 - run: | yarn install --frozen-lockfile - yarn test + yarn test:ci yarn build # release-github-npm-registry: diff --git a/jest.config.json b/jest.config.json deleted file mode 100644 index fe2fae8..0000000 --- a/jest.config.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "automock": true, - "unmockedModulePathPatterns": ["/node_modules/*"], - "roots": ["/src"], - "globals": { - "ts-jest": { - "tsConfig": "tsconfig.json", - "diagnostics": false - } - }, - "moduleDirectories": ["node_modules"], - "moduleFileExtensions": ["ts", "tsx", "js", "jsx", "node"], - "testMatch": ["**/__tests__/*.test.+(ts|tsx)"], - "collectCoverage": true, - "transform": { - "^.+\\.(ts|tsx)$": "ts-jest" - } -} diff --git a/lerna.json b/lerna.json index 6998d28..b03e3a5 100644 --- a/lerna.json +++ b/lerna.json @@ -11,14 +11,10 @@ "publish": { "access": "public", "allowBranch": "master", - "ignoreChanges": [ - "CHANGELOG.md" - ] + "ignoreChanges": ["CHANGELOG.md"] } }, - "packages": [ - "packages/*" - ], + "packages": ["packages/*"], "version": "0.3.7", "npmClient": "yarn", "registry": "https://registry.npmjs.org/", diff --git a/package.json b/package.json index a2909b2..51ffe63 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "lint": "eslint -c ./.eslintrc.js 'packages/**/*.{ts,tsx}'", "lint:fix": "yarn lint --fix", "test": "lerna run test", + "test:ci": "lerna run test:ci", "version_up": "lerna version --yes" }, "husky": { diff --git a/packages/cli/package.json b/packages/cli/package.json index ffca1ec..c622ef1 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -38,6 +38,7 @@ "server": "nodemon ./bin/code-dependency.js --source ./src --exclude node_modules", "start": "run-p develop server", "test": "jest -c jest.config.json && yarn export:static", + "test:ci": "jest -c jest.config.json --no-cache --ci && yarn export:static", "test:depcruise": "depcruise --validate .dependency-cruiser.json src", "ts": "ts-node -P tsconfig.json" }, diff --git a/packages/view/jest.config.json b/packages/view/jest.config.json index ab077cc..afc5ace 100644 --- a/packages/view/jest.config.json +++ b/packages/view/jest.config.json @@ -10,13 +10,10 @@ } }, "moduleNameMapper": { - "^@this/domain(.*)": "/src/domain$1", - "^@this/container-component(.*)": "/src/container-component$1", - "^@this/view-component(.*)": "/src/view-component$1", - "^@this/infra(.*)": "/src/infra$1" + "@app/(.+)": "/src/$1" }, "moduleDirectories": ["node_modules"], - "moduleFileExtensions": ["ts", "tsx", "js", "jsx", "node"], + "moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json"], "testMatch": ["**/__tests__/*.test.+(ts|tsx)"], "collectCoverage": true, "transform": { diff --git a/packages/view/package.json b/packages/view/package.json index bf9a816..fff0282 100644 --- a/packages/view/package.json +++ b/packages/view/package.json @@ -26,7 +26,8 @@ "develop": "cross-env-shell NODE_ENV=development yarn ts ./scripts/develop.ts", "serve": "serve dist", "start": "yarn develop", - "test": "jest -c jest.config.json", + "test": "jest -c jest.config.json --no-cache", + "test:ci": "jest -c jest.config.json --no-cache --ci", "ts": "ts-node -P ./scripts/tsconfig.cli.json" }, "dependencies": { diff --git a/packages/view/scripts/webpack.config.ts b/packages/view/scripts/webpack.config.ts index ab19bf3..617a0f6 100644 --- a/packages/view/scripts/webpack.config.ts +++ b/packages/view/scripts/webpack.config.ts @@ -195,14 +195,7 @@ export const generateConfig = ({ isProduction, isLibrary, ...option }: Option): resolve: { extensions: [".js", ".ts", ".tsx", ".scss", ".json"], alias: { - "@app/component": appPath("./src/component/index.ts"), - "@app/container": appPath("./src/container/index.ts"), - "@app/domain": appPath("./src/domain/index.ts"), - "@app/infra": appPath("./src/infra/index.ts"), - "@app/router": appPath("./src/router/index.tsx"), - "@app/interface": appPath("./src/interface/index.ts"), - "@app/style": appPath("./src/style/index.ts"), - "@app/api": appPath("./src/api/index.ts"), + "@app": appPath("./src"), React: appPath("../../node_modules/react"), ReactDOM: appPath("../../node_modules/react-dom"), }, diff --git a/packages/view/src/container/FileTree/__tests__/Store.test.ts b/packages/view/src/container/FileTree/__tests__/Store.test.ts index bf4bea5..79ca9c7 100644 --- a/packages/view/src/container/FileTree/__tests__/Store.test.ts +++ b/packages/view/src/container/FileTree/__tests__/Store.test.ts @@ -23,59 +23,69 @@ const filePathObjectList: FilePathObject[] = [ const directoryResult: SideNavItem.Props[] = [ { id: ".", + isDefaultOpen: true, name: "@code-dependency", - to: "", + to: "@code-dependency", items: [ { id: ".", + isDefaultOpen: true, name: ".", - to: "", + to: ".", items: [ { id: "./a", + isDefaultOpen: false, name: "a", - to: "", + to: "a", items: [ { id: "./a/b", + isDefaultOpen: false, name: "b", - to: "", + to: "b", items: [ { id: "./a/b/c", + isDefaultOpen: false, name: "c", - to: "", + to: "c", items: [ { id: "./a/b/c/index.ts", + isDefaultOpen: false, name: "index.ts", - to: "", + to: "/project?pathname=.%2Fa%2Fb%2Fc%2Findex.ts", }, ], }, { id: "./a/b/index.ts", + isDefaultOpen: false, name: "index.ts", - to: "", + to: "/project?pathname=.%2Fa%2Fb%2Findex.ts", }, ], }, { id: "./a/index.ts", + isDefaultOpen: false, name: "index.ts", - to: "", + to: "/project?pathname=.%2Fa%2Findex.ts", }, ], }, { id: "./app.ts", + isDefaultOpen: false, name: "app.ts", - to: "", + to: "/project?pathname=.%2Fapp.ts", }, { id: "./index.ts", + isDefaultOpen: false, name: "index.ts", - to: "", + to: "/project?pathname=.%2Findex.ts", }, ], },