Skip to content

Commit

Permalink
chore: use github packages
Browse files Browse the repository at this point in the history
  • Loading branch information
septs committed Jul 19, 2020
1 parent 60cffa8 commit f1c74ac
Show file tree
Hide file tree
Showing 13 changed files with 103 additions and 101 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/E2E.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
image: differui/node-14.4.0-browsers:v1

# more: https://github.community/t5/GitHub-Actions/How-to-run-action-as-a-non-root-user/m-p/45733/highlight/true#M6330
options: '--user 1000
options: "--user 1000
-v /home/ubuntu/.cache/yarn/v6:/tmp/.yarn-cache-1000/v6
-v /home/ubuntu/.cache/alice_home:/tmp/alice_home
-v /home/ubuntu/.cache/bob_home:/tmp/bob_home
-v /home/ubuntu/.e2e/e2e-test:/tmp/e2e-test'
-v /home/ubuntu/.e2e/e2e-test:/tmp/e2e-test"

# more: https://stackoverflow.com/a/60202672/1986338
# volumes:
Expand All @@ -40,6 +40,10 @@ jobs:
# @v2 requires too much configurations
- uses: actions/checkout@v1

- uses: jgierer12/npm-auth-gpr@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install Dependencies
run: |
yarn config set cache-folder /tmp/.yarn-cache-1000/v6
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ jobs:
# @v2 requires too much configurations
- uses: actions/checkout@v1

- uses: jgierer12/npm-auth-gpr@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install Dependencies
run: |
yarn config set cache-folder /tmp/.yarn-cache-1000/v6
Expand Down
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@dimensiondev:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/DimensionDev:_authToken=1bbc5896d56bf4135a1a9f9fd0ecfbcbb70a0977
28 changes: 13 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,27 @@
"build-storybook": "build-storybook -s public --quiet",
"build:base": "webpack --mode production",
"build:chromium": "webpack --mode production --chromium",
"build:e2e": "webpack --mode production --e2e",
"build:firefox": "webpack --mode production --firefox --reproducible-build",
"build:gecko": "webpack --mode production --firefox-gecko",
"build:e2e": "webpack --mode production --e2e",
"build:ios": "run-s build:ios:webpack build:ios:ext:prebuilt",
"build:ios:webpack": "webpack --mode production --wk-webview",
"build:ios:ext:prebuilt": "ts-node scripts/webextensiom-shim-prebuilt.ts",
"build:ios:webpack": "webpack --mode production --wk-webview",
"compile:contracts": "./scripts/contracts.sh",
"install": "ts-node scripts/postinstall.ts",
"lint": "eslint src/ --ext .ts,.tsx --fix",
"lint:report": "eslint src/ --ext .ts,.tsx --format junit -o reports/junit/eslint-results.xml",
"lint:typecoverage": "type-coverage --strict --ignore-catch --ignore-files src/plugins/Wallet/contracts/** --ignore-files **/__tests__/** --ignore-files **\\__tests__\\** --detail --at-least 98",
"start": "webpack-dev-server --mode development",
"start:android": "webpack-dev-server --firefox-android --mode development",
"start:chromium": "webpack-dev-server --chromium --mode development",
"start:e2e": "webpack-dev-server --e2e --mode development",
"start:firefox": "webpack-dev-server --firefox --mode development",
"start:gecko": "webpack-dev-server --firefox-gecko --mode development",
"start:ios": "webpack-dev-server --wk-webview --mode development",
"start:e2e": "webpack-dev-server --e2e --mode development",
"storybook": "start-storybook -p 9009 -s public --quiet",
"test": "jest --verbose --watch",
"test:ci": "jest --verbose --ci --collectCoverage=true --reporters=default --reporters=jest-junit -w 1 --forceExit",
"test:e2e": "jest --verbose --runInBand --config=jest-e2e.config.js",
"uninstall": "ts-node scripts/postinstall.ts"
"test:e2e": "jest --verbose --runInBand --config=jest-e2e.config.js"
},
"husky": {
"hooks": {
Expand All @@ -45,8 +43,9 @@
]
},
"dependencies": {
"@dimensiondev/stego-js": "^0.11.0",
"@holoflows/kit": "https://github.com/DimensionDev/holoflows-kit",
"@dimensiondev/matrix-js-sdk-type": "unstable",
"@dimensiondev/stego-js": "unstable",
"@holoflows/kit": "npm:@dimensiondev/holoflows-kit@unstable",
"@material-ui/core": "4.10.2",
"@material-ui/icons": "4.9.1",
"@material-ui/lab": "^4.0.0-alpha.56",
Expand Down Expand Up @@ -86,7 +85,6 @@
"jsqr": "^1.3.1",
"lodash-es": "^4.17.11",
"matrix-js-sdk": "^7.0.0",
"matrix-js-sdk-type": "https://github.com/Jack-Works/matrix-js-sdk-type",
"metamask-extension-provider": "^1.1.1",
"notistack": "^0.9.17",
"pvtsutils": "^1.0.10",
Expand Down Expand Up @@ -117,6 +115,9 @@
"devDependencies": {
"@commitlint/cli": "^9.0.1",
"@commitlint/config-conventional": "^9.0.1",
"@dimensiondev/webcrypto": "unstable",
"@dimensiondev/webextension-shim": "unstable",
"@dimensiondev/webpack-web-ext-plugin": "unstable",
"@nice-labs/git-flow-init": "^1.0.1",
"@nice-labs/git-rev": "^3.4.2",
"@sinonjs/text-encoding": "^0.7.1",
Expand Down Expand Up @@ -182,23 +183,20 @@
"typechain-target-web3-v1": "^1.0.4",
"typescript": "^3.9.6",
"web-ext": "^4.3.0",
"webcrypto": "https://github.com/DimensionDev/webcrypto",
"webextension-shim": "https://github.com/DimensionDev/webextension-polyfill",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0",
"webpack-extension-manifest-plugin": "^0.5.0",
"webpack-manifest-plugin": "^2.2.0",
"webpack-notifier": "^1.8.0",
"webpack-web-ext-plugin": "github:DimensionDev/webpack-web-ext-plugin",
"yargs": "^15.3.1"
},
"engines": {
"node": ">=14.4.0"
},
"optionalDependencies": {
"expect-puppeteer": "^4.4.0",
"jest-puppeteer": "^4.4.0",
"puppeteer": "^3.1.0"
},
"engines": {
"node": ">=14.4.0"
}
}
12 changes: 0 additions & 12 deletions scripts/postinstall.ts

This file was deleted.

15 changes: 15 additions & 0 deletions scripts/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { execFileSync } from 'child_process'
import os from 'os'
import path from 'path'

export const ROOT_PATH = path.resolve(__dirname, '..')
export const NODE_MODULES_PATH = path.resolve(ROOT_PATH, 'node_modules')
export const BUILD_PATH = path.resolve(ROOT_PATH, 'build')

export function run(cwd: string | undefined, cmd: string, ...args: string[]) {
return execFileSync(cmd, args, {
cwd,
stdio: [process.stdin, process.stdout, process.stderr],
shell: os.platform() === 'win32',
})
}
33 changes: 13 additions & 20 deletions scripts/webextensiom-shim-prebuilt.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
import { execFileSync } from 'child_process'
import fs from 'fs'
import path from 'path'
import os from 'os'
import { BUILD_PATH, ROOT_PATH, NODE_MODULES_PATH, run } from './utils'

const stdio = [process.stdin, process.stdout, process.stderr]
const shell = os.platform() === 'win32'
const run = (cwd: string, cmd: string, ...args: string[]) => execFileSync(cmd, args, { cwd, stdio, shell })
run(ROOT_PATH, 'web-ext-prebuilts', 'eofkdgkhfoebecmamljfaepckoecjhib', 'build')

run(
path.join(__dirname, '../node_modules/webextension-shim'),
'node',
...'../ts-node/dist/bin.js -T ./src/bin/prebuilts.ts eofkdgkhfoebecmamljfaepckoecjhib ../../build/'.split(' '),
)
import fs from 'fs'
function readDir(x: string) {
const _ = path.join(__dirname, x)
return fs.readdirSync(_).map((x) => path.join(_, x))
}
readDir('../build/js').filter(unused).forEach(fs.unlinkSync)
// .forEach((x) => console.log(x))
function unused(x: string): boolean {
if (x.includes('prebuilt-0-module')) return true
if (x.includes('prebuilt') && !x.includes('content-script')) return true
// Since content script has it prebuilt version, we can remove the original version?
if (x.match(/content-script\.js$/)) return true
return false
}

readDir(path.resolve(BUILD_PATH, 'js'))
.filter(function unused(x: string): boolean {
if (x.includes('prebuilt-0-module')) return true
if (x.includes('prebuilt') && !x.includes('content-script')) return true
// Since content script has it prebuilt version, we can remove the original version?
if (x.match(/content-script\.js$/)) return true
return false
})
.forEach(fs.unlinkSync)
8 changes: 4 additions & 4 deletions src/extension/background-script/SteganographyService.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { encode, decode } from '@dimensiondev/stego-js/es/dom'
import { GrayscaleAlgorithm } from '@dimensiondev/stego-js/es/grayscale'
import { TransformAlgorithm } from '@dimensiondev/stego-js/es/transform'
import { encode, decode } from '@dimensiondev/stego-js/dist-cjs/dom'
import { GrayscaleAlgorithm } from '@dimensiondev/stego-js/dist-cjs/grayscale'
import { TransformAlgorithm } from '@dimensiondev/stego-js/dist-cjs/transform'
import { OnlyRunInContext } from '@holoflows/kit/es'
import type { EncodeOptions, DecodeOptions } from '@dimensiondev/stego-js/es/stego'
import type { EncodeOptions, DecodeOptions } from '@dimensiondev/stego-js/dist-cjs/stego'
import { getUrl, downloadUrl } from '../../utils/utils'
import { memoizePromise } from '../../utils/memoize'
import { getDimension } from '../../utils/image'
Expand Down
2 changes: 1 addition & 1 deletion src/network/matrix/matrix.type.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
declare module 'matrix-js-sdk' {
export * from 'matrix-js-sdk-type'
export * from '@dimensiondev/matrix-js-sdk-type'
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { untilDocumentReady } from '../../../utils/dom'
import { getUrl, downloadUrl, pasteImageToActiveElements } from '../../../utils/utils'
import Services from '../../../extension/service'
import { decodeArrayBuffer } from '../../../utils/type-transform/String-ArrayBuffer'
import { GrayscaleAlgorithm } from '@dimensiondev/stego-js/es/grayscale'
import { GrayscaleAlgorithm } from '@dimensiondev/stego-js/dist-cjs/grayscale'

export async function uploadToPostBoxFacebook(
text: string,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/image.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-bitwise */
import { imgType } from '@dimensiondev/stego-js/es/helper'
import { imgType } from '@dimensiondev/stego-js/dist-cjs/helper'

export function getDimension(buf: ArrayBuffer) {
const fallback = {
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const publicPolyfill = src('./public/polyfill')
process.env.BROWSER = 'none'

const SSRPlugin = require('./config-overrides/SSRPlugin')
const WebExtensionHotLoadPlugin = require('webpack-web-ext-plugin')
const WebExtensionHotLoadPlugin = require('@dimensiondev/webpack-web-ext-plugin')
const ManifestGeneratorPlugin = require('webpack-extension-manifest-plugin')

/**
Expand Down
86 changes: 42 additions & 44 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1844,13 +1844,42 @@
resolved "https://registry.yarnpkg.com/@commitlint/types/-/types-9.0.1.tgz#df281f0f3d8f3adb10c95e4dd72b16acf41b5400"
integrity sha512-wo2rHprtDzTHf4tiSxavktJ52ntiwmg7eHNGFLH38G1of8OfGVwOc1sVbpM4jN/HK/rCMhYOi6xzoPqsv0537A==

"@dimensiondev/stego-js@^0.11.0":
version "0.11.0"
resolved "https://registry.yarnpkg.com/@dimensiondev/stego-js/-/stego-js-0.11.0.tgz#4cc874fd51564e1a0b7380ecf2f52eb3dbb0bd7e"
integrity sha512-CKJv/bh5s4wvmQhUgTOof+DQ3UXrD/spJZZB6vuViqdlAvzn9T8GT3WuvVBKYTvsiAUHA01sOWLqUeNIWWdCwA==
"@dimensiondev/matrix-js-sdk-type@unstable":
version "0.0.0-0bf9b4d"
resolved "https://npm.pkg.github.com/download/@dimensiondev/matrix-js-sdk-type/0.0.0-0bf9b4d/a5105f6a2267e20e18e2889b552743619ecaeba967a3809e2442b610bb7cfcbd#9a4e74317146f38c35b4c024fe5d7154167797a7"
integrity sha512-EGoVE5Kled5E1HnbaLeuy/IVDqy9JTcCZSBJXAvz4nf1piDku56gDUbdLcFbt2ZhayW8mTOhd3cl+5Eg+E9RRg==
dependencies:
"@types/node" "^12.12.14"
"@types/request" "^2.48.4"

"@dimensiondev/stego-js@unstable":
version "0.0.0-d613b3f"
resolved "https://npm.pkg.github.com/download/@dimensiondev/stego-js/0.0.0-d613b3f/dbdea8d7cfbcd99fec2c43b04b991398289b9c485c4a5bedb6a0d15612ef556b#5d9a4bd6d01bbe7d7abc50b1923ccc8352503086"
integrity sha512-9uNdQDwqScgzEKFtC+GePdvLAxi6le8OUnQEpsf1CnYB7ot/iVkCs5xmpd8P05d3dkJI86RodOWukiYKuHjy1w==
dependencies:
meow "^5.0.0"

"@dimensiondev/webcrypto@unstable":
version "0.0.0-ea9772e"
resolved "https://npm.pkg.github.com/download/@dimensiondev/webcrypto/0.0.0-ea9772e/ccd0d90d5a189e5664387766a517c216ac92420f06ddc6a3c328fb4ed726ee4a#e6223bfaee2f4f2391ce215683a3b22790ac129a"
integrity sha512-iteUPK/n72LPXmp9l61Om78UE6/FN5C8N/4MaIuzU2o45iiBIOkCBYlc7eC1lAJMCNWv01OUZYZAhJF45EYKrQ==

"@dimensiondev/webextension-shim@unstable":
version "0.0.0-6a67963"
resolved "https://npm.pkg.github.com/download/@dimensiondev/webextension-shim/0.0.0-6a67963/ecaee42dfbbdfebee46775521297663b3bb718ffcaef1586cda00f376f50e6d0#5abd668a14ed82a7faa0ebaa631223544010969d"
integrity sha512-AKJRZPJOUPGP4XD8HkN5gcXnrwveetiK5i2+LR3236XpCYIzERPuV2xu4jE7FTdEe/Qer0bs8NX8UaDHwiTZnw==
dependencies:
async-call-rpc "^1.0.4"
systemjs "^6.3.2"
web-ext-types "^3.2.1"

"@dimensiondev/webpack-web-ext-plugin@unstable":
version "0.0.0-51a6bef"
resolved "https://npm.pkg.github.com/download/@dimensiondev/webpack-web-ext-plugin/0.0.0-51a6bef/a7835058f0c720d083233cc9653b3edc319e88584051dd6f45028a9946e6e379#7bd7cbb1ceaa450e06ff9b600d39aa0ca2e229b1"
integrity sha512-i1hFrMCb9pbwgNKxgayd0DED8lcIzf+mZWb4ioGo96fWhgMvoebcdbVsS7R/BnZEwOVYO4RKr3pZIRCQ7RRfVQ==
dependencies:
inquirer "^7.0.0"

"@dsherret/to-absolute-glob@^2.0.2":
version "2.0.2"
resolved "https://registry.yarnpkg.com/@dsherret/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz#1f6475dc8bd974cea07a2daf3864b317b1dd332c"
Expand Down Expand Up @@ -2190,9 +2219,10 @@
dependencies:
"@hapi/hoek" "^8.3.0"

"@holoflows/kit@https://github.com/DimensionDev/holoflows-kit":
version "0.7.0"
resolved "https://github.com/DimensionDev/holoflows-kit#fb58a35b0e7a0606e46a35c822e1f98988a74e18"
"@holoflows/kit@npm:@dimensiondev/holoflows-kit@unstable":
version "0.0.0-e23eddf"
resolved "https://npm.pkg.github.com/download/@dimensiondev/holoflows-kit/0.0.0-e23eddf/3fd804f4c0fb4390fb89694debd406f033aed552eb361b84ceee60a7a21076bf#1ff37d74e26be289a6156f34ad35314c9e5273a4"
integrity sha512-jbb48/cLyJFBkqtTOA/VrTMPdL/RdxrW3hjL3U1KzWP4aPsYAe1p24QKPiOEHz82VBUKTYlypr/cXcF2M+3YMw==
dependencies:
"@servie/events" "^1.0.0"
async-call-rpc "^1.0.4"
Expand Down Expand Up @@ -13662,7 +13692,7 @@ log-update@^4.0.0:
slice-ansi "^4.0.0"
wrap-ansi "^6.2.0"

loglevel@^1.6.1, loglevel@^1.6.4, loglevel@^1.6.6, loglevel@^1.6.8:
loglevel@^1.6.1, loglevel@^1.6.4, loglevel@^1.6.8:
version "1.6.8"
resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.8.tgz#8a25fb75d092230ecd4457270d80b54e28011171"
integrity sha512-bsU7+gc9AJ2SqpzxwU3+1fedl8zAntbtC5XYlt3s2j1hJcn2PsXSmgN8TaLG/J1/2mod4+cE/3vNL70/c1RNCA==
Expand Down Expand Up @@ -13866,14 +13896,6 @@ material-colors@^1.2.1:
resolved "https://registry.yarnpkg.com/material-colors/-/material-colors-1.2.6.tgz#6d1958871126992ceecc72f4bcc4d8f010865f46"
integrity sha512-6qE4B9deFBIa9YSpOc9O0Sgc43zTeVYbgDT5veRKSlB2+ZuHNoVVxA1L/ckMUayV9Ay9y7Z/SZCLcGteW9i7bg==

"matrix-js-sdk-type@https://github.com/Jack-Works/matrix-js-sdk-type":
version "1.0.0"
resolved "https://github.com/Jack-Works/matrix-js-sdk-type#a2fc32f2de5c1294ef7b33ff2d8f127546464ce4"
dependencies:
"@types/node" "^12.12.14"
"@types/request" "^2.48.4"
loglevel "^1.6.6"

matrix-js-sdk@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-7.0.0.tgz#da2b24e57574379c3d8f7065eb68ea6c479d9806"
Expand Down Expand Up @@ -17171,11 +17193,6 @@ realistic-structured-clone@^2.0.1:
typeson "^5.8.2"
typeson-registry "^1.0.0-alpha.20"

realms-shim@^1.2.1:
version "1.2.2"
resolved "https://registry.yarnpkg.com/realms-shim/-/realms-shim-1.2.2.tgz#bdf828ee316afa4c9ea2aab364d55b8ad7eb5904"
integrity sha512-NOskQ7IJEnHN4Dhu462Pf0Kl8YHSPjt6V+fVvrGSCs/SfAa433CLTyJ632DFsZC2ENBQ9p6tEZ3w+1Vkycuwyg==

realpath-native@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c"
Expand Down Expand Up @@ -19316,10 +19333,10 @@ symbol.prototype.description@^1.0.0:
dependencies:
has-symbols "^1.0.0"

systemjs@^6.2.3:
version "6.3.1"
resolved "https://registry.yarnpkg.com/systemjs/-/systemjs-6.3.1.tgz#661adf60f257c1f65b8075fd5b034c0c69b306f4"
integrity sha512-pYAQxEK2a3Xj6cRVXrXgogSfKc3oFTzEWejK8KfHcZxwT31yT2xL43WXjUNcjOk5P048Z1zLRIlfrB3Mq4W+PQ==
systemjs@^6.3.2:
version "6.3.3"
resolved "https://registry.yarnpkg.com/systemjs/-/systemjs-6.3.3.tgz#c0f2bec5cc72d0b36a8b971b1fa32bfc828b50d4"
integrity sha512-djQ6mZ4/cWKnVnhAWvr/4+5r7QHnC7WiA8sS9VuYRdEv3wYZYTIIQv8zPT79PdDSUwfX3bgvu5mZ8eTyLm2YQA==

table@^5.2.3:
version "5.4.6"
Expand Down Expand Up @@ -21369,24 +21386,11 @@ webcrypto-liner@1.2.3:
tslib "^1.13.0"
webcrypto-core "^1.1.2"

"webcrypto@https://github.com/DimensionDev/webcrypto":
version "0.1.0"
resolved "https://github.com/DimensionDev/webcrypto#4c0f1a3d5101784a0379aac091250570b6b3581e"

webextension-polyfill@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/webextension-polyfill/-/webextension-polyfill-0.6.0.tgz#1afd925f3274a0d4848083579b9c0b649a5c6763"
integrity sha512-PlYwiX8e4bNZrEeBFxbFFsLtm0SMPxJliLTGdNCA0Bq2XkWrAn2ejUd+89vZm+8BnfFB1BclJyCz3iKsm2atNg==

"webextension-shim@https://github.com/DimensionDev/webextension-polyfill":
version "0.0.1"
resolved "https://github.com/DimensionDev/webextension-polyfill#0e469704fc875e3826b754d12032b8217d88ab83"
dependencies:
async-call-rpc "^1.0.4"
realms-shim "^1.2.1"
systemjs "^6.2.3"
web-ext-types "^3.2.1"

webidl-conversions@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad"
Expand Down Expand Up @@ -21539,12 +21543,6 @@ webpack-virtual-modules@^0.2.0:
dependencies:
debug "^3.0.0"

"webpack-web-ext-plugin@github:DimensionDev/webpack-web-ext-plugin":
version "0.0.1"
resolved "https://codeload.github.com/DimensionDev/webpack-web-ext-plugin/tar.gz/ef16c9fdf765c329d8cf397fd047a7a5772d8873"
dependencies:
inquirer "^7.0.0"

webpack@^4.33.0, webpack@^4.38.0:
version "4.42.1"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.42.1.tgz#ae707baf091f5ca3ef9c38b884287cfe8f1983ef"
Expand Down

0 comments on commit f1c74ac

Please sign in to comment.