Skip to content

Commit

Permalink
Revert "build: Upgrade pipelines to Node18 + upgrade nvm recommendati…
Browse files Browse the repository at this point in the history
…on (microsoft#17389)" (Keep changes to server)

This reverts commit 232921a.
  • Loading branch information
zhenmichael committed Mar 5, 2024
1 parent cc4f515 commit 4b47802
Show file tree
Hide file tree
Showing 50 changed files with 1,900 additions and 1,408 deletions.
11 changes: 7 additions & 4 deletions examples/apps/spaces/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"extends": "@fluidframework/build-common/ts-common-config.json",
"exclude": ["dist", "node_modules"],
"exclude": [
"dist",
"node_modules"
],
"compilerOptions": {
"target": "es6",
"declarationDir": "./dist",
"outDir": "./dist",
"jsx": "react",
// Added because upgrading to node 18 caused a bunch of typecheck errors
"skipLibCheck": true,
"types": [
"jest",
"puppeteer",
Expand All @@ -17,5 +18,7 @@
"react-dom"
]
},
"include": ["src/**/*"]
"include": [
"src/**/*"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface IDiceRollerViewProps {
model: IDiceRoller;
}

export const DiceRollerView = (props: IDiceRollerViewProps) => {
export const DiceRollerView: React.FC<IDiceRollerViewProps> = (props: IDiceRollerViewProps) => {
const [diceValue, setDiceValue] = React.useState(props.model.value);

React.useEffect(() => {
Expand Down
2 changes: 0 additions & 2 deletions examples/apps/view-framework-sampler/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
"module": "esnext",
"outDir": "dist",
"jsx": "react",
// Added because upgrading to node 18 caused a bunch of typecheck errors
"skipLibCheck": true,
"types": [
"jest",
"puppeteer",
Expand Down
26 changes: 13 additions & 13 deletions examples/data-objects/prosemirror/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,20 @@
"@fluidframework/sequence": "^1.4.0",
"@fluidframework/view-adapters": "^1.4.0",
"@fluidframework/view-interfaces": "^1.4.0",
"@types/prosemirror-model": "1.16.2",
"@types/prosemirror-schema-list": "1.0.3",
"@types/prosemirror-state": "1.3.0",
"@types/prosemirror-view": "1.23.3",
"@types/prosemirror-model": "^1.7.2",
"@types/prosemirror-schema-list": "^1.0.1",
"@types/prosemirror-state": "^1.2.3",
"@types/prosemirror-view": "^1.9.0",
"orderedmap": "^1.1.1",
"prosemirror-example-setup": "1.1.2",
"prosemirror-history": "1.3.0",
"prosemirror-keymap": "1.2.0",
"prosemirror-menu": "1.2.1",
"prosemirror-model": "1.17.0",
"prosemirror-schema-list": "1.2.0",
"prosemirror-state": "1.4.0",
"prosemirror-transform": "1.6.0",
"prosemirror-view": "1.25.0"
"prosemirror-example-setup": "^1.0.1",
"prosemirror-history": "^1.1.3",
"prosemirror-keymap": "^1.1.3",
"prosemirror-menu": "^1.2.1",
"prosemirror-model": "^1.7.2",
"prosemirror-schema-list": "^1.0.3",
"prosemirror-state": "^1.2.4",
"prosemirror-transform": "^1.2.3",
"prosemirror-view": "^1.10.3"
},
"devDependencies": {
"@fluid-tools/webpack-fluid-loader": "^1.4.0",
Expand Down
2 changes: 0 additions & 2 deletions examples/data-objects/vltava/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
"module": "esnext",
"outDir": "dist",
"jsx": "react",
// Added because upgrading to node 18 caused a bunch of typechecks errors
"skipLibCheck": true,
"types": [
"jest",
"puppeteer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"cross-env": "^7.0.2",
"eslint": "~8.6.0",
"mocha": "^10.0.0",
"nock": "^13.3.3",
"nock": "^10.0.1",
"nyc": "^15.0.0",
"rimraf": "^2.6.2",
"sinon": "^7.4.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"cross-env": "^7.0.2",
"eslint": "~8.6.0",
"mocha": "^10.0.0",
"nock": "^13.3.3",
"nock": "^10.0.1",
"nyc": "^15.0.0",
"rimraf": "^2.6.2",
"sinon": "^7.4.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"cross-env": "^7.0.2",
"eslint": "~8.6.0",
"mocha": "^10.0.0",
"nock": "^13.3.3",
"nock": "^10.0.1",
"nyc": "^15.0.0",
"rimraf": "^2.6.2",
"sinon": "^7.4.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"mocha": "^10.0.0",
"nock": "^13.3.3",
"nock": "^10.0.1",
"nyc": "^15.0.0",
"sinon": "^7.4.2"
}
Expand Down
11 changes: 11 additions & 0 deletions experimental/dds/tree-graphql/.env-cmdrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"development": {
"NODE_ENV": "development"
},
"test": {
"NODE_ENV": "test"
},
"production": {
"NODE_ENV": "production"
}
}
83 changes: 83 additions & 0 deletions experimental/dds/tree-graphql/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/

module.exports = {
extends: ['@fluidframework/eslint-config-fluid'],
root: true,
rules: {
// TODO: Recover "noUnusedLocals" behavior as part of linting. (This rule seems to be broken in the Fluid repo.)
// '@typescript-eslint/no-unused-vars': ['error', { args: 'none', varsIgnorePattern: '^_' }],
'@typescript-eslint/quotes': [
'error',
'single',
{
allowTemplateLiterals: true,
avoidEscape: true,
},
],
// Intentionally not unifying signatures can enable more scoped API documentation and a better developer experience, which accounts
// for all violations of this rule in this package at the time of writing.
'@typescript-eslint/unified-signatures': 'off',

// Prettier
'comma-dangle': 'off',
'@typescript-eslint/comma-dangle': 'off',
'@typescript-eslint/member-delimiter-style': 'off',
'max-len': 'off',

// Rules which could be re-enabled (by dropping these overrides, as they are enabled in base config) with some minor fixes:
'@typescript-eslint/no-shadow': 'off',
'no-shadow': 'off',

// It seems convenient to place schemas and generated files in subfolders
// TODO: Determine if we want to organize them this way
'import/no-internal-modules': [
'error',
{
allow: ['graphql-schemas/*', 'graphql-generated/*', 'graphql/tsutils/Maybe'],
},
],

// unicorn/no-null
// GraphQL uses null rather than undefined. See https://github.com/graphql/graphql-js/issues/1298
// TODO: Determine if we want to use a helper library to convert null to undefined automatically
'unicorn/no-null': 'off',
},
overrides: [
{
files: ['src/test/**'],
rules: {
// Chai assertions trigger the unused expression lint rule.
'@typescript-eslint/no-unused-expressions': 'off',

// Dev dependencies and internal modules may be used in test code
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
},
],
'import/no-internal-modules': 'off',
},
},
{
files: ['**/test/**', 'src/index.ts'],
rules: {
// Test code and the main package export shouldn't be linted for unused exports
'import/no-unused-modules': 'off',
},
},
{
// Files generated by graphql-codegen don't uphold all of the Fluid repo's lint rules.
// TODO: Where possible, customize the codegen output to be compliant.
files: ['src/graphql-generated/**'],
rules: {
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/array-type': 'off',
'import/no-internal-modules': 'off',
},
},
],
};
18 changes: 18 additions & 0 deletions experimental/dds/tree-graphql/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Compiled typescript
dist
lib

# Logs
logs
*.log

# Dependencies
node_modules

# nyc test coverage
.nyc_output

# GraphQL codegen
# TODO: Determine if/how to change the fluid build scripts to automatically codegen while still being compliant.
# For now, just include the generated code in git
# graphql-generated
6 changes: 6 additions & 0 deletions experimental/dds/tree-graphql/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
nyc
*.log
**/*.tsbuildinfo
src/test
dist/test
**/_api-extractor-temp/**
8 changes: 8 additions & 0 deletions experimental/dds/tree-graphql/.nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"all": true,
"include": ["dist/**", "src/**"],
"exclude": ["**/{test,tests}/**", "**/**.{test,tests}.{js,jsx,ts,tsx}", "**/*test_index.js"],
"cache-dir": "nyc/.cache",
"temp-directory": "nyc/.nyc_output",
"report-dir": "nyc/report"
}
18 changes: 18 additions & 0 deletions experimental/dds/tree-graphql/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Coverage
nyc

# Build output
dist
lib

# Dependencies
node_modules

# Used by API-Extractor
*.api.md
_api-extractor-temp/**

# Formatting is not properly enforced in PR gating since `lerna version` uniformizes the file in a previous pipeline step.
# Since in practice this is likely only a tabs vs spaces issue, this file has just been converted to match the rest of the
# repository.
package.json
8 changes: 8 additions & 0 deletions experimental/dds/tree-graphql/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"arrowParens": "always",
"tabWidth": 4,
"useTabs": true,
"printWidth": 120,
"singleQuote": true,
"endOfLine": "auto"
}
21 changes: 21 additions & 0 deletions experimental/dds/tree-graphql/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Copyright (c) Microsoft Corporation and contributors. All rights reserved.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
11 changes: 11 additions & 0 deletions experimental/dds/tree-graphql/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# @fluid-experimental/tree-graphql

A prototype package which uses the @graphql-codegen library to automatically generate graphql types and resolvers that can read a SharedTree (see @fluid-experimental/tree) via a given graphql schema.

# Codegen

This repo includes an [example graphql schema called 'Pizza'](.\src\graphql-schemas\Pizza.ts) in the './src/graphql-schemas' folder. After running codegen, an associated output file will be generated in the './src/graphql-generated' folder. This behavior is customized by a [graphql-codegen plugin](https://graphql-code-generator.com/docs/custom-codegen/index) called [SharedTreePlugin](.\src\graphql-plugins\SharedTreePlugin.ts), and the codegen step itself is configured via the [codegen.yml](.\codegen.yml) file in the repo root.

# Usage

After running `npm run refresh`, run `npm run codegen` in this package, followed by a build. Then the tests in [SharedTreeQuerier.tests.ts](.\src\test\SharedTreeQuerier.tests.ts) can be run.
4 changes: 4 additions & 0 deletions experimental/dds/tree-graphql/api-extractor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "@fluidframework/build-common/api-extractor-common.json"
}
6 changes: 6 additions & 0 deletions experimental/dds/tree-graphql/codegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
schema: 'src/graphql-schemas/Pizza.ts'
generates:
src/graphql-generated/Pizza.ts:
plugins:
- 'typescript'
- dist/graphql-plugins/SharedTreePlugin.js
65 changes: 65 additions & 0 deletions experimental/dds/tree-graphql/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"name": "@fluid-experimental/tree-graphql",
"version": "1.4.0",
"description": "Prototype using GraphQL to access a distributed tree",
"homepage": "https://fluidframework.com",
"repository": {
"type": "git",
"url": "https://github.com/microsoft/FluidFramework.git",
"directory": "experimental/dds/tree-graphql"
},
"license": "MIT",
"author": "Microsoft and contributors",
"sideEffects": false,
"main": "dist/index.js",
"module": "lib/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "concurrently npm:build:compile npm:lint",
"build:codegen": "npm run build:plugins && graphql-codegen --config codegen.yml && prettier --write src/graphql-generated/*",
"build:compile": "concurrently npm:tsc npm:build:esnext",
"build:docs": "api-extractor run --local",
"build:esnext": "tsc --project ./tsconfig.esnext.json",
"build:full": "npm run build",
"build:full:compile": "npm run build:compile",
"build:plugins": "tsc --project ./tsconfig-graphql-plugins.json",
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
"eslint": "eslint src",
"eslint:fix": "eslint src --fix",
"lint": "npm run prettier && npm run eslint",
"lint:fix": "npm run prettier:fix && npm run eslint:fix",
"prettier": "prettier --check \"**/*.{js,json,jsx,md,ts,tsx,yml,yaml}\"",
"prettier:fix": "prettier --write \"**/*.{js,json,jsx,md,ts,tsx,yml,yaml}\"",
"test": "nyc npm run test:mocha",
"test:mocha": "mocha \"dist/**/*.tests.js\" --exit -r node_modules/@fluidframework/mocha-test-setup --unhandled-rejections=strict",
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
"tsc": "tsc"
},
"dependencies": {
"@fluid-experimental/tree": "^1.4.0",
"@fluidframework/common-utils": "^0.32.2",
"@graphql-codegen/plugin-helpers": "^1.18.2",
"@graphql-codegen/visitor-plugin-common": "^1.18.2",
"graphql": "^15.4.0",
"graphql-tools": "^7.0.2"
},
"devDependencies": {
"@fluidframework/mocha-test-setup": "^1.4.0",
"@fluidframework/test-runtime-utils": "^1.4.0",
"@graphql-codegen/cli": "1.20.1",
"@graphql-codegen/typescript": "1.20.2",
"@microsoft/api-extractor": "^7.22.2",
"@rushstack/eslint-config": "^2.5.1",
"@types/mocha": "^9.1.1",
"@types/ws": "^6.0.1",
"chai": "^4.2.0",
"concurrently": "^6.2.0",
"cross-env": "^7.0.2",
"eslint": "~8.6.0",
"mocha": "^10.0.0",
"nyc": "^15.0.0",
"prettier": "^2.3.1",
"rimraf": "^2.6.2",
"typescript": "~4.5.5"
}
}
Loading

0 comments on commit 4b47802

Please sign in to comment.