Skip to content

Commit

Permalink
refactor: use swc pack instead of ncc (#140)
Browse files Browse the repository at this point in the history
* refactor: implement swc instead of ncc

* chore: tweak the swc implementation with externals

* chore: remove ncc from the project

* fix: update the entrypoint in the main action file

* chore: fix linting issues

* chore: add swc folder to ignore list

* chore: update gitignore list

* fix: force-remove sourcemaps from the build

Unfortunately, it seems that we cant disable this in swc pack
  • Loading branch information
byCedric authored Jan 12, 2022
1 parent ee415b0 commit 3f9e947
Show file tree
Hide file tree
Showing 22 changed files with 617 additions and 572 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = {
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
rules: {
'@typescript-eslint/explicit-member-accessibility': ['error', { accessibility: 'no-public' }],
'@typescript-eslint/no-var-requires': 'off',
'prettier/prettier': 'error',
},
};
9 changes: 5 additions & 4 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,19 @@ jobs:
run: yarn test

- name: 👷 Build code
run: yarn build
run: yarn clean && yarn build

- name: 🕵️ Validate code
- name: 🕵️ Validate build
id: diff
run: |
if [ "$(git diff --ignore-space-at-eol build/ | wc -l)" -gt "0" ]; then
echo "⚠️ Build is outdated, run `yarn build` and commit changes. Found:"
echo "⚠️ Build is outdated"
echo " > run 'yarn clean', 'yarn build', and commit changes"
git diff
exit 1
fi
- name: 🗂 Uploading build
- name: 🗂 Upload build
uses: actions/upload-artifact@v2
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
Expand Down
51 changes: 50 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,51 @@
# SWC
.swc/

# macOS
.DS_Store

# Node
node_modules
.idea
npm-debug.log
yarn-error.log
package-lock.json

# Ruby
.direnv

# Emacs
*~

# Vim
.*.swp
.*.swo
.*.swn
.*.swm

# Sublime Text
*.sublime-project
*.sublime-workspace

# Xcode
*.pbxuser
!default.pbxuser
*.xccheckout
*.xcscmblueprint
xcuserdata

# Android Studio
*.iml
.gradle
.idea/libraries
.idea/workspace.xml
.idea/gradle.xml
.idea/misc.xml
.idea/modules.xml
.idea/vcs.xml

# Eclipse
.project
.settings

# VSCode
.history/
11 changes: 11 additions & 0 deletions .swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"jsc": {
"target": "es2020",
"parser": {
"syntax": "typescript"
}
},
"module": {
"type": "commonjs"
}
}
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ branding:
color: gray-dark
runs:
using: node16
main: build/setup/index.js
main: build/setup.js
inputs:
expo-version:
description: The Expo CLI version to install (use any semver/dist-tag available).
Expand Down
Loading

0 comments on commit 3f9e947

Please sign in to comment.