Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to ESModule #372

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ executors:
working_directory: ~/repo
commands:
restore_workspace:
description: "Restore the workspace"
description: 'Restore the workspace'
steps:
- attach_workspace:
at: ~/
Expand Down Expand Up @@ -39,15 +39,9 @@ jobs:
executor: maskbook_node
steps:
- restore_workspace
- run:
name: Install zip
command: sudo apt-get install zip
- run:
name: Build Maskbook
command: yarn build-ci
- store_artifacts:
path: Maskbook.base.zip
destination: /Maskbook.base.zip
- store_artifacts:
path: Maskbook.iOS.zip
destination: /Maskbook.iOS.zip
Expand All @@ -63,7 +57,6 @@ jobs:
- persist_to_workspace:
root: ~/repo/
paths:
- Maskbook.base.zip
- Maskbook.iOS.zip
- Maskbook.chromium.zip
- Maskbook.firefox.zip
Expand All @@ -74,7 +67,7 @@ jobs:
steps:
- restore_workspace
- run:
name: "Publish Release on GitHub"
name: 'Publish Release on GitHub'
command: |
set -o nounset
mkdir ~/repo/release
Expand Down
6 changes: 2 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
*.test.tsx
package.json
package-lock.json
build/
dist/
public/polyfill
esm/
gulp*
scripts/
src/polyfill
e2e
21 changes: 0 additions & 21 deletions .git-utils/test4bis.sh

This file was deleted.

2 changes: 0 additions & 2 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ jobs:
run: yarn lint:typecoverage
- name: ESLint
run: yarn lint:report
- name: Import linter
run: yarn ts-node -T ./scripts/import-linter.ts
- name: ESLint result
uses: actions/upload-artifact@v1
with:
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
.vscode/launch.json
.vscode/tasks.json

/temp

/.awcache
/.tscache
/.log
public/polyfill
# dependencies
/node_modules
/.pnp
Expand All @@ -19,8 +21,6 @@ public/polyfill
/junit.xml

# production
/build
/dist
/storybook-static
/Maskbook.*.zip

Expand Down
4 changes: 1 addition & 3 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
'storybook-addon-i18n/register.js',
'storybook-addon-designs',
'@storybook/addon-links',
'@storybook/addon-docs',
// '@storybook/addon-docs',
septs marked this conversation as resolved.
Show resolved Hide resolved
'@storybook/addon-viewport/register',
],
webpackFinal: async (/** @type {import('webpack').Configuration} */ config) => {
Expand All @@ -24,15 +24,13 @@ module.exports = {
},
},
},
{ loader: require.resolve('react-docgen-typescript-loader') },
],
})
config.resolve.extensions.push('.ts', '.tsx')
const webpack = require('webpack')
config.plugins.unshift(
new webpack.DefinePlugin({
'process.env.STORYBOOK': 'true',
'webpackEnv.shadowRootMode': '"open"',
}),
)
return config
Expand Down
1 change: 0 additions & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import '../public/env'
import { addParameters, addDecorator } from '@storybook/react'
import { withKnobs, radios } from '@storybook/addon-knobs'
import { MaskbookDarkTheme, MaskbookLightTheme } from '../src/utils/theme'
Expand Down
1 change: 0 additions & 1 deletion .yarnrc

This file was deleted.

4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@

# Maskbook · [![GitHub license](https://img.shields.io/badge/license-AGPL-blue.svg?style=flat-square)](https://github.com/DimensionDev/Maskbook/blob/master/LICENSE) [![Circle CI](https://img.shields.io/circleci/project/github/DimensionDev/Maskbook.svg?style=flat-square&logo=circleci)](https://circleci.com/gh/DimensionDev/Maskbook) [![Join the chat at https://gitter.im/Maskbook/community](https://badges.gitter.im/Maskbook/community.svg)](https://gitter.im/Maskbook/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Chrome Web Store](https://img.shields.io/chrome-web-store/v/jkoeaghipilijlahjplgbfiocjhldnap.svg?logo=Maskbook&logoColor=%231c68f3&style=flat-square&label=Chrome%20store)][crext] [![Mozilla Add-on](https://img.shields.io/amo/v/maskbook?label=Firefox%20store&style=flat-square)][fxaddon] [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgit.luolix.top%2FDimensionDev%2FMaskbook.svg?type=shield)](https://app.fossa.io/projects/git%2Bgit.luolix.top%2FDimensionDev%2FMaskbook?ref=badge_shield)


Encrypt your posts & chats on You-Know-Where. Allow only your friends to decrypt.

For general introductions, see [Maskbook.com](https://maskbook.com/).

/_ I thought what I'd do was, I'd pretend I was one of those deaf-mutes. _/


[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgit.luolix.top%2FDimensionDev%2FMaskbook.svg?type=large)](https://app.fossa.io/projects/git%2Bgit.luolix.top%2FDimensionDev%2FMaskbook?ref=badge_large)

## Downloads
Expand Down Expand Up @@ -62,7 +60,7 @@ Help us by donating us:
- `yarn start` runs extension in other browsers, manually loading required.
[This](https://chrome.google.com/webstore/detail/extensions-reloader/fimgfedafeadlieiabdeeaodndnlbhid) plugin may help you to reload extension quicker.
- `yarn storybook` to start StoryBook. Used for UI only developing.
- `yarn build` build a production version. Output files in `./build/`
- `yarn build` build a production version. Output files in `./temp/extension`

#### Conditional compilation

Expand Down
114 changes: 0 additions & 114 deletions config-overrides/SSRPlugin.js

This file was deleted.

11 changes: 0 additions & 11 deletions config-overrides/template.html

This file was deleted.

17 changes: 0 additions & 17 deletions config-overrides/utils.js

This file was deleted.

4 changes: 4 additions & 0 deletions e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../tsconfig.json",
"include": ["./**/*"]
}
1 change: 1 addition & 0 deletions gulpfile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './scripts/gulp'
4 changes: 1 addition & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ module.exports = {
require.resolve('fake-indexeddb/auto'),
path.join(__dirname, './scripts/jest-setup.js'),
],
// skip packages other than 'ts-results' and 'holoflows/kit'
transformIgnorePatterns: [],
transform: {
'node_modules.+(ts-results|holoflows).+.js$': 'jest-esm-transformer',
'node_modules.+(ts-results).+.js$': 'jest-esm-transformer',
},
moduleNameMapper: {
'lodash-es': require.resolve('lodash'),
Expand Down
Loading