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

spfx-search-document #29

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
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
25 changes: 25 additions & 0 deletions apps/spfx-search-document/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true


[*]

# change these settings to your own preference
indent_style = space
indent_size = 2

# we recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[{package,bower}.json]
indent_style = space
indent_size = 2
1 change: 1 addition & 0 deletions apps/spfx-search-document/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
32 changes: 32 additions & 0 deletions apps/spfx-search-document/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Logs
logs
*.log
npm-debug.log*

# Dependency directories
node_modules

# Build generated files
dist
lib
solution
temp
*.sppkg

# Coverage directory used by tools like istanbul
coverage

# OSX
.DS_Store

# Visual Studio files
.ntvs_analysis.dat
.vs
bin
obj

# Resx Generated Code
*.resx.ts

# Styles Generated Code
*.scss.ts
14 changes: 14 additions & 0 deletions apps/spfx-search-document/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Folders
.vscode
coverage
node_modules
sharepoint
src
temp

# Files
*.csproj
.git*
.yo-rc.json
gulpfile.js
tsconfig.json
75 changes: 75 additions & 0 deletions apps/spfx-search-document/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// Place your settings in this file to overwrite default and user settings.
{
// Configure glob patterns for excluding files and folders in the file explorer.
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true,
"**/bower_components": true,
"**/coverage": true,
"**/lib-amd": true,
"src/**/*.scss.ts": true
},
"typescript.tsdk": ".\\node_modules\\typescript\\lib",
"json.schemas": [
{
"fileMatch": [
"/config/config.json"
],
"url": "./node_modules/@microsoft/sp-build-web/lib/schemas/config.schema.json"
},
{
"fileMatch": [
"/config/copy-assets.json"
],
"url": "./node_modules/@microsoft/sp-build-core-tasks/lib/copyAssets/copy-assets.schema.json"
},
{
"fileMatch": [
"/config/deploy-azure-storage.json"
],
"url": "./node_modules/@microsoft/sp-build-core-tasks/lib/deployAzureStorage/deploy-azure-storage.schema.json"
},
{
"fileMatch": [
"/config/package-solution.json"
],
"url": "./node_modules/@microsoft/sp-build-core-tasks/lib/packageSolution/package-solution.schema.json"
},
{
"fileMatch": [
"/config/serve.json"
],
"url": "./node_modules/@microsoft/gulp-core-build-serve/lib/serve.schema.json"
},
{
"fileMatch": [
"/config/tslint.json"
],
"url": "./node_modules/@microsoft/gulp-core-build-typescript/lib/schemas/tslint.schema.json"
},
{
"fileMatch": [
"/config/write-manifests.json"
],
"url": "./node_modules/@microsoft/sp-build-core-tasks/lib/writeManifests/write-manifests.schema.json"
},
{
"fileMatch": [
"/config/configure-webpack.json"
],
"url": "./node_modules/@microsoft/sp-build-core-tasks/lib/configureWebpack/configure-webpack.schema.json"
},
{
"fileMatch": [
"/config/configure-external-bundling-webpack.json"
],
"url": "./node_modules/@microsoft/sp-build-core-tasks/lib/configureWebpack/configure-webpack-external-bundling.schema.json"
},
{
"fileMatch": [
"/copy-static-assets.json"
],
"url": "./node_modules/@microsoft/sp-build-core-tasks/lib/copyStaticAssets/copy-static-assets.schema.json"
}
]
}
8 changes: 8 additions & 0 deletions apps/spfx-search-document/.yo-rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"@microsoft/generator-sharepoint": {
"version": "1.1.0",
"libraryName": "spfx-search-document",
"libraryId": "eb7656ce-d8ae-4f87-8d77-4dbb4a726177",
"environment": "spo"
}
}
27 changes: 27 additions & 0 deletions apps/spfx-search-document/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## spfx-search-document

This is where you include your WebPart documentation.
This is SPFX webpart + react js

### Building the code

```bash
git clone the repo
npm i
npm i -g gulp
gulp
```

This package produces the following:

* lib/* - intermediate-stage commonjs build artifacts
* dist/* - the bundled script, along with other resources
* deploy/* - all resources which should be uploaded to a CDN.

### Build options

gulp clean - TODO
gulp test - TODO
gulp serve - TODO
gulp bundle - TODO
gulp package-solution - TODO
23 changes: 23 additions & 0 deletions apps/spfx-search-document/StepByStep.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
### step by step
https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part
https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/use-fabric-react-components
https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/provision-sp-assets-from-package

### setup environment

yo @microsoft/sharepoint

gulp trust-dev-cert

gulp serve
gulp serve --nobrowser

### package & deploy solution

gulp bundle

gulp package-solution

gulp --ship

gulp package-solution --ship
13 changes: 13 additions & 0 deletions apps/spfx-search-document/config/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"entries": [
{
"entry": "./lib/webparts/spfxSearchDocument/SpfxSearchDocumentWebPart.js",
"manifest": "./src/webparts/spfxSearchDocument/SpfxSearchDocumentWebPart.manifest.json",
"outputPath": "./dist/spfx-search-document.bundle.js"
}
],
"externals": {},
"localizedResources": {
"spfxSearchDocumentStrings": "webparts/spfxSearchDocument/loc/{locale}.js"
}
}
3 changes: 3 additions & 0 deletions apps/spfx-search-document/config/copy-assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"deployCdnPath": "temp/deploy"
}
6 changes: 6 additions & 0 deletions apps/spfx-search-document/config/deploy-azure-storage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"workingDir": "./temp/deploy/",
"account": "<!-- STORAGE ACCOUNT NAME -->",
"container": "spfx-search-document",
"accessKey": "<!-- ACCESS KEY -->"
}
24 changes: 24 additions & 0 deletions apps/spfx-search-document/config/package-solution.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"solution": {
"name": "spfx-search-document-client-side-solution",
"id": "eb7656ce-d8ae-4f87-8d77-4dbb4a726177",
"version": "1.0.0.0",
"features": [{
"title": "asset-deployment-webpart-client-side-solution",
"description": "asset-deployment-webpart-client-side-solution",
"id": "523fe887-ced5-4036-b564-8dad5c6c6e24",
"version": "1.0.0.0",
"assets": {
"elementManifests": [
"elements.xml"
],
"elementFiles":[
"schema.xml"
]
}
}]
},
"paths": {
"zippedPackage": "solution/spfx-search-document.sppkg"
}
}
9 changes: 9 additions & 0 deletions apps/spfx-search-document/config/serve.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"port": 4321,
"initialPage": "https://localhost:5432/workbench",
"https": true,
"api": {
"port": 5432,
"entryPath": "node_modules/@microsoft/sp-webpart-workbench/lib/api/"
}
}
45 changes: 45 additions & 0 deletions apps/spfx-search-document/config/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
// Display errors as warnings
"displayAsWarning": true,
// The TSLint task may have been configured with several custom lint rules
// before this config file is read (for example lint rules from the tslint-microsoft-contrib
// project). If true, this flag will deactivate any of these rules.
"removeExistingRules": true,
// When true, the TSLint task is configured with some default TSLint "rules.":
"useDefaultConfigAsBase": false,
// Since removeExistingRules=true and useDefaultConfigAsBase=false, there will be no lint rules
// which are active, other than the list of rules below.
"lintConfig": {
// Opt-in to Lint rules which help to eliminate bugs in JavaScript
"rules": {
"class-name": false,
"export-name": false,
"forin": false,
"label-position": false,
"member-access": true,
"no-arg": false,
"no-console": false,
"no-construct": false,
"no-duplicate-case": true,
"no-duplicate-variable": true,
"no-eval": false,
"no-function-expression": true,
"no-internal-module": true,
"no-shadowed-variable": true,
"no-switch-case-fall-through": true,
"no-unnecessary-semicolons": true,
"no-unused-expression": true,
"no-unused-imports": true,
"no-use-before-declare": true,
"no-with-statement": true,
"semicolon": true,
"trailing-comma": false,
"typedef": false,
"typedef-whitespace": false,
"use-named-parameter": true,
"valid-typeof": true,
"variable-name": false,
"whitespace": false
}
}
}
3 changes: 3 additions & 0 deletions apps/spfx-search-document/config/write-manifests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cdnBasePath": "https://development365.sharepoint.com/Style%20Library/spfx-search-document/"
}
22 changes: 22 additions & 0 deletions apps/spfx-search-document/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict';

const gulp = require('gulp');
const build = require('@microsoft/sp-build-web');

build.configureWebpack.mergeConfig({
additionalConfiguration: (generatedConfiguration) => {
if (build.getConfig().production) {
var basePath = build.writeManifests.taskConfig.cdnBasePath;
if (!basePath.endsWith('/')) {
basePath += '/';
}
generatedConfiguration.output.publicPath = basePath;
}
else {
generatedConfiguration.output.publicPath = "/dist/";
}
return generatedConfiguration;
}
});

build.initialize(gulp);
33 changes: 33 additions & 0 deletions apps/spfx-search-document/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "spfx-search-document",
"version": "0.0.1",
"private": true,
"engines": {
"node": ">=6.11.1"
},
"dependencies": {
"@microsoft/sp-core-library": "~1.1.0",
"@microsoft/sp-webpart-base": "~1.1.0",
"@types/react": "0.14.46",
"@types/react-addons-shallow-compare": "0.14.17",
"@types/react-addons-test-utils": "0.14.15",
"@types/react-addons-update": "0.14.14",
"@types/react-dom": "0.14.18",
"@types/webpack-env": ">=1.12.1 <1.14.0",
"react": "^15.4.2",
"react-dom": "^15.4.2"
},
"devDependencies": {
"@microsoft/sp-build-web": "~1.1.0",
"@microsoft/sp-module-interfaces": "~1.1.0",
"@microsoft/sp-webpart-workbench": "~1.1.0",
"gulp": "~3.9.1",
"@types/chai": ">=3.4.34 <3.6.0",
"@types/mocha": ">=2.2.33 <2.6.0"
},
"scripts": {
"build": "gulp bundle",
"clean": "gulp clean",
"test": "gulp test"
}
}
Loading