-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Code is still plain js, but fully covered by typescript via jsdocs * Refactor code to be more programatic * Added utils function that can check if we need to build & publish new version * Added dummy circleci file * Some vscode configs
- Loading branch information
Showing
17 changed files
with
4,144 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# this file still do nothing | ||
version: 2 | ||
|
||
aliases: | ||
- &docker | ||
- image: circleci/node:dubnium | ||
|
||
- &environment | ||
TZ: /usr/share/zoneinfo/America/Los_Angeles | ||
|
||
- &restore_yarn_cache | ||
restore_cache: | ||
name: Restore node_modules cache | ||
keys: | ||
- v1-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }} | ||
- v1-node-{{ arch }}-{{ .Branch }}- | ||
- v1-node-{{ arch }}- | ||
- &run_yarn | ||
run: | ||
name: Install Packages | ||
command: yarn --frozen-lockfile | ||
|
||
orbs: | ||
node: circleci/node@1.0.1 | ||
|
||
jobs: | ||
setup: | ||
docker: *docker | ||
environment: *environment | ||
|
||
steps: | ||
- checkout | ||
- run: | ||
name: Nodejs Version | ||
command: node --version | ||
- *restore_yarn_cache | ||
- *run_yarn | ||
- save_cache: | ||
name: Save node_modules cache | ||
key: v1-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }} | ||
paths: | ||
- ~/.cache/yarn | ||
|
||
# workflows: | ||
# version: 2 | ||
# nightly: | ||
# triggers: | ||
# - schedule: | ||
# # every 10 minutes | ||
# cron: "*/10 * * * *" | ||
# filters: | ||
# branches: | ||
# only: | ||
# - master | ||
# jobs: | ||
# - should-publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
node_modules | ||
target | ||
yarn-error.log | ||
yarn-error.log | ||
auto-publish/staging-area | ||
auto-publish/staging-area-for-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
lts/Dubnium |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["orta.vscode-jest", "editorconfig.editorconfig", "orta.vscode-jest"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/typescript/lib", | ||
"debug.node.autoAttach": "on", | ||
"jest.debugMode": false, | ||
"jest.autoEnable": false, | ||
"jest.enableCodeLens": true, | ||
"jest.enableInlineErrorMessages": true, | ||
"jest.runAllTestsFirst": true, | ||
"jest.debugCodeLens.showWhenTestStateIn": ["fail", "unknown", "pass", "skip"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Auto publish utils doesReactDOMHasNewerVersionThanUs - no! RC is ready: Correct params passed to execFile 1`] = ` | ||
[MockFunction] { | ||
"calls": Array [ | ||
Array [ | ||
"yarn", | ||
Array [ | ||
"info", | ||
"@hot-loader/react-dom", | ||
"--json", | ||
], | ||
Object { | ||
"cwd": undefined, | ||
"timeout": 2000, | ||
}, | ||
[Function], | ||
], | ||
Array [ | ||
"yarn", | ||
Array [ | ||
"info", | ||
"@hot-loader/react-dom", | ||
"--json", | ||
], | ||
Object { | ||
"cwd": undefined, | ||
"timeout": 2000, | ||
}, | ||
[Function], | ||
], | ||
Array [ | ||
"yarn", | ||
Array [ | ||
"info", | ||
"react-dom", | ||
"--json", | ||
], | ||
Object { | ||
"cwd": undefined, | ||
"timeout": 2000, | ||
}, | ||
[Function], | ||
], | ||
], | ||
"results": Array [ | ||
Object { | ||
"type": "return", | ||
"value": undefined, | ||
}, | ||
Object { | ||
"type": "return", | ||
"value": undefined, | ||
}, | ||
Object { | ||
"type": "return", | ||
"value": undefined, | ||
}, | ||
], | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const path = require("path"); | ||
const fs = require("fs-extra"); | ||
const { getAndPatchGivenReactDOMVersion } = require("./utils"); | ||
|
||
(async () => { | ||
const targetDir = await getAndPatchGivenReactDOMVersion(path.resolve(__dirname, "staging-area"), "16.8.6"); | ||
await fs.copy(targetDir, path.resolve(__dirname, "../target")) | ||
|
||
console.log("Done!"); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const fs = require("fs-extra"); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
export interface yarnInfoJsonResponse { | ||
type: "inspect"; | ||
data: { | ||
name: string; | ||
"dist-tags": Partial<{ | ||
[k: string]: string | ||
}>; | ||
versions: string[]; | ||
time: { [key: string]: string }; | ||
maintainers: Array<{ | ||
name: string; | ||
email: string; | ||
}>; | ||
description: string; | ||
homepage: string; | ||
repository: { | ||
type: string; | ||
url: string; | ||
}; | ||
bugs: { | ||
url: string; | ||
}; | ||
license: string; | ||
readmeFilename: string; | ||
keywords: string[]; | ||
version: string; | ||
}; | ||
/* | ||
example data: | ||
{ | ||
"type": "inspect", | ||
"data": { | ||
"name": "@hot-loader/react-dom", | ||
"dist-tags": { "latest": "16.8.6" }, | ||
"versions": [ | ||
"16.7.0-alpha.2", | ||
"16.7.0-alpha.2.1", | ||
"16.7.0-alpha.2.2", | ||
"16.7.0-alpha.2.3", | ||
"16.7.0-alpha.2.4", | ||
"16.7.0", | ||
"16.8.0-alpha.0", | ||
"16.8.1", | ||
"16.8.2", | ||
"16.8.3", | ||
"16.8.4", | ||
"16.8.5", | ||
"16.8.6" | ||
], | ||
"time": { | ||
"created": "2018-11-21T10:47:51.342Z", | ||
"16.7.0-alpha.2": "2018-11-21T10:47:51.742Z", | ||
"modified": "2019-03-28T09:32:10.123Z", | ||
"16.7.0-alpha.2.1": "2018-11-21T21:35:44.318Z", | ||
"16.7.0-alpha.2.2": "2018-12-07T12:21:53.582Z", | ||
"16.7.0-alpha.2.3": "2018-12-17T06:55:29.788Z", | ||
"16.7.0-alpha.2.4": "2018-12-19T09:23:40.548Z", | ||
"16.7.0": "2018-12-20T09:22:04.981Z", | ||
"16.8.0-alpha.0": "2019-01-10T04:39:04.893Z", | ||
"16.8.1": "2019-02-07T00:17:32.764Z", | ||
"16.8.2": "2019-02-18T21:58:30.554Z", | ||
"16.8.3": "2019-02-25T21:15:23.701Z", | ||
"16.8.4": "2019-03-07T09:04:23.315Z", | ||
"16.8.5": "2019-03-25T11:19:27.329Z", | ||
"16.8.6": "2019-03-28T09:32:06.816Z" | ||
}, | ||
"maintainers": [{ "name": "kashey", "email": "thekashey@gmail.com" }], | ||
"description": "The Hot version of React-DOM", | ||
"homepage": "https://github.com/hot-loader/react-dom#readme", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/hot-loader/react-dom.git" | ||
}, | ||
"bugs": { "url": "https://github.com/hot-loader/react-dom/issues" }, | ||
"license": "MIT", | ||
"readmeFilename": "README.md", | ||
"keywords": ["HMR", "react", "hot-loader"], | ||
"version": "latest" | ||
} | ||
} | ||
*/ | ||
} |
Oops, something went wrong.