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

Build packages using Rollup #10386

Merged
merged 52 commits into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
2a048c1
Try to reduce some circular dependencies
swissspidy Jan 25, 2022
6b38d9d
Remove web worker code for now, pending todo
swissspidy Jan 25, 2022
5de0dfc
Avoid mixing named and default exports
swissspidy Jan 25, 2022
e5b87ea
First attempt at building with Rollup
swissspidy Jan 27, 2022
a453b08
Leverage rollup-plugin-delete
swissspidy Jan 27, 2022
c514560
Update exports
swissspidy Jan 27, 2022
a471b31
Remove `type: module`
swissspidy Jan 27, 2022
cf9551c
Add `exports: auto`
swissspidy Jan 27, 2022
c1a4650
Nonetheless try custom resolver package
swissspidy Jan 27, 2022
9868278
Lint fix
swissspidy Jan 27, 2022
0fb3678
Update lock file
swissspidy Jan 27, 2022
e0485f2
Fix eslint-import-resolver lint issue
swissspidy Jan 28, 2022
1c8640a
Tweak eslint/rollup config
swissspidy Jan 28, 2022
f787186
Update package exports
swissspidy Jan 28, 2022
45e4165
Update main rollup config
swissspidy Jan 28, 2022
d938e4f
Merge branch 'main' into add/10251-rollup
swissspidy Jan 28, 2022
28ced78
Fix folder deletion
swissspidy Jan 28, 2022
20a3e2a
Lint fixes
swissspidy Jan 28, 2022
da03472
Set `window` as context
swissspidy Jan 28, 2022
1e4065d
Use newer json rollup plugin
swissspidy Jan 28, 2022
ad38457
Set `browser: true`
swissspidy Jan 28, 2022
3374b0c
Update readme
swissspidy Jan 28, 2022
2157f61
Specify `resolve. mainFields` to fix webpack build
swissspidy Jan 28, 2022
a1640af
Use `@rollup/plugin-dynamic-import-vars`
swissspidy Jan 28, 2022
1b312df
Remove `exports` everywhere
swissspidy Jan 28, 2022
1577bb3
Add custom Jest resolver
swissspidy Jan 28, 2022
36b8a65
Lint fix
swissspidy Jan 28, 2022
65887a4
Install dependency
swissspidy Jan 28, 2022
122239a
Remove errant dep
swissspidy Jan 28, 2022
100ea00
Remove more exports
swissspidy Jan 28, 2022
7a5be24
Fix Jest resolver
swissspidy Jan 28, 2022
e1614b3
Fix type of commander package
swissspidy Jan 28, 2022
b0f023c
Try to fix type of migration package as well
swissspidy Jan 28, 2022
8edac59
Set `directory` for all packages
swissspidy Jan 29, 2022
070e23e
Set `publishConfig` for all packages
swissspidy Jan 29, 2022
daae04f
Use jest resolver for e2e tests
swissspidy Jan 31, 2022
9de0b1a
Update script
swissspidy Jan 31, 2022
d3f58cd
Templates: Add file extension to dynamic imports
swissspidy Jan 31, 2022
d717523
Change plugin order in rollup config
swissspidy Jan 31, 2022
8a8b012
Allow building only specified entries
swissspidy Jan 31, 2022
49c8ec9
Specify `runOnce`
swissspidy Jan 31, 2022
f462acd
Tweak Terser options
swissspidy Jan 31, 2022
5c432a0
Yolo: Try marking all deps as external
swissspidy Jan 31, 2022
3524e41
Simply ignore src folder in npmignore
swissspidy Jan 31, 2022
c1726e6
Merge branch 'main' into add/10251-rollup
swissspidy Jan 31, 2022
c515a02
Merge branch 'main' into add/10251-rollup
swissspidy Feb 1, 2022
2fdb291
Try using `rollup-plugin-web-worker-loader`
swissspidy Feb 1, 2022
878685f
Merge branch 'main' into add/10251-rollup
swissspidy Feb 1, 2022
86cea29
Add bundle step to workflow for debugging
swissspidy Feb 1, 2022
9aadfd9
Lint fix
swissspidy Feb 1, 2022
05d183c
Increase timeout for lint i18n step
swissspidy Feb 1, 2022
4947ca9
Merge branch 'main' into add/10251-rollup
swissspidy Feb 3, 2022
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
1 change: 1 addition & 0 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ phpunit.xml.dist
phpunit-integration.xml.dist
phpunit-integration-multisite.xml.dist
README.md
rollup.config.js
scoper.inc.php
SECURITY.md
webpack.config.cjs
Expand Down
12 changes: 11 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,14 @@
"__webpack_public_path__": true
},
"settings": {
"import/resolver": {
"@web-stories-wp/eslint-import-resolver": {
"mapping": {
"^@googleforcreators\\/(.*)": "./packages/$1/src/",
"^@web-stories-wp\\/(.*)": "./packages/$1/src/"
}
}
},
"jsdoc": {
"mode": "typescript",
"preferredTypes": {
Expand Down Expand Up @@ -438,7 +446,7 @@
"__mocks__/**/*.js",
"bin/**/*.js",
"babel.config.cjs",
"rollup.config.migrate.cjs",
"rollup.config.js",
"jest-puppeteer.config.cjs",
"karma-*.config.cjs",
"webpack.*.cjs",
Expand All @@ -450,6 +458,8 @@
"packages/dashboard/src/karma-tests.cjs",
"packages/story-editor/src/karma-tests.cjs",
"packages/migration/src/**/*.js",
"packages/eslint-import-resolver/**/*.cjs",
"packages/jest-resolver/**/*.cjs",
"packages/fonts/**/*.js",
"packages/commander/**/*.js",
"packages/templates/scripts/cli.js",
Expand Down
33 changes: 31 additions & 2 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ jobs:
name: Package ZIP files
runs-on: ubuntu-latest
timeout-minutes: 10
if: >
github.event.pull_request.draft == false &&
github.event.pull_request.head.repo.fork == false &&
github.event.pull_request.user.login != 'dependabot[bot]'
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -115,8 +119,7 @@ jobs:
tools: composer

- name: Install dependencies
run: |
npm ci
run: npm ci
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true

Expand Down Expand Up @@ -155,6 +158,32 @@ jobs:
name: web-stories-dev
path: build/web-stories-dev

bundle:
name: Bundle npm packages
runs-on: ubuntu-latest
timeout-minutes: 30
if: >
github.event.pull_request.draft == false &&
github.event.pull_request.head.repo.fork == false &&
github.event.pull_request.user.login != 'dependabot[bot]'
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Node
uses: actions/[email protected]
with:
node-version-file: '.nvmrc'
cache: npm

- name: Install dependencies
run: npm ci
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true

- name: Bundle packages
run: npm run bundle

upload-artifacts:
name: Upload ZIP files to storage
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-i18n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-unit-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Install dependencies
run: |
npm ci
npx rollup --config packages/migration/rollup.config.migrate.js
npx rollup --config packages/migration/rollup.config.js
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
node_modules
/assets
/packages/migration/scripts/module.js
/packages/*/dist
/packages/*/dist-module
/build
/bin/build
/bin/local-env/data
Expand Down
5 changes: 4 additions & 1 deletion .npmpackagejsonlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,13 @@
"exports",
"main",
"module",
"bin",
"source",
"publishConfig",
"sideEffects",
"dependencies",
"devDependencies",
"peerDependencies",
"bin",
"scripts"
]
],
Expand Down
2 changes: 1 addition & 1 deletion .storybook/stories/playground/dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
/**
* External dependencies
*/
import Dashboard, { InterfaceSkeleton } from '@googleforcreators/dashboard';
import styled from 'styled-components';
import { useRef } from 'react';
import { toId } from '@storybook/csf';
import { Dashboard, InterfaceSkeleton } from '@googleforcreators/dashboard';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* External dependencies
*/
import { hrefTo } from '@storybook/addon-links';
import { Tooltip, useStory } from '@googleforcreators/story-editor';
import {
Button,
Expand All @@ -24,7 +26,6 @@ import {
BUTTON_VARIANTS,
Icons,
} from '@googleforcreators/design-system';
import { hrefTo } from '@storybook/addon-links';

function PreviewButton() {
const { isSaving, saveStory } = useStory(
Expand Down
5 changes: 3 additions & 2 deletions .storybook/stories/playground/story-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
/**
* External dependencies
*/
import StoryEditor, {
import styled from 'styled-components';
import {
StoryEditor,
InterfaceSkeleton,
} from '@googleforcreators/story-editor';
import styled from 'styled-components';

/**
* Internal dependencies
Expand Down
Loading