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

ci(): switch the old custom build for rollup #8013

Merged
merged 24 commits into from
Jul 30, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Browsers that we support

chrome >= 58
16 changes: 16 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
],
overrides: [
{
files: ['**/*.ts'],
}
],
};
13 changes: 13 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@
"assert": true,
"AbortController": true
},
"overrides": [
{
"files": ["**/*.js"]
}
],
"parserOptions": {
"sourceType": "module"
},
"rules": {
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-this-alias": 0,
"@typescript-eslint/no-extra-semi": 0,
"no-prototype-builtins": 0,
"no-redeclare": 0,
"semi": 2,
"eqeqeq": 2,
"no-eq-null": 2,
Expand Down
12 changes: 12 additions & 0 deletions .eslintrc_tests
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
"pixelmatch": true
},
"rules": {
/* new rules, unify test and src lint */
"no-useless-escape": 0,
"@typescript-eslint/no-empty-function": 0,
"no-mixed-spaces-and-tabs": 0,
"@typescript-eslint/no-extra-semi": 0,
"no-redeclare": 0,
"@typescript-eslint/no-unused-vars": 0,
"no-setter-return": 0,
"@typescript-eslint/no-this-alias": 0,
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-loss-of-precision": 0,
/* end of new rules */
"eqeqeq": 0,
"no-eq-null": 2,
"no-eval": 2,
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: 16.x
- run: npm install uglify-js@3.3.x
- run: npm ci
- run: npm run build
lint:
runs-on: ubuntu-latest
Expand All @@ -25,7 +25,7 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: 16.x
- run: npm install eslint@4.7.x
- run: npm ci
- run: npm run lint
coverage:
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion HEADER.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ else {
fabric.jsdomImplForWrapper = require('jsdom/lib/jsdom/living/generated/utils').implForWrapper;
fabric.nodeCanvas = require('jsdom/lib/jsdom/utils').Canvas;
fabric.window = virtualWindow;
DOMParser = fabric.window.DOMParser;
global.DOMParser = fabric.window.DOMParser;
}

/**
Expand Down Expand Up @@ -201,3 +201,5 @@ fabric.initFilterBackend = function() {
return (new fabric.Canvas2dFilterBackend());
}
};

export { fabric };
103 changes: 103 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
import { fabric } from './HEADER.js';
// import './lib/event.js'), // optional gestures
import './src/mixins/observable.mixin.js';
import './src/mixins/collection.mixin.js';
import './src/mixins/shared_methods.mixin.js';
import './src/util/misc.js';
// import './src/util/named_accessors.mixin.js'; i would imagine dead forever or proper setters/getters
import './src/util/path.js';
import './src/util/lang_array.js';
import './src/util/lang_object.js';
import './src/util/lang_string.js';
import './src/util/lang_class.js';
import './src/util/dom_event.js'; // optional interaction
import './src/util/dom_style.js';
import './src/util/dom_misc.js';
import './src/util/dom_request.js';
import './src/log.js';
import './src/util/animate.js'; // optional animation
import './src/util/animate_color.js'; // optional animation
import './src/util/anim_ease.js'; // optional easing
import './src/parser.js'; // optional parser
import './src/elements_parser.js'; // optional parser
import './src/point.class.js';
import './src/intersection.class.js';
import './src/color.class.js';
import './src/controls.actions.js'; // optional interaction
import './src/controls.render.js'; // optional interaction
import './src/control.class.js'; // optional interaction
import './src/gradient.class.js'; // optional gradient
import './src/pattern.class.js'; // optional pattern
import './src/shadow.class.js'; // optional shadow
import './src/static_canvas.class.js';
import './src/brushes/base_brush.class.js'; // optional freedrawing
import './src/brushes/pencil_brush.class.js'; // optional freedrawing
import './src/brushes/circle_brush.class.js'; // optional freedrawing
import './src/brushes/spray_brush.class.js'; // optional freedrawing
import './src/brushes/pattern_brush.class.js'; // optional freedrawing
import './src/canvas.class.js'; // optional interaction
import './src/mixins/canvas_events.mixin.js'; // optional interaction
import './src/mixins/canvas_grouping.mixin.js'; // optional interaction
import './src/mixins/canvas_dataurl_exporter.mixin.js';
import './src/mixins/canvas_serialization.mixin.js'; // optiona serialization
import './src/mixins/canvas_gestures.mixin.js'; // optional gestures
import './src/shapes/object.class.js';
import './src/mixins/object_origin.mixin.js';
import './src/mixins/object_geometry.mixin.js';
import './src/mixins/object_ancestry.mixin.js';
import './src/mixins/object_stacking.mixin.js';
import './src/mixins/object.svg_export.js';
import './src/mixins/stateful.mixin.js';
import './src/mixins/object_interactivity.mixin.js'; // optional interaction
import './src/mixins/animation.mixin.js'; // optional animation
import './src/shapes/line.class.js';
import './src/shapes/circle.class.js';
import './src/shapes/triangle.class.js';
import './src/shapes/ellipse.class.js';
import './src/shapes/rect.class.js';
import './src/shapes/polyline.class.js';
import './src/shapes/polygon.class.js';
import './src/shapes/path.class.js';
import './src/shapes/group.class.js';
import './src/shapes/active_selection.class.js'; // optional interaction
import './src/shapes/image.class.js';
import './src/mixins/object_straightening.mixin.js'; // optional objectstraightening
import './src/filters/webgl_backend.class.js'; // optional image_filters
import './src/filters/2d_backend.class.js'; // optional image_filters
import './src/filters/base_filter.class.js'; // optional image_filters
import './src/filters/colormatrix_filter.class.js'; // optional image_filters
import './src/filters/brightness_filter.class.js'; // optional image_filters
import './src/filters/convolute_filter.class.js'; // optional image_filters
import './src/filters/grayscale_filter.class.js'; // optional image_filters
import './src/filters/invert_filter.class.js'; // optional image_filters
import './src/filters/noise_filter.class.js'; // optional image_filters
import './src/filters/pixelate_filter.class.js'; // optional image_filters
import './src/filters/removecolor_filter.class.js'; // optional image_filters
import './src/filters/filter_generator.js'; // optional image_filters
import './src/filters/blendcolor_filter.class.js'; // optional image_filters
import './src/filters/blendimage_filter.class.js'; // optional image_filters
import './src/filters/resize_filter.class.js'; // optional image_filters
import './src/filters/contrast_filter.class.js'; // optional image_filters
import './src/filters/saturate_filter.class.js'; // optional image_filters
import './src/filters/vibrance_filter.class.js'; // optional image_filters
import './src/filters/blur_filter.class.js'; // optional image_filters
import './src/filters/gamma_filter.class.js'; // optional image_filters
import './src/filters/composed_filter.class.js'; // optional image_filters
import './src/filters/hue_rotation.class.js'; // optional image_filters
import './src/shapes/text.class.js'; // optional text
import './src/mixins/text_style.mixin.js'; // optional text
import './src/shapes/itext.class.js'; // optional itext
import './src/mixins/itext_behavior.mixin.js'; // optional itext
import './src/mixins/itext_click_behavior.mixin.js'; // optional itext
import './src/mixins/itext_key_behavior.mixin.js'; // optional itext
import './src/mixins/itext.svg_export.js'; // optional itext
import './src/shapes/textbox.class.js'; // optional textbox
import './src/mixins/default_controls.js'; // optional interaction
// extends fabric.StaticCanvas, fabric.Canvas, fabric.Object, depends on fabric.PencilBrush and fabric.Rect
// import './src/mixins/eraser_brush.mixin.js'; // optional erasing
if (typeof exports !== 'undefined') {
exports.fabric = fabric;
}
if (typeof window !== 'undefined') {
window.fabric = fabric;
}
Loading