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

feat: decoupled sourcing PoC #561

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ plugin/lib
fixtures/
demo

plugin/src/templates/inject

*~
*.swp
npm-debug.log
Expand Down
18 changes: 15 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ module.exports = {
'func-style': 'off',
// This is compiled, so we can use modern syntax
'node/no-unsupported-features/es-syntax': 'off',
'node/prefer-global/process': 'off',
'node/global-require': 'off',
// This is a duplicate of `import/no-duplicates` but can handle "import type"
'no-duplicate-imports': 'off',
'node/no-unpublished-import': 'off',
'max-depth': ['error', 4],
complexity: 'off',
'n/no-missing-import': 'off',
'n/global-require': 'off',
},
env: {
jest: true,
Expand All @@ -21,15 +26,22 @@ module.exports = {
overrides: [
...overrides,
{
// Tests use lots of nested callbacks
files: ['*-test.js', '*.spec.js', '**/e2e-tests/*.js'],
files: [
'*-test.js',
'*.spec.js',
'**/e2e-tests/*.js',
'*-test.ts',
'*.spec.ts',
'**/e2e-tests/*.ts',
],
rules: {
'max-nested-callbacks': 'off',
'ava/no-import-test-files': 'off',
},
},
{
// Templates import files from the site itself and needs lots of dynamic requires
files: ['plugin/src/templates/**/*'],
files: ['plugin/src/templates/**/*', 'plugin/test/unit/templates/**/*'],
rules: {
'n/no-unpublished-import': 'off',
'@typescript-eslint/no-var-requires': 'off',
Expand Down
2 changes: 1 addition & 1 deletion demo/netlify.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build]
command = "npm run build"
publish = "public/"
# ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../plugin/"
ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF .."

[[plugins]]
package = "../plugin/src/index.ts"
Expand Down
115 changes: 29 additions & 86 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"format:check-fix:prettier": "run-e format:check:prettier format:fix:prettier",
"format:check:prettier": "cross-env-shell prettier --check $npm_package_config_prettier",
"format:fix:prettier": "cross-env-shell prettier --write $npm_package_config_prettier",
"ava": "cross-env FORCE_COLOR=1 ava --verbose"
"ava": "cross-env FORCE_COLOR=1 ava --verbose",
"prepublishOnly": "echo 'You probably meant to publish the \"plugin\" package.' && exit 1"
},
"repository": {
"type": "git",
Expand Down
Loading